aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-au1x00
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2011-05-08 04:42:18 -0400
committerRalf Baechle <ralf@linux-mips.org>2011-05-19 04:55:46 -0400
commit40d8bc281711d188f35f035f28d94b111b735484 (patch)
tree60aec8dda708f64830cf8e49520cfa61573ee25e /arch/mips/include/asm/mach-au1x00
parent80130204b43ce9c3b50924e4c2d44e9f2881f8c3 (diff)
MIPS: Alchemy: Rewrite ethernet platform setup
Rewrite ethernet setup to use runtime cpu detection, and also clean up the ethernet base address mess as far as possible. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> To: Linux-MIPS <linux-mips@linux-mips.org> Cc: Florian Fainelli <florian@openwrt.org> Cc: Wolfgang Grandegger <wg@grandegger.com> Patchwork: https://patchwork.linux-mips.org/patch/2353/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org
Diffstat (limited to 'arch/mips/include/asm/mach-au1x00')
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000.h63
1 files changed, 22 insertions, 41 deletions
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h
index c4ffb209edf2..415d287c272b 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000.h
@@ -219,6 +219,20 @@ static inline void alchemy_uart_putchar(u32 uart_phys, u8 c)
219 wmb(); 219 wmb();
220} 220}
221 221
222/* return number of ethernet MACs on a given cputype */
223static inline int alchemy_get_macs(int type)
224{
225 switch (type) {
226 case ALCHEMY_CPU_AU1000:
227 case ALCHEMY_CPU_AU1500:
228 case ALCHEMY_CPU_AU1550:
229 return 2;
230 case ALCHEMY_CPU_AU1100:
231 return 1;
232 }
233 return 0;
234}
235
222/* arch/mips/au1000/common/clocks.c */ 236/* arch/mips/au1000/common/clocks.c */
223extern void set_au1x00_speed(unsigned int new_freq); 237extern void set_au1x00_speed(unsigned int new_freq);
224extern unsigned int get_au1x00_speed(void); 238extern unsigned int get_au1x00_speed(void);
@@ -673,6 +687,12 @@ enum soc_au1200_ints {
673 */ 687 */
674 688
675#define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */ 689#define AU1000_IC0_PHYS_ADDR 0x10400000 /* 01234 */
690#define AU1000_MAC0_PHYS_ADDR 0x10500000 /* 023 */
691#define AU1000_MAC1_PHYS_ADDR 0x10510000 /* 023 */
692#define AU1000_MACEN_PHYS_ADDR 0x10520000 /* 023 */
693#define AU1500_MAC0_PHYS_ADDR 0x11500000 /* 1 */
694#define AU1500_MAC1_PHYS_ADDR 0x11510000 /* 1 */
695#define AU1500_MACEN_PHYS_ADDR 0x11520000 /* 1 */
676#define AU1000_UART0_PHYS_ADDR 0x11100000 /* 01234 */ 696#define AU1000_UART0_PHYS_ADDR 0x11100000 /* 01234 */
677#define AU1000_UART1_PHYS_ADDR 0x11200000 /* 0234 */ 697#define AU1000_UART1_PHYS_ADDR 0x11200000 /* 0234 */
678#define AU1000_UART2_PHYS_ADDR 0x11300000 /* 0 */ 698#define AU1000_UART2_PHYS_ADDR 0x11300000 /* 0 */
@@ -680,6 +700,8 @@ enum soc_au1200_ints {
680#define AU1000_IC1_PHYS_ADDR 0x11800000 /* 01234 */ 700#define AU1000_IC1_PHYS_ADDR 0x11800000 /* 01234 */
681#define AU1550_DBDMA_PHYS_ADDR 0x14002000 /* 34 */ 701#define AU1550_DBDMA_PHYS_ADDR 0x14002000 /* 34 */
682#define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 34 */ 702#define AU1550_DBDMA_CONF_PHYS_ADDR 0x14003000 /* 34 */
703#define AU1000_MACDMA0_PHYS_ADDR 0x14004000 /* 0123 */
704#define AU1000_MACDMA1_PHYS_ADDR 0x14004200 /* 0123 */
683 705
684 706
685#ifdef CONFIG_SOC_AU1000 707#ifdef CONFIG_SOC_AU1000
@@ -697,11 +719,6 @@ enum soc_au1200_ints {
697#define USBH_PHYS_ADDR 0x10100000 719#define USBH_PHYS_ADDR 0x10100000
698#define USBD_PHYS_ADDR 0x10200000 720#define USBD_PHYS_ADDR 0x10200000
699#define IRDA_PHYS_ADDR 0x10300000 721#define IRDA_PHYS_ADDR 0x10300000
700#define MAC0_PHYS_ADDR 0x10500000
701#define MAC1_PHYS_ADDR 0x10510000
702#define MACEN_PHYS_ADDR 0x10520000
703#define MACDMA0_PHYS_ADDR 0x14004000
704#define MACDMA1_PHYS_ADDR 0x14004200
705#define I2S_PHYS_ADDR 0x11000000 722#define I2S_PHYS_ADDR 0x11000000
706#define SSI0_PHYS_ADDR 0x11600000 723#define SSI0_PHYS_ADDR 0x11600000
707#define SSI1_PHYS_ADDR 0x11680000 724#define SSI1_PHYS_ADDR 0x11680000
@@ -728,11 +745,6 @@ enum soc_au1200_ints {
728#define USBH_PHYS_ADDR 0x10100000 745#define USBH_PHYS_ADDR 0x10100000
729#define USBD_PHYS_ADDR 0x10200000 746#define USBD_PHYS_ADDR 0x10200000
730#define PCI_PHYS_ADDR 0x14005000 747#define PCI_PHYS_ADDR 0x14005000
731#define MAC0_PHYS_ADDR 0x11500000
732#define MAC1_PHYS_ADDR 0x11510000
733#define MACEN_PHYS_ADDR 0x11520000
734#define MACDMA0_PHYS_ADDR 0x14004000
735#define MACDMA1_PHYS_ADDR 0x14004200
736#define I2S_PHYS_ADDR 0x11000000 748#define I2S_PHYS_ADDR 0x11000000
737#define GPIO2_PHYS_ADDR 0x11700000 749#define GPIO2_PHYS_ADDR 0x11700000
738#define SYS_PHYS_ADDR 0x11900000 750#define SYS_PHYS_ADDR 0x11900000
@@ -764,10 +776,6 @@ enum soc_au1200_ints {
764#define USBH_PHYS_ADDR 0x10100000 776#define USBH_PHYS_ADDR 0x10100000
765#define USBD_PHYS_ADDR 0x10200000 777#define USBD_PHYS_ADDR 0x10200000
766#define IRDA_PHYS_ADDR 0x10300000 778#define IRDA_PHYS_ADDR 0x10300000
767#define MAC0_PHYS_ADDR 0x10500000
768#define MACEN_PHYS_ADDR 0x10520000
769#define MACDMA0_PHYS_ADDR 0x14004000
770#define MACDMA1_PHYS_ADDR 0x14004200
771#define I2S_PHYS_ADDR 0x11000000 779#define I2S_PHYS_ADDR 0x11000000
772#define SSI0_PHYS_ADDR 0x11600000 780#define SSI0_PHYS_ADDR 0x11600000
773#define SSI1_PHYS_ADDR 0x11680000 781#define SSI1_PHYS_ADDR 0x11680000
@@ -787,11 +795,6 @@ enum soc_au1200_ints {
787#define USBH_PHYS_ADDR 0x14020000 795#define USBH_PHYS_ADDR 0x14020000
788#define USBD_PHYS_ADDR 0x10200000 796#define USBD_PHYS_ADDR 0x10200000
789#define PCI_PHYS_ADDR 0x14005000 797#define PCI_PHYS_ADDR 0x14005000
790#define MAC0_PHYS_ADDR 0x10500000
791#define MAC1_PHYS_ADDR 0x10510000
792#define MACEN_PHYS_ADDR 0x10520000
793#define MACDMA0_PHYS_ADDR 0x14004000
794#define MACDMA1_PHYS_ADDR 0x14004200
795#define GPIO2_PHYS_ADDR 0x11700000 798#define GPIO2_PHYS_ADDR 0x11700000
796#define SYS_PHYS_ADDR 0x11900000 799#define SYS_PHYS_ADDR 0x11900000
797#define PE_PHYS_ADDR 0x14008000 800#define PE_PHYS_ADDR 0x14008000
@@ -870,12 +873,6 @@ enum soc_au1200_ints {
870#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 873#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
871#define USB_HOST_CONFIG 0xB017FFFC 874#define USB_HOST_CONFIG 0xB017FFFC
872#define FOR_PLATFORM_C_USB_HOST_INT AU1000_USB_HOST_INT 875#define FOR_PLATFORM_C_USB_HOST_INT AU1000_USB_HOST_INT
873
874#define AU1000_ETH0_BASE 0xB0500000
875#define AU1000_ETH1_BASE 0xB0510000
876#define AU1000_MAC0_ENABLE 0xB0520000
877#define AU1000_MAC1_ENABLE 0xB0520004
878#define NUM_ETH_INTERFACES 2
879#endif /* CONFIG_SOC_AU1000 */ 876#endif /* CONFIG_SOC_AU1000 */
880 877
881/* Au1500 */ 878/* Au1500 */
@@ -887,12 +884,6 @@ enum soc_au1200_ints {
887#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 884#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
888#define USB_HOST_CONFIG 0xB017fffc 885#define USB_HOST_CONFIG 0xB017fffc
889#define FOR_PLATFORM_C_USB_HOST_INT AU1500_USB_HOST_INT 886#define FOR_PLATFORM_C_USB_HOST_INT AU1500_USB_HOST_INT
890
891#define AU1500_ETH0_BASE 0xB1500000
892#define AU1500_ETH1_BASE 0xB1510000
893#define AU1500_MAC0_ENABLE 0xB1520000
894#define AU1500_MAC1_ENABLE 0xB1520004
895#define NUM_ETH_INTERFACES 2
896#endif /* CONFIG_SOC_AU1500 */ 887#endif /* CONFIG_SOC_AU1500 */
897 888
898/* Au1100 */ 889/* Au1100 */
@@ -904,10 +895,6 @@ enum soc_au1200_ints {
904#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */ 895#define USB_OHCI_BASE 0x10100000 /* phys addr for ioremap */
905#define USB_HOST_CONFIG 0xB017FFFC 896#define USB_HOST_CONFIG 0xB017FFFC
906#define FOR_PLATFORM_C_USB_HOST_INT AU1100_USB_HOST_INT 897#define FOR_PLATFORM_C_USB_HOST_INT AU1100_USB_HOST_INT
907
908#define AU1100_ETH0_BASE 0xB0500000
909#define AU1100_MAC0_ENABLE 0xB0520000
910#define NUM_ETH_INTERFACES 1
911#endif /* CONFIG_SOC_AU1100 */ 898#endif /* CONFIG_SOC_AU1100 */
912 899
913#ifdef CONFIG_SOC_AU1550 900#ifdef CONFIG_SOC_AU1550
@@ -917,12 +904,6 @@ enum soc_au1200_ints {
917#define USB_OHCI_LEN 0x00060000 904#define USB_OHCI_LEN 0x00060000
918#define USB_HOST_CONFIG 0xB4027ffc 905#define USB_HOST_CONFIG 0xB4027ffc
919#define FOR_PLATFORM_C_USB_HOST_INT AU1550_USB_HOST_INT 906#define FOR_PLATFORM_C_USB_HOST_INT AU1550_USB_HOST_INT
920
921#define AU1550_ETH0_BASE 0xB0500000
922#define AU1550_ETH1_BASE 0xB0510000
923#define AU1550_MAC0_ENABLE 0xB0520000
924#define AU1550_MAC1_ENABLE 0xB0520004
925#define NUM_ETH_INTERFACES 2
926#endif /* CONFIG_SOC_AU1550 */ 907#endif /* CONFIG_SOC_AU1550 */
927 908
928 909