diff options
Diffstat (limited to 'arch/mips/include/asm/mach-ath25')
-rw-r--r-- | arch/mips/include/asm/mach-ath25/ath25_platform.h | 73 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h | 64 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ath25/dma-coherence.h | 82 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ath25/gpio.h | 16 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ath25/war.h | 25 |
5 files changed, 260 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-ath25/ath25_platform.h b/arch/mips/include/asm/mach-ath25/ath25_platform.h new file mode 100644 index 000000000000..4f4ee4f9e5ec --- /dev/null +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h | |||
@@ -0,0 +1,73 @@ | |||
1 | #ifndef __ASM_MACH_ATH25_PLATFORM_H | ||
2 | #define __ASM_MACH_ATH25_PLATFORM_H | ||
3 | |||
4 | #include <linux/etherdevice.h> | ||
5 | |||
6 | /* | ||
7 | * This is board-specific data that is stored in a "fixed" location in flash. | ||
8 | * It is shared across operating systems, so it should not be changed lightly. | ||
9 | * The main reason we need it is in order to extract the ethernet MAC | ||
10 | * address(es). | ||
11 | */ | ||
12 | struct ath25_boarddata { | ||
13 | u32 magic; /* board data is valid */ | ||
14 | #define ATH25_BD_MAGIC 0x35333131 /* "5311", for all 531x/231x platforms */ | ||
15 | u16 cksum; /* checksum (starting with BD_REV 2) */ | ||
16 | u16 rev; /* revision of this struct */ | ||
17 | #define BD_REV 4 | ||
18 | char board_name[64]; /* Name of board */ | ||
19 | u16 major; /* Board major number */ | ||
20 | u16 minor; /* Board minor number */ | ||
21 | u32 flags; /* Board configuration */ | ||
22 | #define BD_ENET0 0x00000001 /* ENET0 is stuffed */ | ||
23 | #define BD_ENET1 0x00000002 /* ENET1 is stuffed */ | ||
24 | #define BD_UART1 0x00000004 /* UART1 is stuffed */ | ||
25 | #define BD_UART0 0x00000008 /* UART0 is stuffed (dma) */ | ||
26 | #define BD_RSTFACTORY 0x00000010 /* Reset factory defaults stuffed */ | ||
27 | #define BD_SYSLED 0x00000020 /* System LED stuffed */ | ||
28 | #define BD_EXTUARTCLK 0x00000040 /* External UART clock */ | ||
29 | #define BD_CPUFREQ 0x00000080 /* cpu freq is valid in nvram */ | ||
30 | #define BD_SYSFREQ 0x00000100 /* sys freq is set in nvram */ | ||
31 | #define BD_WLAN0 0x00000200 /* Enable WLAN0 */ | ||
32 | #define BD_MEMCAP 0x00000400 /* CAP SDRAM @ mem_cap for testing */ | ||
33 | #define BD_DISWATCHDOG 0x00000800 /* disable system watchdog */ | ||
34 | #define BD_WLAN1 0x00001000 /* Enable WLAN1 (ar5212) */ | ||
35 | #define BD_ISCASPER 0x00002000 /* FLAG for AR2312 */ | ||
36 | #define BD_WLAN0_2G_EN 0x00004000 /* FLAG for radio0_2G */ | ||
37 | #define BD_WLAN0_5G_EN 0x00008000 /* FLAG for radio0_2G */ | ||
38 | #define BD_WLAN1_2G_EN 0x00020000 /* FLAG for radio0_2G */ | ||
39 | #define BD_WLAN1_5G_EN 0x00040000 /* FLAG for radio0_2G */ | ||
40 | u16 reset_config_gpio; /* Reset factory GPIO pin */ | ||
41 | u16 sys_led_gpio; /* System LED GPIO pin */ | ||
42 | |||
43 | u32 cpu_freq; /* CPU core frequency in Hz */ | ||
44 | u32 sys_freq; /* System frequency in Hz */ | ||
45 | u32 cnt_freq; /* Calculated C0_COUNT frequency */ | ||
46 | |||
47 | u8 wlan0_mac[ETH_ALEN]; | ||
48 | u8 enet0_mac[ETH_ALEN]; | ||
49 | u8 enet1_mac[ETH_ALEN]; | ||
50 | |||
51 | u16 pci_id; /* Pseudo PCIID for common code */ | ||
52 | u16 mem_cap; /* cap bank1 in MB */ | ||
53 | |||
54 | /* version 3 */ | ||
55 | u8 wlan1_mac[ETH_ALEN]; /* (ar5212) */ | ||
56 | }; | ||
57 | |||
58 | #define BOARD_CONFIG_BUFSZ 0x1000 | ||
59 | |||
60 | /* | ||
61 | * Platform device information for the Wireless MAC | ||
62 | */ | ||
63 | struct ar231x_board_config { | ||
64 | u16 devid; | ||
65 | |||
66 | /* board config data */ | ||
67 | struct ath25_boarddata *config; | ||
68 | |||
69 | /* radio calibration data */ | ||
70 | const char *radio; | ||
71 | }; | ||
72 | |||
73 | #endif /* __ASM_MACH_ATH25_PLATFORM_H */ | ||
diff --git a/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h new file mode 100644 index 000000000000..ade0356df257 --- /dev/null +++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Atheros AR231x/AR531x SoC specific CPU feature overrides | ||
3 | * | ||
4 | * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org> | ||
5 | * | ||
6 | * This file was derived from: include/asm-mips/cpu-features.h | ||
7 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
8 | * Copyright (C) 2004 Maciej W. Rozycki | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License version 2 as published | ||
12 | * by the Free Software Foundation. | ||
13 | * | ||
14 | */ | ||
15 | #ifndef __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H | ||
16 | #define __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H | ||
17 | |||
18 | /* | ||
19 | * The Atheros AR531x/AR231x SoCs have MIPS 4Kc/4KEc core. | ||
20 | */ | ||
21 | #define cpu_has_tlb 1 | ||
22 | #define cpu_has_4kex 1 | ||
23 | #define cpu_has_3k_cache 0 | ||
24 | #define cpu_has_4k_cache 1 | ||
25 | #define cpu_has_tx39_cache 0 | ||
26 | #define cpu_has_sb1_cache 0 | ||
27 | #define cpu_has_fpu 0 | ||
28 | #define cpu_has_32fpr 0 | ||
29 | #define cpu_has_counter 1 | ||
30 | #define cpu_has_ejtag 1 | ||
31 | |||
32 | #if !defined(CONFIG_SOC_AR5312) | ||
33 | # define cpu_has_llsc 1 | ||
34 | #else | ||
35 | /* | ||
36 | * The MIPS 4Kc V0.9 core in the AR5312/AR2312 have problems with the | ||
37 | * ll/sc instructions. | ||
38 | */ | ||
39 | # define cpu_has_llsc 0 | ||
40 | #endif | ||
41 | |||
42 | #define cpu_has_mips16 0 | ||
43 | #define cpu_has_mdmx 0 | ||
44 | #define cpu_has_mips3d 0 | ||
45 | #define cpu_has_smartmips 0 | ||
46 | |||
47 | #define cpu_has_mips32r1 1 | ||
48 | |||
49 | #if !defined(CONFIG_SOC_AR5312) | ||
50 | # define cpu_has_mips32r2 1 | ||
51 | #endif | ||
52 | |||
53 | #define cpu_has_mips64r1 0 | ||
54 | #define cpu_has_mips64r2 0 | ||
55 | |||
56 | #define cpu_has_dsp 0 | ||
57 | #define cpu_has_mipsmt 0 | ||
58 | |||
59 | #define cpu_has_64bits 0 | ||
60 | #define cpu_has_64bit_zero_reg 0 | ||
61 | #define cpu_has_64bit_gp_regs 0 | ||
62 | #define cpu_has_64bit_addresses 0 | ||
63 | |||
64 | #endif /* __ASM_MACH_ATH25_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/arch/mips/include/asm/mach-ath25/dma-coherence.h b/arch/mips/include/asm/mach-ath25/dma-coherence.h new file mode 100644 index 000000000000..d8009c93a465 --- /dev/null +++ b/arch/mips/include/asm/mach-ath25/dma-coherence.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> | ||
7 | * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> | ||
8 | * | ||
9 | */ | ||
10 | #ifndef __ASM_MACH_ATH25_DMA_COHERENCE_H | ||
11 | #define __ASM_MACH_ATH25_DMA_COHERENCE_H | ||
12 | |||
13 | #include <linux/device.h> | ||
14 | |||
15 | /* | ||
16 | * We need some arbitrary non-zero value to be programmed to the BAR1 register | ||
17 | * of PCI host controller to enable DMA. The same value should be used as the | ||
18 | * offset to calculate the physical address of DMA buffer for PCI devices. | ||
19 | */ | ||
20 | #define AR2315_PCI_HOST_SDRAM_BASEADDR 0x20000000 | ||
21 | |||
22 | static inline dma_addr_t ath25_dev_offset(struct device *dev) | ||
23 | { | ||
24 | #ifdef CONFIG_PCI | ||
25 | extern struct bus_type pci_bus_type; | ||
26 | |||
27 | if (dev && dev->bus == &pci_bus_type) | ||
28 | return AR2315_PCI_HOST_SDRAM_BASEADDR; | ||
29 | #endif | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static inline dma_addr_t | ||
34 | plat_map_dma_mem(struct device *dev, void *addr, size_t size) | ||
35 | { | ||
36 | return virt_to_phys(addr) + ath25_dev_offset(dev); | ||
37 | } | ||
38 | |||
39 | static inline dma_addr_t | ||
40 | plat_map_dma_mem_page(struct device *dev, struct page *page) | ||
41 | { | ||
42 | return page_to_phys(page) + ath25_dev_offset(dev); | ||
43 | } | ||
44 | |||
45 | static inline unsigned long | ||
46 | plat_dma_addr_to_phys(struct device *dev, dma_addr_t dma_addr) | ||
47 | { | ||
48 | return dma_addr - ath25_dev_offset(dev); | ||
49 | } | ||
50 | |||
51 | static inline void | ||
52 | plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
53 | enum dma_data_direction direction) | ||
54 | { | ||
55 | } | ||
56 | |||
57 | static inline int plat_dma_supported(struct device *dev, u64 mask) | ||
58 | { | ||
59 | return 1; | ||
60 | } | ||
61 | |||
62 | static inline void plat_extra_sync_for_device(struct device *dev) | ||
63 | { | ||
64 | } | ||
65 | |||
66 | static inline int plat_dma_mapping_error(struct device *dev, | ||
67 | dma_addr_t dma_addr) | ||
68 | { | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | static inline int plat_device_is_coherent(struct device *dev) | ||
73 | { | ||
74 | #ifdef CONFIG_DMA_COHERENT | ||
75 | return 1; | ||
76 | #endif | ||
77 | #ifdef CONFIG_DMA_NONCOHERENT | ||
78 | return 0; | ||
79 | #endif | ||
80 | } | ||
81 | |||
82 | #endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */ | ||
diff --git a/arch/mips/include/asm/mach-ath25/gpio.h b/arch/mips/include/asm/mach-ath25/gpio.h new file mode 100644 index 000000000000..713564b8e8ef --- /dev/null +++ b/arch/mips/include/asm/mach-ath25/gpio.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __ASM_MACH_ATH25_GPIO_H | ||
2 | #define __ASM_MACH_ATH25_GPIO_H | ||
3 | |||
4 | #include <asm-generic/gpio.h> | ||
5 | |||
6 | #define gpio_get_value __gpio_get_value | ||
7 | #define gpio_set_value __gpio_set_value | ||
8 | #define gpio_cansleep __gpio_cansleep | ||
9 | #define gpio_to_irq __gpio_to_irq | ||
10 | |||
11 | static inline int irq_to_gpio(unsigned irq) | ||
12 | { | ||
13 | return -EINVAL; | ||
14 | } | ||
15 | |||
16 | #endif /* __ASM_MACH_ATH25_GPIO_H */ | ||
diff --git a/arch/mips/include/asm/mach-ath25/war.h b/arch/mips/include/asm/mach-ath25/war.h new file mode 100644 index 000000000000..e3a5250ebd67 --- /dev/null +++ b/arch/mips/include/asm/mach-ath25/war.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_ATH25_WAR_H | ||
9 | #define __ASM_MACH_ATH25_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MACH_ATH25_WAR_H */ | ||