aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/generic/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/txx9/generic/setup.c')
-rw-r--r--arch/mips/txx9/generic/setup.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 5afc5d5cab03..8c60c78b9a9e 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -19,7 +19,9 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/gpio.h>
22#include <asm/bootinfo.h> 23#include <asm/bootinfo.h>
24#include <asm/time.h>
23#include <asm/txx9/generic.h> 25#include <asm/txx9/generic.h>
24#ifdef CONFIG_CPU_TX49XX 26#ifdef CONFIG_CPU_TX49XX
25#include <asm/txx9/tx4938.h> 27#include <asm/txx9/tx4938.h>
@@ -30,6 +32,7 @@ struct resource txx9_ce_res[8];
30static char txx9_ce_res_name[8][4]; /* "CEn" */ 32static char txx9_ce_res_name[8][4]; /* "CEn" */
31 33
32/* pcode, internal register */ 34/* pcode, internal register */
35unsigned int txx9_pcode;
33char txx9_pcode_str[8]; 36char txx9_pcode_str[8];
34static struct resource txx9_reg_res = { 37static struct resource txx9_reg_res = {
35 .name = txx9_pcode_str, 38 .name = txx9_pcode_str,
@@ -59,15 +62,16 @@ unsigned int txx9_master_clock;
59unsigned int txx9_cpu_clock; 62unsigned int txx9_cpu_clock;
60unsigned int txx9_gbus_clock; 63unsigned int txx9_gbus_clock;
61 64
65int txx9_ccfg_toeon __initdata = 1;
62 66
63/* Minimum CLK support */ 67/* Minimum CLK support */
64 68
65struct clk *clk_get(struct device *dev, const char *id) 69struct clk *clk_get(struct device *dev, const char *id)
66{ 70{
67 if (!strcmp(id, "spi-baseclk")) 71 if (!strcmp(id, "spi-baseclk"))
68 return (struct clk *)(txx9_gbus_clock / 2 / 4); 72 return (struct clk *)((unsigned long)txx9_gbus_clock / 2 / 4);
69 if (!strcmp(id, "imbus_clk")) 73 if (!strcmp(id, "imbus_clk"))
70 return (struct clk *)(txx9_gbus_clock / 2); 74 return (struct clk *)((unsigned long)txx9_gbus_clock / 2);
71 return ERR_PTR(-ENOENT); 75 return ERR_PTR(-ENOENT);
72} 76}
73EXPORT_SYMBOL(clk_get); 77EXPORT_SYMBOL(clk_get);
@@ -94,6 +98,22 @@ void clk_put(struct clk *clk)
94} 98}
95EXPORT_SYMBOL(clk_put); 99EXPORT_SYMBOL(clk_put);
96 100
101/* GPIO support */
102
103#ifdef CONFIG_GENERIC_GPIO
104int gpio_to_irq(unsigned gpio)
105{
106 return -EINVAL;
107}
108EXPORT_SYMBOL(gpio_to_irq);
109
110int irq_to_gpio(unsigned irq)
111{
112 return -EINVAL;
113}
114EXPORT_SYMBOL(irq_to_gpio);
115#endif
116
97extern struct txx9_board_vec jmr3927_vec; 117extern struct txx9_board_vec jmr3927_vec;
98extern struct txx9_board_vec rbtx4927_vec; 118extern struct txx9_board_vec rbtx4927_vec;
99extern struct txx9_board_vec rbtx4937_vec; 119extern struct txx9_board_vec rbtx4937_vec;
@@ -107,6 +127,12 @@ void __init prom_init_cmdline(void)
107 int argc = (int)fw_arg0; 127 int argc = (int)fw_arg0;
108 char **argv = (char **)fw_arg1; 128 char **argv = (char **)fw_arg1;
109 int i; /* Always ignore the "-c" at argv[0] */ 129 int i; /* Always ignore the "-c" at argv[0] */
130#ifdef CONFIG_64BIT
131 char *fixed_argv[32];
132 for (i = 0; i < argc; i++)
133 fixed_argv[i] = (char *)(long)(*((__s32 *)argv + i));
134 argv = fixed_argv;
135#endif
110 136
111 /* ignore all built-in args if any f/w args given */ 137 /* ignore all built-in args if any f/w args given */
112 if (argc > 1) 138 if (argc > 1)
@@ -126,15 +152,19 @@ void __init prom_init(void)
126#endif 152#endif
127#ifdef CONFIG_CPU_TX49XX 153#ifdef CONFIG_CPU_TX49XX
128 switch (TX4938_REV_PCODE()) { 154 switch (TX4938_REV_PCODE()) {
155#ifdef CONFIG_TOSHIBA_RBTX4927
129 case 0x4927: 156 case 0x4927:
130 txx9_board_vec = &rbtx4927_vec; 157 txx9_board_vec = &rbtx4927_vec;
131 break; 158 break;
132 case 0x4937: 159 case 0x4937:
133 txx9_board_vec = &rbtx4937_vec; 160 txx9_board_vec = &rbtx4937_vec;
134 break; 161 break;
162#endif
163#ifdef CONFIG_TOSHIBA_RBTX4938
135 case 0x4938: 164 case 0x4938:
136 txx9_board_vec = &rbtx4938_vec; 165 txx9_board_vec = &rbtx4938_vec;
137 break; 166 break;
167#endif
138 } 168 }
139#endif 169#endif
140 170
@@ -160,6 +190,10 @@ char * __init prom_getcmdline(void)
160/* wrappers */ 190/* wrappers */
161void __init plat_mem_setup(void) 191void __init plat_mem_setup(void)
162{ 192{
193 ioport_resource.start = 0;
194 ioport_resource.end = ~0UL; /* no limit */
195 iomem_resource.start = 0;
196 iomem_resource.end = ~0UL; /* no limit */
163 txx9_board_vec->mem_setup(); 197 txx9_board_vec->mem_setup();
164} 198}
165 199