This source file includes following definitions.
- get_system_type
- env_or_default
- prom_init
- pnx833x_board_setup
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/init.h>
13 #include <asm/bootinfo.h>
14 #include <linux/mm.h>
15 #include <pnx833x.h>
16 #include <gpio.h>
17
18
19 #define PNX8335_DEBUG0 0x4400
20 #define PNX8335_DEBUG1 0x4404
21 #define PNX8335_DEBUG2 0x4408
22 #define PNX8335_DEBUG3 0x440c
23 #define PNX8335_DEBUG4 0x4410
24 #define PNX8335_DEBUG5 0x4414
25 #define PNX8335_DEBUG6 0x4418
26 #define PNX8335_DEBUG7 0x441c
27
28 int prom_argc;
29 char **prom_argv, **prom_envp;
30
31 extern void prom_init_cmdline(void);
32 extern char *prom_getenv(char *envname);
33
34 const char *get_system_type(void)
35 {
36 return "NXP STB22x";
37 }
38
39 static inline unsigned long env_or_default(char *env, unsigned long dfl)
40 {
41 char *str = prom_getenv(env);
42 return str ? simple_strtol(str, 0, 0) : dfl;
43 }
44
45 void __init prom_init(void)
46 {
47 unsigned long memsize;
48
49 prom_argc = fw_arg0;
50 prom_argv = (char **)fw_arg1;
51 prom_envp = (char **)fw_arg2;
52
53 prom_init_cmdline();
54
55 memsize = env_or_default("memsize", 0x02000000);
56 add_memory_region(0, memsize, BOOT_MEM_RAM);
57 }
58
59 void __init pnx833x_board_setup(void)
60 {
61 pnx833x_gpio_select_function_alt(4);
62 pnx833x_gpio_select_output(4);
63 pnx833x_gpio_select_function_alt(5);
64 pnx833x_gpio_select_input(5);
65 pnx833x_gpio_select_function_alt(6);
66 pnx833x_gpio_select_input(6);
67 pnx833x_gpio_select_function_alt(7);
68 pnx833x_gpio_select_output(7);
69
70 pnx833x_gpio_select_function_alt(25);
71 pnx833x_gpio_select_function_alt(26);
72
73 pnx833x_gpio_select_function_alt(27);
74 pnx833x_gpio_select_function_alt(28);
75 pnx833x_gpio_select_function_alt(29);
76 pnx833x_gpio_select_function_alt(30);
77 pnx833x_gpio_select_function_alt(31);
78 pnx833x_gpio_select_function_alt(32);
79 pnx833x_gpio_select_function_alt(33);
80
81 #if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)
82
83
84
85
86
87
88
89
90 PNX833X_MIU_SEL0 = 0;
91 PNX833X_MIU_SEL1 = 0;
92 PNX833X_MIU_SEL0_TIMING = 0x50003081;
93 PNX833X_MIU_SEL1_TIMING = 0x50003081;
94
95
96 pnx833x_gpio_select_function_alt(0);
97
98
99 pnx833x_gpio_select_function_io(4);
100 pnx833x_gpio_select_input(4);
101
102
103 pnx833x_gpio_select_function_io(5);
104 pnx833x_gpio_select_output(5);
105 pnx833x_gpio_write(1, 5);
106
107 #elif IS_ENABLED(CONFIG_MTD_CFI)
108
109
110
111
112 PNX833X_MIU_SEL0 = 1;
113 PNX833X_MIU_SEL1 = 1;
114 PNX833X_MIU_SEL0_TIMING = 0x6A08D082;
115 PNX833X_MIU_SEL1_TIMING = 0x6A08D082;
116
117
118 pnx833x_gpio_select_function_alt(0);
119 #endif
120 }