Changeset 18225
- Timestamp:
- 01/19/12 17:29:10 (16 months ago)
- Location:
- src/linux/universal/linux-3.2/arch/mips/lantiq
- Files:
-
- 36 added
- 4 deleted
- 26 edited
-
Kconfig (modified) (2 diffs)
-
Makefile (modified) (1 diff)
-
Platform (modified) (1 diff)
-
clk.c (modified) (3 diffs)
-
dev-gpio-buttons.c (added)
-
dev-gpio-leds.c (added)
-
devices.c (modified) (6 diffs)
-
devices.h (modified) (2 diffs)
-
early_printk.c (modified) (2 diffs)
-
falcon (added)
-
falcon/Kconfig (added)
-
falcon/Makefile (added)
-
falcon/addon-easy98000.c (added)
-
falcon/clk.c (added)
-
falcon/dev-leds-easy98000-cpld.c (added)
-
falcon/dev-leds-easy98000-cpld.h (added)
-
falcon/devices.c (added)
-
falcon/devices.h (added)
-
falcon/gpio.c (added)
-
falcon/mach-95C3AM1.c (added)
-
falcon/mach-easy98000.c (added)
-
falcon/mach-easy98020.c (added)
-
falcon/prom.c (added)
-
falcon/reset.c (added)
-
falcon/softdog_vpe.c (added)
-
falcon/sysctrl.c (added)
-
irq.c (modified) (7 diffs)
-
machtypes.h (modified) (1 diff)
-
prom.c (modified) (3 diffs)
-
prom.h (modified) (3 diffs)
-
setup.c (modified) (2 diffs)
-
xway/Kconfig (modified) (2 diffs)
-
xway/Makefile (modified) (1 diff)
-
xway/clk-vr9.c (added)
-
xway/clk-xway.c (modified) (1 diff)
-
xway/dev-dwc_otg.c (added)
-
xway/dev-dwc_otg.h (added)
-
xway/dev-wifi-ath5k.c (added)
-
xway/dev-wifi-ath5k.h (added)
-
xway/dev-wifi-rt2x00.c (added)
-
xway/dev-wifi-rt2x00.h (added)
-
xway/devices.c (modified) (7 diffs)
-
xway/devices.h (modified) (2 diffs)
-
xway/dma.c (modified) (3 diffs)
-
xway/ebu.c (deleted)
-
xway/gpio.c (modified) (8 diffs)
-
xway/gpio_ebu.c (modified) (1 diff)
-
xway/gpio_stp.c (modified) (3 diffs)
-
xway/mach-arv45xx.c (added)
-
xway/mach-easy50601.c (modified) (2 diffs)
-
xway/mach-easy50712.c (modified) (2 diffs)
-
xway/mach-fritz.c (added)
-
xway/mach-gigasx76x.c (added)
-
xway/mach-gigasx76x.h (added)
-
xway/mach-netgear.c (added)
-
xway/mach-wbmr.c (added)
-
xway/nand.c (added)
-
xway/pmu.c (deleted)
-
xway/prom-ase.c (modified) (3 diffs)
-
xway/prom-vr9.c (added)
-
xway/prom-xway.c (modified) (3 diffs)
-
xway/reset.c (modified) (3 diffs)
-
xway/setup-ase.c (deleted)
-
xway/setup-xway.c (deleted)
-
xway/sysctrl.c (added)
-
xway/timer.c (added)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/universal/linux-3.2/arch/mips/lantiq/Kconfig
r18171 r18225 1 1 if LANTIQ 2 3 config LANTIQ_PCIE 4 bool 2 5 3 6 config SOC_TYPE_XWAY … … 17 20 select SOC_TYPE_XWAY 18 21 select HW_HAS_PCI 22 23 config SOC_VR9 24 bool "VR9" 25 select SOC_TYPE_XWAY 26 select HW_HAS_PCI 27 select LANTIQ_PCIE 28 29 config SOC_FALCON 30 bool "FALCON" 19 31 endchoice 20 32 33 config AR9 34 bool "AR9 DSL Driver extensions" 35 21 36 source "arch/mips/lantiq/xway/Kconfig" 37 source "arch/mips/lantiq/falcon/Kconfig" 22 38 23 39 endif -
src/linux/universal/linux-3.2/arch/mips/lantiq/Makefile
r18171 r18225 5 5 # by the Free Software Foundation. 6 6 7 obj-y := irq.o setup.o clk.o prom.o devices.o 7 obj-y := irq.o setup.o clk.o prom.o devices.o dev-gpio-leds.o dev-gpio-buttons.o 8 8 9 9 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 10 10 11 11 obj-$(CONFIG_SOC_TYPE_XWAY) += xway/ 12 obj-$(CONFIG_SOC_FALCON) += falcon/ -
src/linux/universal/linux-3.2/arch/mips/lantiq/Platform
r18171 r18225 7 7 load-$(CONFIG_LANTIQ) = 0xffffffff80002000 8 8 cflags-$(CONFIG_SOC_TYPE_XWAY) += -I$(srctree)/arch/mips/include/asm/mach-lantiq/xway 9 cflags-$(CONFIG_SOC_TYPE_VR9) += -I$(srctree)/arch/mips/include/asm/mach-lantiq/xway 10 cflags-$(CONFIG_SOC_FALCON) += -I$(srctree)/arch/mips/include/asm/mach-lantiq/falcon -
src/linux/universal/linux-3.2/arch/mips/lantiq/clk.c
r18171 r18225 23 23 24 24 #include "clk.h" 25 #include "prom.h" 25 26 26 27 struct clk { … … 46 47 }, 47 48 }; 48 49 static struct resource ltq_cgu_resource = {50 .name = "cgu",51 .start = LTQ_CGU_BASE_ADDR,52 .end = LTQ_CGU_BASE_ADDR + LTQ_CGU_SIZE - 1,53 .flags = IORESOURCE_MEM,54 };55 56 /* remapped clock register range */57 void __iomem *ltq_cgu_membase;58 49 59 50 void clk_init(void) … … 134 125 struct clk *clk; 135 126 136 if (insert_resource(&iomem_resource, <q_cgu_resource) < 0) 137 panic("Failed to insert cgu memory\n"); 127 ltq_soc_init(); 138 128 139 if (request_mem_region(ltq_cgu_resource.start,140 resource_size(<q_cgu_resource), "cgu") < 0)141 panic("Failed to request cgu memory\n");142 143 ltq_cgu_membase = ioremap_nocache(ltq_cgu_resource.start,144 resource_size(<q_cgu_resource));145 if (!ltq_cgu_membase) {146 pr_err("Failed to remap cgu memory\n");147 unreachable();148 }149 129 clk = clk_get(0, "cpu"); 150 130 mips_hpt_frequency = clk_get_rate(clk) / ltq_get_counter_resolution(); 151 131 write_c0_compare(read_c0_count()); 132 pr_info("CPU Clock: %ldMHz\n", clk_get_rate(clk) / 1000000); 152 133 clk_put(clk); 153 134 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/devices.c
r18171 r18225 19 19 #include <linux/io.h> 20 20 #include <linux/gpio.h> 21 #include <linux/dma-mapping.h> 21 22 22 23 #include <asm/bootinfo.h> … … 28 29 29 30 /* nor flash */ 30 static struct resource ltq_nor_resource = { 31 .name = "nor", 32 .start = LTQ_FLASH_START, 33 .end = LTQ_FLASH_START + LTQ_FLASH_MAX - 1, 34 .flags = IORESOURCE_MEM, 35 }; 31 static struct resource ltq_nor_resource = 32 MEM_RES("nor", LTQ_FLASH_START, LTQ_FLASH_MAX); 36 33 37 34 static struct platform_device ltq_nor = { … … 48 45 49 46 /* watchdog */ 50 static struct resource ltq_wdt_resource = { 51 .name = "watchdog", 52 .start = LTQ_WDT_BASE_ADDR, 53 .end = LTQ_WDT_BASE_ADDR + LTQ_WDT_SIZE - 1, 54 .flags = IORESOURCE_MEM, 55 }; 47 static struct resource ltq_wdt_resource = 48 MEM_RES("watchdog", LTQ_WDT_BASE_ADDR, LTQ_WDT_SIZE); 56 49 57 50 void __init ltq_register_wdt(void) … … 62 55 /* asc ports */ 63 56 static struct resource ltq_asc0_resources[] = { 64 { 65 .name = "asc0", 66 .start = LTQ_ASC0_BASE_ADDR, 67 .end = LTQ_ASC0_BASE_ADDR + LTQ_ASC_SIZE - 1, 68 .flags = IORESOURCE_MEM, 69 }, 57 MEM_RES("asc0", LTQ_ASC0_BASE_ADDR, LTQ_ASC_SIZE), 70 58 IRQ_RES(tx, LTQ_ASC_TIR(0)), 71 59 IRQ_RES(rx, LTQ_ASC_RIR(0)), … … 74 62 75 63 static struct resource ltq_asc1_resources[] = { 76 { 77 .name = "asc1", 78 .start = LTQ_ASC1_BASE_ADDR, 79 .end = LTQ_ASC1_BASE_ADDR + LTQ_ASC_SIZE - 1, 80 .flags = IORESOURCE_MEM, 81 }, 64 MEM_RES("asc1", LTQ_ASC1_BASE_ADDR, LTQ_ASC_SIZE), 82 65 IRQ_RES(tx, LTQ_ASC_TIR(1)), 83 66 IRQ_RES(rx, LTQ_ASC_RIR(1)), … … 119 102 } 120 103 #endif 104 105 static unsigned int *cp1_base = 0; 106 unsigned int* 107 ltq_get_cp1_base(void) 108 { 109 return cp1_base; 110 } 111 EXPORT_SYMBOL(ltq_get_cp1_base); 112 113 void __init 114 ltq_register_tapi(void) 115 { 116 #define CP1_SIZE (1 << 20) 117 dma_addr_t dma; 118 cp1_base = 119 (void*)CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, &dma, GFP_ATOMIC)); 120 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/devices.h
r18171 r18225 15 15 #define IRQ_RES(resname, irq) \ 16 16 {.name = #resname, .start = (irq), .flags = IORESOURCE_IRQ} 17 #define MEM_RES(resname, adr_start, adr_size) \ 18 { .name = resname, .flags = IORESOURCE_MEM, \ 19 .start = ((adr_start) & ~KSEG1), \ 20 .end = ((adr_start + adr_size - 1) & ~KSEG1) } 17 21 18 22 extern void ltq_register_nor(struct physmap_flash_data *data); … … 20 24 extern void ltq_register_asc(int port); 21 25 extern void ltq_register_pci(struct ltq_pci_data *data); 26 extern void ltq_register_tapi(void); 22 27 23 28 #endif -
src/linux/universal/linux-3.2/arch/mips/lantiq/early_printk.c
r18171 r18225 13 13 #include <lantiq_soc.h> 14 14 15 /* no ioremap possible at this early stage, lets use KSEG1 instead */16 #define LTQ_ASC_BASE KSEG1ADDR(LTQ_ASC1_BASE_ADDR)17 15 #define ASC_BUF 1024 18 #define LTQ_ASC_FSTAT ((u32 *)(LTQ_ASC_BASE + 0x0048)) 19 #define LTQ_ASC_TBUF ((u32 *)(LTQ_ASC_BASE + 0x0020)) 16 #define LTQ_ASC_FSTAT ((u32 *)(LTQ_EARLY_ASC + 0x0048)) 17 #ifdef __BIG_ENDIAN 18 #define LTQ_ASC_TBUF ((u32 *)(LTQ_EARLY_ASC + 0x0020 + 3)) 19 #else 20 #define LTQ_ASC_TBUF ((u32 *)(LTQ_EARLY_ASC + 0x0020)) 21 #endif 20 22 #define TXMASK 0x3F00 21 23 #define TXOFFSET 8 … … 28 30 do { } while ((ltq_r32(LTQ_ASC_FSTAT) & TXMASK) >> TXOFFSET); 29 31 if (c == '\n') 30 ltq_w 32('\r', LTQ_ASC_TBUF);31 ltq_w 32(c, LTQ_ASC_TBUF);32 ltq_w8('\r', LTQ_ASC_TBUF); 33 ltq_w8(c, LTQ_ASC_TBUF); 32 34 local_irq_restore(flags); 33 35 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/irq.c
r18171 r18225 10 10 #include <linux/interrupt.h> 11 11 #include <linux/ioport.h> 12 #include <linux/module.h> 12 13 13 14 #include <asm/bootinfo.h> … … 41 42 #define MAX_EIU 6 42 43 44 /* the performance counter */ 45 #define LTQ_PERF_IRQ (INT_NUM_IM4_IRL0 + 31) 46 43 47 /* irqs generated by device attached to the EBU need to be acked in 44 48 * a special manner … … 100 104 ltq_icu_w32((1 << irq_nr), isr); 101 105 } 106 EXPORT_SYMBOL(ltq_mask_and_ack_irq); 102 107 103 108 static void ltq_ack_irq(struct irq_data *d) … … 196 201 197 202 /* if this is a EBU irq, we need to ack it or get a deadlock */ 198 if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) )203 if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT) 199 204 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_ISTAT) | 0x10, 200 205 LTQ_EBU_PCC_ISTAT); … … 261 266 panic("Failed to remap icu memory\n"); 262 267 263 if (insert_resource(&iomem_resource, <q_eiu_resource) < 0) 264 panic("Failed to insert eiu memory\n"); 265 266 if (request_mem_region(ltq_eiu_resource.start, 267 resource_size(<q_eiu_resource), "eiu") < 0) 268 panic("Failed to request eiu memory\n"); 269 270 ltq_eiu_membase = ioremap_nocache(ltq_eiu_resource.start, 268 if (LTQ_EIU_BASE_ADDR) { 269 if (insert_resource(&iomem_resource, <q_eiu_resource) < 0) 270 panic("Failed to insert eiu memory\n"); 271 272 if (request_mem_region(ltq_eiu_resource.start, 273 resource_size(<q_eiu_resource), "eiu") < 0) 274 panic("Failed to request eiu memory\n"); 275 276 ltq_eiu_membase = ioremap_nocache(ltq_eiu_resource.start, 271 277 resource_size(<q_eiu_resource)); 272 if (!ltq_eiu_membase) 273 panic("Failed to remap eiu memory\n"); 278 if (!ltq_eiu_membase) 279 panic("Failed to remap eiu memory\n"); 280 } 274 281 275 282 /* make sure all irqs are turned off by default */ … … 297 304 for (i = INT_NUM_IRQ0; 298 305 i <= (INT_NUM_IRQ0 + (5 * INT_NUM_IM_OFFSET)); i++) 299 if (( i == LTQ_EIU_IR0) || (i == LTQ_EIU_IR1) ||300 (i == LTQ_EIU_IR2)) 306 if (((i == LTQ_EIU_IR0) || (i == LTQ_EIU_IR1) || 307 (i == LTQ_EIU_IR2)) && LTQ_EIU_BASE_ADDR) 301 308 irq_set_chip_and_handler(i, <q_eiu_type, 302 309 handle_level_irq); … … 317 324 IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5); 318 325 #endif 326 327 cp0_perfcount_irq = LTQ_PERF_IRQ; 319 328 } 320 329 -
src/linux/universal/linux-3.2/arch/mips/lantiq/machtypes.h
r18171 r18225 16 16 LTQ_MACH_EASY50712, /* Danube evaluation board */ 17 17 LTQ_MACH_EASY50601, /* Amazon SE evaluation board */ 18 19 /* FALCON */ 20 LANTIQ_MACH_EASY98000, /* Falcon Eval Board, NOR Flash */ 21 LANTIQ_MACH_EASY98000SF, /* Falcon Eval Board, Serial Flash */ 22 LANTIQ_MACH_EASY98000NAND, /* Falcon Eval Board, NAND Flash */ 23 LANTIQ_MACH_EASY98020, /* EASY98020 Eval Board */ 24 LANTIQ_MACH_EASY98020_1LAN, /* EASY98020 Eval Board (1 LAN port) */ 25 LANTIQ_MACH_EASY98020_2LAN, /* EASY98020 Eval Board (2 LAN port) */ 26 LANTIQ_MACH_95C3AM1, /* 95C3AM1 Eval Board */ 27 28 /* FRITZ!BOX */ 29 LANTIQ_MACH_FRITZ3370, /* FRITZ!BOX 3370 vdsl cpe */ 30 31 /* Arcadyan */ 32 LANTIQ_MACH_ARV3527P, /* Arcor easybox a401 */ 33 LANTIQ_MACH_ARV4510PW, /* Wippies Homebox */ 34 LANTIQ_MACH_ARV4518PW, /* Airties WAV-221, SMC-7908A-ISP */ 35 LANTIQ_MACH_ARV4520PW, /* Airties WAV-281, Arcor EasyboxA800 */ 36 LANTIQ_MACH_ARV452CPW, /* Arcor EasyboxA801 */ 37 LANTIQ_MACH_ARV4525PW, /* Speedport W502V */ 38 LANTIQ_MACH_ARV7525PW, /* Speedport W303V */ 39 LANTIQ_MACH_ARV752DPW, /* Arcor easybox a802 */ 40 LANTIQ_MACH_ARV752DPW22, /* Arcor easybox a803 */ 41 LANTIQ_MACH_ARV7518PW, /* ASTORIA */ 42 43 /* Netgear */ 44 LANTIQ_MACH_DGN3500B, /* Netgear DGN3500 */ 45 46 /* Gigaset */ 47 LANTIQ_MACH_GIGASX76X, /* Gigaset SX76x */ 48 49 /* Buffalo */ 50 LANTIQ_MACH_WBMR, /* WBMR-HP-G300H */ 18 51 }; 19 52 -
src/linux/universal/linux-3.2/arch/mips/lantiq/prom.c
r18171 r18225 16 16 #include "prom.h" 17 17 #include "clk.h" 18 19 /* access to the ebu needs to be locked between different drivers */ 20 DEFINE_SPINLOCK(ebu_lock); 21 EXPORT_SYMBOL_GPL(ebu_lock); 18 22 19 23 static struct ltq_soc_info soc_info; … … 40 44 } 41 45 46 #ifdef CONFIG_IMAGE_CMDLINE_HACK 47 extern char __image_cmdline[]; 48 49 static void __init 50 prom_init_image_cmdline(void) 51 { 52 char *p = __image_cmdline; 53 int replace = 0; 54 55 if (*p == '-') { 56 replace = 1; 57 p++; 58 } 59 60 if (*p == '\0') 61 return; 62 63 if (replace) { 64 strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline)); 65 } else { 66 strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); 67 strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); 68 } 69 } 70 #else 71 static void __init prom_init_image_cmdline(void) { return; } 72 #endif 73 42 74 static void __init prom_init_cmdline(void) 43 75 { … … 46 78 int i; 47 79 80 arcs_cmdline[0] = '\0'; 81 48 82 for (i = 0; i < argc; i++) { 49 char *p = (char *) KSEG1ADDR(argv[i]);83 char *p = (char *) KSEG1ADDR(argv[i]); 50 84 51 if ( p&& *p) {85 if (CPHYSADDR(p) && *p) { 52 86 strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); 53 87 strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); 54 88 } 55 89 } 90 prom_init_image_cmdline(); 91 } 92 93 void __iomem *ltq_remap_resource(struct resource *res) 94 { 95 __iomem void *ret = NULL; 96 struct resource *lookup = lookup_resource(&iomem_resource, res->start); 97 98 if (lookup && strcmp(lookup->name, res->name)) { 99 panic("conflicting memory range %s\n", res->name); 100 return NULL; 101 } 102 if (!lookup) { 103 if (insert_resource(&iomem_resource, res) < 0) { 104 panic("Failed to insert %s memory\n", res->name); 105 return NULL; 106 } 107 } 108 if (request_mem_region(res->start, 109 resource_size(res), res->name) < 0) { 110 panic("Failed to request %s memory\n", res->name); 111 goto err_res; 112 } 113 114 ret = ioremap_nocache(res->start, resource_size(res)); 115 if (!ret) 116 goto err_mem; 117 118 pr_debug("remap: 0x%08X-0x%08X : \"%s\"\n", 119 res->start, res->end, res->name); 120 return ret; 121 122 err_mem: 123 panic("Failed to remap %s memory\n", res->name); 124 release_mem_region(res->start, resource_size(res)); 125 126 err_res: 127 release_resource(res); 128 return NULL; 56 129 } 57 130 58 131 void __init prom_init(void) 59 132 { 60 struct clk *clk;61 62 133 ltq_soc_detect(&soc_info); 63 134 clk_init(); 64 clk = clk_get(0, "cpu"); 65 snprintf(soc_info.sys_type, LTQ_SYS_TYPE_LEN - 1, "%s rev1.%d", 66 soc_info.name, soc_info.rev); 67 clk_put(clk); 135 snprintf(soc_info.sys_type, LTQ_SYS_TYPE_LEN - 1, "%s rev %s", 136 soc_info.name, soc_info.rev_type); 68 137 soc_info.sys_type[LTQ_SYS_TYPE_LEN - 1] = '\0'; 69 138 pr_info("SoC: %s\n", soc_info.sys_type); -
src/linux/universal/linux-3.2/arch/mips/lantiq/prom.h
r18171 r18225 10 10 #define _LTQ_PROM_H__ 11 11 12 #define LTQ_SYS_REV_LEN 0x10 12 13 #define LTQ_SYS_TYPE_LEN 0x100 13 14 … … 15 16 unsigned char *name; 16 17 unsigned int rev; 18 unsigned char rev_type[LTQ_SYS_REV_LEN]; 19 unsigned int srev; 17 20 unsigned int partnum; 18 21 unsigned int type; … … 21 24 22 25 extern void ltq_soc_detect(struct ltq_soc_info *i); 26 extern void ltq_soc_init(void); 23 27 extern void ltq_soc_setup(void); 24 28 -
src/linux/universal/linux-3.2/arch/mips/lantiq/setup.c
r18171 r18225 19 19 #include "prom.h" 20 20 21 /* assume 16M as default incase uboot fails to pass proper ramsize */ 22 unsigned long physical_memsize = 16L; 23 21 24 void __init plat_mem_setup(void) 22 25 { 23 /* assume 16M as default incase uboot fails to pass proper ramsize */24 unsigned long memsize = 16;25 26 char **envp = (char **) KSEG1ADDR(fw_arg2); 26 27 … … 36 37 if (!strncmp(e, "memsize=", 8)) { 37 38 e += 8; 38 if (strict_strtoul(e, 0, & memsize))39 if (strict_strtoul(e, 0, &physical_memsize)) 39 40 pr_warn("bad memsize specified\n"); 40 41 } 41 42 envp++; 42 43 } 43 memsize *= 1024 * 1024;44 add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);44 physical_memsize *= 1024 * 1024; 45 add_memory_region(0x00000000, physical_memsize, BOOT_MEM_RAM); 45 46 } 46 47 -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/Kconfig
r18171 r18225 5 5 config LANTIQ_MACH_EASY50712 6 6 bool "Easy50712 - Danube" 7 default y 8 9 config LANTIQ_MACH_ARV45XX 10 bool "ARV45XX" 11 default y 12 13 config LANTIQ_MACH_NETGEAR 14 bool "Netgear" 15 default y 16 17 config LANTIQ_MACH_GIGASX76X 18 bool "GIGASX76X" 19 default y 20 21 config LANTIQ_MACH_WBMR 22 bool "WBMR-HP-G300H" 7 23 default y 8 24 … … 22 38 23 39 endif 40 41 if SOC_VR9 42 43 menu "MIPS Machine" 44 45 config LANTIQ_MACH_FRITZ3370 46 bool "Fritz!Box 3370" 47 default y 48 49 endmenu 50 51 endif -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/Makefile
r18171 r18225 1 obj-y := pmu.o ebu.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o1 obj-y := sysctrl.o reset.o gpio.o gpio_stp.o gpio_ebu.o devices.o dma.o nand.o timer.o 2 2 3 obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o setup-xway.o 4 obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o setup-ase.o 3 obj-y += dev-dwc_otg.o dev-wifi-ath5k.o 4 5 obj-$(CONFIG_SOC_XWAY) += clk-xway.o prom-xway.o 6 obj-$(CONFIG_SOC_AMAZON_SE) += clk-ase.o prom-ase.o 7 obj-$(CONFIG_SOC_VR9) += clk-vr9.o prom-vr9.o 5 8 6 9 obj-$(CONFIG_LANTIQ_MACH_EASY50712) += mach-easy50712.o 7 10 obj-$(CONFIG_LANTIQ_MACH_EASY50601) += mach-easy50601.o 11 obj-$(CONFIG_LANTIQ_MACH_FRITZ3370) += mach-fritz.o 12 obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o 13 obj-$(CONFIG_LANTIQ_MACH_NETGEAR) += mach-netgear.o 14 obj-$(CONFIG_LANTIQ_MACH_GIGASX76X) += mach-gigasx76x.o 15 obj-$(CONFIG_LANTIQ_MACH_WBMR) += mach-wbmr.o -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/clk-xway.c
r18171 r18225 213 213 EXPORT_SYMBOL(ltq_get_cpu_hz); 214 214 215 unsigned int getCPUClock(void) 216 { 217 return ltq_get_cpu_hz()/1000000; 218 } 219 215 220 unsigned int ltq_get_fpi_hz(void) 216 221 { -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/devices.c
r18171 r18225 20 20 #include <linux/io.h> 21 21 #include <linux/gpio.h> 22 #include <linux/spi/spi.h> 22 23 23 24 #include <asm/bootinfo.h> … … 32 33 /* gpio */ 33 34 static struct resource ltq_gpio_resource[] = { 34 { 35 .name = "gpio0", 36 .start = LTQ_GPIO0_BASE_ADDR, 37 .end = LTQ_GPIO0_BASE_ADDR + LTQ_GPIO_SIZE - 1, 38 .flags = IORESOURCE_MEM, 39 }, { 40 .name = "gpio1", 41 .start = LTQ_GPIO1_BASE_ADDR, 42 .end = LTQ_GPIO1_BASE_ADDR + LTQ_GPIO_SIZE - 1, 43 .flags = IORESOURCE_MEM, 44 }, { 45 .name = "gpio2", 46 .start = LTQ_GPIO2_BASE_ADDR, 47 .end = LTQ_GPIO2_BASE_ADDR + LTQ_GPIO_SIZE - 1, 48 .flags = IORESOURCE_MEM, 49 } 35 MEM_RES("gpio0", LTQ_GPIO0_BASE_ADDR, LTQ_GPIO_SIZE), 36 MEM_RES("gpio1", LTQ_GPIO1_BASE_ADDR, LTQ_GPIO_SIZE), 37 MEM_RES("gpio2", LTQ_GPIO2_BASE_ADDR, LTQ_GPIO_SIZE), 38 MEM_RES("gpio3", LTQ_GPIO3_BASE_ADDR, LTQ_GPIO3_SIZE), 50 39 }; 51 40 … … 61 50 platform_device_register_simple("ltq_gpio", 2, 62 51 <q_gpio_resource[2], 1); 52 platform_device_register_simple("ltq_gpio", 3, 53 <q_gpio_resource[3], 1); 63 54 } 64 55 } 65 56 66 57 /* serial to parallel conversion */ 67 static struct resource ltq_stp_resource = { 68 .name = "stp", 69 .start = LTQ_STP_BASE_ADDR, 70 .end = LTQ_STP_BASE_ADDR + LTQ_STP_SIZE - 1, 71 .flags = IORESOURCE_MEM, 72 }; 58 static struct resource ltq_stp_resource = 59 MEM_RES("stp", LTQ_STP_BASE_ADDR, LTQ_STP_SIZE); 73 60 74 61 void __init ltq_register_gpio_stp(void) … … 79 66 /* asc ports - amazon se has its own serial mapping */ 80 67 static struct resource ltq_ase_asc_resources[] = { 81 { 82 .name = "asc0", 83 .start = LTQ_ASC1_BASE_ADDR, 84 .end = LTQ_ASC1_BASE_ADDR + LTQ_ASC_SIZE - 1, 85 .flags = IORESOURCE_MEM, 86 }, 68 MEM_RES("asc0", LTQ_ASC1_BASE_ADDR, LTQ_ASC_SIZE), 87 69 IRQ_RES(tx, LTQ_ASC_ASE_TIR), 88 70 IRQ_RES(rx, LTQ_ASC_ASE_RIR), … … 97 79 98 80 /* ethernet */ 99 static struct resource ltq_etop_resources = { 100 .name = "etop", 101 .start = LTQ_ETOP_BASE_ADDR, 102 .end = LTQ_ETOP_BASE_ADDR + LTQ_ETOP_SIZE - 1, 103 .flags = IORESOURCE_MEM, 81 static struct resource ltq_etop_resources[] = { 82 MEM_RES("etop", LTQ_ETOP_BASE_ADDR, LTQ_ETOP_SIZE), 83 MEM_RES("gbit", LTQ_GBIT_BASE_ADDR, LTQ_GBIT_SIZE), 104 84 }; 105 85 106 86 static struct platform_device ltq_etop = { 107 87 .name = "ltq_etop", 108 .resource = <q_etop_resources,88 .resource = ltq_etop_resources, 109 89 .num_resources = 1, 110 90 }; … … 113 93 ltq_register_etop(struct ltq_eth_data *eth) 114 94 { 95 /* only register the gphy on socs that have one */ 96 if (ltq_is_ar9() | ltq_is_vr9()) 97 ltq_etop.num_resources = 2; 115 98 if (eth) { 116 99 ltq_etop.dev.platform_data = eth; … … 118 101 } 119 102 } 103 104 /* madwifi */ 105 int lantiq_emulate_madwifi_eep = 0; 106 EXPORT_SYMBOL(lantiq_emulate_madwifi_eep); 107 108 int lantiq_madwifi_eep_addr = 0; 109 EXPORT_SYMBOL(lantiq_madwifi_eep_addr); 110 111 void __init 112 ltq_register_madwifi_eep(unsigned long long addr) 113 { 114 lantiq_madwifi_eep_addr = addr; 115 lantiq_emulate_madwifi_eep = 1; 116 } 117 118 /* ebu */ 119 static struct resource ltq_ebu_resource = 120 { 121 .name = "gpio_ebu", 122 .start = LTQ_EBU_GPIO_START, 123 .end = LTQ_EBU_GPIO_START + LTQ_EBU_GPIO_SIZE - 1, 124 .flags = IORESOURCE_MEM, 125 }; 126 127 static struct platform_device ltq_ebu = 128 { 129 .name = "ltq_ebu", 130 .resource = <q_ebu_resource, 131 .num_resources = 1, 132 }; 133 134 void __init 135 ltq_register_gpio_ebu(unsigned int value) 136 { 137 ltq_ebu.dev.platform_data = (void*) value; 138 platform_device_register(<q_ebu); 139 } 140 141 /* gpio buttons */ 142 static struct gpio_buttons_platform_data ltq_gpio_buttons_platform_data; 143 144 static struct platform_device ltq_gpio_buttons_platform_device = 145 { 146 .name = "gpio-buttons", 147 .id = 0, 148 .dev = { 149 .platform_data = (void *) <q_gpio_buttons_platform_data, 150 }, 151 }; 152 153 void __init 154 ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt) 155 { 156 ltq_gpio_buttons_platform_data.buttons = buttons; 157 ltq_gpio_buttons_platform_data.nbuttons = cnt; 158 platform_device_register(<q_gpio_buttons_platform_device); 159 } 160 161 static struct resource ltq_spi_resources[] = { 162 { 163 .start = LTQ_SSC_BASE_ADDR, 164 .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1, 165 .flags = IORESOURCE_MEM, 166 }, 167 IRQ_RES(spi_tx, LTQ_SSC_TIR), 168 IRQ_RES(spi_rx, LTQ_SSC_RIR), 169 IRQ_RES(spi_err, LTQ_SSC_EIR), 170 }; 171 172 static struct resource ltq_spi_resources_ar9[] = { 173 { 174 .start = LTQ_SSC_BASE_ADDR, 175 .end = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1, 176 .flags = IORESOURCE_MEM, 177 }, 178 IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9), 179 IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9), 180 IRQ_RES(spi_err, LTQ_SSC_EIR), 181 }; 182 183 static struct platform_device ltq_spi = { 184 .name = "ltq-spi", 185 .resource = ltq_spi_resources, 186 .num_resources = ARRAY_SIZE(ltq_spi_resources), 187 }; 188 189 void __init ltq_register_spi(struct ltq_spi_platform_data *pdata, 190 struct spi_board_info const *info, unsigned n) 191 { 192 if(ltq_is_ar9()) 193 ltq_spi.resource = ltq_spi_resources_ar9; 194 spi_register_board_info(info, n); 195 ltq_spi.dev.platform_data = pdata; 196 platform_device_register(<q_spi); 197 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/devices.h
r18171 r18225 12 12 #include "../devices.h" 13 13 #include <linux/phy.h> 14 #include <linux/spi/spi.h> 15 #include <linux/gpio_buttons.h> 14 16 15 17 extern void ltq_register_gpio(void); … … 17 19 extern void ltq_register_ase_asc(void); 18 20 extern void ltq_register_etop(struct ltq_eth_data *eth); 21 extern void ltq_register_gpio_ebu(unsigned int value); 22 extern void ltq_register_spi(struct ltq_spi_platform_data *pdata, 23 struct spi_board_info const *info, unsigned n); 24 extern void ltq_register_madwifi_eep(unsigned long long addr); 25 extern void ltq_register_gpio_buttons(struct gpio_button *buttons, int cnt); 19 26 20 27 #endif -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/dma.c
r18171 r18225 25 25 #include <xway_dma.h> 26 26 27 #include "../devices.h" 28 27 29 #define LTQ_DMA_CTRL 0x10 28 30 #define LTQ_DMA_CPOLL 0x14 … … 56 58 ltq_dma_membase + (z)) 57 59 58 static struct resource ltq_dma_resource = { 59 .name = "dma", 60 .start = LTQ_DMA_BASE_ADDR, 61 .end = LTQ_DMA_BASE_ADDR + LTQ_DMA_SIZE - 1, 62 .flags = IORESOURCE_MEM, 63 }; 60 static struct resource ltq_dma_resource = 61 MEM_RES("dma", LTQ_DMA_BASE_ADDR, LTQ_DMA_SIZE); 64 62 65 63 static void __iomem *ltq_dma_membase; … … 221 219 int i; 222 220 223 /* insert and request the memory region */224 if (insert_resource(&iomem_resource, <q_dma_resource) < 0)225 panic("Failed to insert dma memory\n");226 227 if (request_mem_region(ltq_dma_resource.start,228 resource_size(<q_dma_resource), "dma") < 0)229 panic("Failed to request dma memory\n");230 231 221 /* remap dma register range */ 232 ltq_dma_membase = ioremap_nocache(ltq_dma_resource.start, 233 resource_size(<q_dma_resource)); 222 ltq_dma_membase = ltq_remap_resource(<q_dma_resource); 234 223 if (!ltq_dma_membase) 235 224 panic("Failed to remap dma memory\n"); -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/gpio.c
r18171 r18225 22 22 #define LTQ_GPIO_ALTSEL1 0x10 23 23 #define LTQ_GPIO_OD 0x14 24 24 #define LTQ_GPIO_PUDSEL 0x1C 25 #define LTQ_GPIO_PUDEN 0x20 26 #define LTQ_GPIO3_OD 0x24 27 #define LTQ_GPIO3_ALTSEL1 0x24 28 29 /* PORT3 only has 8 pins and its register layout 30 is slightly different */ 25 31 #define PINS_PER_PORT 16 26 #define MAX_PORTS 3 32 #define PINS_PORT3 8 33 #define MAX_PORTS 4 34 #define MAX_PIN 56 27 35 28 36 #define ltq_gpio_getbit(m, r, p) (!!(ltq_r32(m + r) & (1 << p))) … … 54 62 int id = 0; 55 63 56 if (pin >= (MAX_PORTS * PINS_PER_PORT))64 if (pin >= MAX_PIN) 57 65 return -EINVAL; 58 66 if (gpio_request(pin, name)) { … … 74 82 ltq_gpio_clearbit(ltq_gpio_port[id].membase, 75 83 LTQ_GPIO_ALTSEL0, pin); 76 if (alt1) 77 ltq_gpio_setbit(ltq_gpio_port[id].membase, 78 LTQ_GPIO_ALTSEL1, pin); 79 else 80 ltq_gpio_clearbit(ltq_gpio_port[id].membase, 81 LTQ_GPIO_ALTSEL1, pin); 84 if (id == 3) { 85 if (alt1) 86 ltq_gpio_setbit(ltq_gpio_port[1].membase, 87 LTQ_GPIO3_ALTSEL1, pin); 88 else 89 ltq_gpio_clearbit(ltq_gpio_port[1].membase, 90 LTQ_GPIO3_ALTSEL1, pin); 91 } else { 92 if (alt1) 93 ltq_gpio_setbit(ltq_gpio_port[id].membase, 94 LTQ_GPIO_ALTSEL1, pin); 95 else 96 ltq_gpio_clearbit(ltq_gpio_port[id].membase, 97 LTQ_GPIO_ALTSEL1, pin); 98 } 82 99 return 0; 83 100 } … … 105 122 struct ltq_gpio *ltq_gpio = container_of(chip, struct ltq_gpio, chip); 106 123 107 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_OD, offset); 124 if (chip->ngpio == PINS_PORT3) 125 ltq_gpio_clearbit(ltq_gpio_port[0].membase, 126 LTQ_GPIO3_OD, offset); 127 else 128 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_OD, offset); 108 129 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_DIR, offset); 130 ltq_gpio_setbit(ltq_gpio->membase, LTQ_GPIO_PUDSEL, offset); 131 ltq_gpio_setbit(ltq_gpio->membase, LTQ_GPIO_PUDEN, offset); 109 132 110 133 return 0; … … 116 139 struct ltq_gpio *ltq_gpio = container_of(chip, struct ltq_gpio, chip); 117 140 118 ltq_gpio_setbit(ltq_gpio->membase, LTQ_GPIO_OD, offset); 141 if (chip->ngpio == PINS_PORT3) 142 ltq_gpio_setbit(ltq_gpio_port[0].membase, LTQ_GPIO3_OD, offset); 143 else 144 ltq_gpio_setbit(ltq_gpio->membase, LTQ_GPIO_OD, offset); 119 145 ltq_gpio_setbit(ltq_gpio->membase, LTQ_GPIO_DIR, offset); 146 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_PUDSEL, offset); 147 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_PUDEN, offset); 120 148 ltq_gpio_set(chip, offset, value); 121 149 … … 128 156 129 157 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_ALTSEL0, offset); 130 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_ALTSEL1, offset); 158 if (chip->ngpio == PINS_PORT3) 159 ltq_gpio_clearbit(ltq_gpio_port[1].membase, 160 LTQ_GPIO3_ALTSEL1, offset); 161 else 162 ltq_gpio_clearbit(ltq_gpio->membase, LTQ_GPIO_ALTSEL1, offset); 131 163 return 0; 132 164 } … … 141 173 return -EINVAL; 142 174 } 175 176 /* dirty hack - The registers of port3 are not mapped linearly. 177 Port 3 may only load if Port 1/2 are mapped */ 178 if ((pdev->id == 3) && (!ltq_gpio_port[1].membase || !ltq_gpio_port[2].membase)) { 179 dev_err(&pdev->dev, 180 "ports 1/2 need to be loaded before port 3 works\n"); 181 return -ENOMEM; 182 } 183 143 184 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 144 185 if (!res) { … … 170 211 ltq_gpio_port[pdev->id].chip.request = ltq_gpio_req; 171 212 ltq_gpio_port[pdev->id].chip.base = PINS_PER_PORT * pdev->id; 172 ltq_gpio_port[pdev->id].chip.ngpio = PINS_PER_PORT; 213 if (pdev->id == 3) 214 ltq_gpio_port[pdev->id].chip.ngpio = PINS_PORT3; 215 else 216 ltq_gpio_port[pdev->id].chip.ngpio = PINS_PER_PORT; 173 217 platform_set_drvdata(pdev, <q_gpio_port[pdev->id]); 174 218 return gpiochip_add(<q_gpio_port[pdev->id].chip); -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/gpio_ebu.c
r18171 r18225 62 62 .direction_output = ltq_ebu_direction_output, 63 63 .set = ltq_ebu_set, 64 .base = 72,64 .base = 100, 65 65 .ngpio = 16, 66 .can_sleep = 1,67 66 .owner = THIS_MODULE, 68 67 }; -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/gpio_stp.c
r18171 r18225 36 36 37 37 #define LTQ_STP_GROUP0 (1 << 0) 38 #define LTQ_STP_GROUP1 (1 << 1) 39 #define LTQ_STP_GROUP2 (1 << 2) 38 40 39 41 #define LTQ_STP_RISING 0 … … 71 73 .direction_output = ltq_stp_direction_output, 72 74 .set = ltq_stp_set, 73 .base = 48,75 .base = 200, 74 76 .ngpio = 24, 75 .can_sleep = 1,76 77 .owner = THIS_MODULE, 77 78 }; … … 94 95 ltq_stp_w32_mask(LTQ_STP_EDGE_MASK, LTQ_STP_FALLING, LTQ_STP_CON0); 95 96 96 /* per default stp 15-0 are set */ 97 ltq_stp_w32_mask(0, LTQ_STP_GROUP0, LTQ_STP_CON1); 97 /* enable all three led groups */ 98 ltq_stp_w32_mask(0, LTQ_STP_GROUP0 | LTQ_STP_GROUP1 | LTQ_STP_GROUP2, 99 LTQ_STP_CON1); 98 100 99 101 /* stp are update periodically by the FPI bus */ -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-easy50601.c
r18171 r18225 33 33 .name = "linux", 34 34 .offset = 0x20000, 35 .size = 0xE0000, 36 }, 37 { 38 .name = "rootfs", 39 .offset = 0x100000, 40 .size = 0x300000, 35 .size = 0x3d0000, 41 36 }, 42 37 }; … … 47 42 }; 48 43 44 static struct ltq_eth_data ltq_eth_data = { 45 .mii_mode = -1, /* use EPHY */ 46 }; 47 49 48 static void __init easy50601_init(void) 50 49 { 51 50 ltq_register_nor(&easy50601_flash_data); 51 ltq_register_etop(<q_eth_data); 52 52 } 53 53 -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/mach-easy50712.c
r18171 r18225 35 35 .name = "linux", 36 36 .offset = 0x20000, 37 .size = 0xe0000, 38 }, 39 { 40 .name = "rootfs", 41 .offset = 0x100000, 42 .size = 0x300000, 37 .size = 0x3d0000, 43 38 }, 44 39 }; … … 67 62 ltq_register_pci(<q_pci_data); 68 63 ltq_register_etop(<q_eth_data); 64 ltq_register_tapi(); 69 65 } 70 66 -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/prom-ase.c
r18171 r18225 14 14 #include <lantiq_soc.h> 15 15 16 #include "devices.h" 16 17 #include "../prom.h" 17 18 … … 27 28 i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT; 28 29 i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT; 30 sprintf(i->rev_type, "1.%d", i->rev); 29 31 switch (i->partnum) { 30 32 case SOC_ID_AMAZON_SE: … … 38 40 } 39 41 } 42 43 void __init ltq_soc_setup(void) 44 { 45 ltq_register_ase_asc(); 46 ltq_register_gpio(); 47 ltq_register_wdt(); 48 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/prom-xway.c
r18171 r18225 14 14 #include <lantiq_soc.h> 15 15 16 #include "devices.h" 16 17 #include "../prom.h" 17 18 … … 29 30 i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT; 30 31 i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT; 32 sprintf(i->rev_type, "1.%d", i->rev); 31 33 switch (i->partnum) { 32 34 case SOC_ID_DANUBE1: … … 53 55 } 54 56 } 57 58 void __init ltq_soc_setup(void) 59 { 60 ltq_register_asc(0); 61 ltq_register_asc(1); 62 ltq_register_gpio(); 63 ltq_register_wdt(); 64 } -
src/linux/universal/linux-3.2/arch/mips/lantiq/xway/reset.c
r18171 r18225 16 16 #include <lantiq_soc.h> 17 17 18 #include "../devices.h" 19 18 20 #define ltq_rcu_w32(x, y) ltq_w32((x), ltq_rcu_membase + (y)) 19 21 #define ltq_rcu_r32(x) ltq_r32(ltq_rcu_membase + (x)) … … 26 28 #define LTQ_RCU_STAT_SHIFT 26 27 29 28 static struct resource ltq_rcu_resource = { 29 .name = "rcu", 30 .start = LTQ_RCU_BASE_ADDR, 31 .end = LTQ_RCU_BASE_ADDR + LTQ_RCU_SIZE - 1, 32 .flags = IORESOURCE_MEM, 33 }; 30 static struct resource ltq_rcu_resource = 31 MEM_RES("rcu", LTQ_RCU_BASE_ADDR, LTQ_RCU_SIZE); 34 32 35 33 /* remapped base addr of the reset control unit */ … … 68 66 static int __init mips_reboot_setup(void) 69 67 { 70 /* insert and request the memory region */71 if (insert_resource(&iomem_resource, <q_rcu_resource) < 0)72 panic("Failed to insert rcu memory\n");73 74 if (request_mem_region(ltq_rcu_resource.start,75 resource_size(<q_rcu_resource), "rcu") < 0)76 panic("Failed to request rcu memory\n");77 78 68 /* remap rcu register range */ 79 ltq_rcu_membase = ioremap_nocache(ltq_rcu_resource.start, 80 resource_size(<q_rcu_resource)); 69 ltq_rcu_membase = ltq_remap_resource(<q_rcu_resource); 81 70 if (!ltq_rcu_membase) 82 71 panic("Failed to remap rcu memory\n");
Note: See TracChangeset
for help on using the changeset viewer.
