Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Alchemy: clean DMA code of CONFIG_SOC_AU1??? defines

This patch gets rid of all CONFIG_SOC_AU1XXX defines in
DMA/DBDMA-related code.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/2704/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Manuel Lauss and committed by
Ralf Baechle
f2e442fd d4f07ae7

+209 -238
+97 -118
arch/mips/alchemy/common/dbdma.c
··· 40 40 #include <asm/mach-au1x00/au1000.h> 41 41 #include <asm/mach-au1x00/au1xxx_dbdma.h> 42 42 43 - #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) 44 - 45 43 /* 46 44 * The Descriptor Based DMA supports up to 16 channels. 47 45 * ··· 60 62 (dbdma_global_t *)KSEG1ADDR(AU1550_DBDMA_CONF_PHYS_ADDR); 61 63 static int dbdma_initialized; 62 64 63 - static dbdev_tab_t dbdev_tab[] = { 64 - #ifdef CONFIG_SOC_AU1550 65 + static dbdev_tab_t *dbdev_tab; 66 + 67 + static dbdev_tab_t au1550_dbdev_tab[] __initdata = { 65 68 /* UARTS */ 66 - { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, 67 - { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, 68 - { DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, 69 - { DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, 69 + { AU1550_DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, 70 + { AU1550_DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, 71 + { AU1550_DSCR_CMD0_UART3_TX, DEV_FLAGS_OUT, 0, 8, 0x11400004, 0, 0 }, 72 + { AU1550_DSCR_CMD0_UART3_RX, DEV_FLAGS_IN, 0, 8, 0x11400000, 0, 0 }, 70 73 71 74 /* EXT DMA */ 72 - { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, 73 - { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, 74 - { DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, 75 - { DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, 75 + { AU1550_DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, 76 + { AU1550_DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, 77 + { AU1550_DSCR_CMD0_DMA_REQ2, 0, 0, 0, 0x00000000, 0, 0 }, 78 + { AU1550_DSCR_CMD0_DMA_REQ3, 0, 0, 0, 0x00000000, 0, 0 }, 76 79 77 80 /* USB DEV */ 78 - { DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, 79 - { DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, 80 - { DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, 81 - { DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, 82 - { DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, 83 - { DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, 81 + { AU1550_DSCR_CMD0_USBDEV_RX0, DEV_FLAGS_IN, 4, 8, 0x10200000, 0, 0 }, 82 + { AU1550_DSCR_CMD0_USBDEV_TX0, DEV_FLAGS_OUT, 4, 8, 0x10200004, 0, 0 }, 83 + { AU1550_DSCR_CMD0_USBDEV_TX1, DEV_FLAGS_OUT, 4, 8, 0x10200008, 0, 0 }, 84 + { AU1550_DSCR_CMD0_USBDEV_TX2, DEV_FLAGS_OUT, 4, 8, 0x1020000c, 0, 0 }, 85 + { AU1550_DSCR_CMD0_USBDEV_RX3, DEV_FLAGS_IN, 4, 8, 0x10200010, 0, 0 }, 86 + { AU1550_DSCR_CMD0_USBDEV_RX4, DEV_FLAGS_IN, 4, 8, 0x10200014, 0, 0 }, 84 87 85 - /* PSC 0 */ 86 - { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, 87 - { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, 88 + /* PSCs */ 89 + { AU1550_DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, 90 + { AU1550_DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, 91 + { AU1550_DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, 92 + { AU1550_DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, 93 + { AU1550_DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, 94 + { AU1550_DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, 95 + { AU1550_DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, 96 + { AU1550_DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, 88 97 89 - /* PSC 1 */ 90 - { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, 91 - { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, 92 - 93 - /* PSC 2 */ 94 - { DSCR_CMD0_PSC2_TX, DEV_FLAGS_OUT, 0, 0, 0x10a0001c, 0, 0 }, 95 - { DSCR_CMD0_PSC2_RX, DEV_FLAGS_IN, 0, 0, 0x10a0001c, 0, 0 }, 96 - 97 - /* PSC 3 */ 98 - { DSCR_CMD0_PSC3_TX, DEV_FLAGS_OUT, 0, 0, 0x10b0001c, 0, 0 }, 99 - { DSCR_CMD0_PSC3_RX, DEV_FLAGS_IN, 0, 0, 0x10b0001c, 0, 0 }, 100 - 101 - { DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ 102 - { DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ 98 + { AU1550_DSCR_CMD0_PCI_WRITE, 0, 0, 0, 0x00000000, 0, 0 }, /* PCI */ 99 + { AU1550_DSCR_CMD0_NAND_FLASH, 0, 0, 0, 0x00000000, 0, 0 }, /* NAND */ 103 100 104 101 /* MAC 0 */ 105 - { DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 106 - { DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 102 + { AU1550_DSCR_CMD0_MAC0_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 103 + { AU1550_DSCR_CMD0_MAC0_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 107 104 108 105 /* MAC 1 */ 109 - { DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 110 - { DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 111 - 112 - #endif /* CONFIG_SOC_AU1550 */ 113 - 114 - #ifdef CONFIG_SOC_AU1200 115 - { DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, 116 - { DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, 117 - { DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, 118 - { DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, 119 - 120 - { DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, 121 - { DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, 122 - 123 - { DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 124 - { DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 125 - { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 126 - { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 127 - 128 - { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 }, 129 - { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 }, 130 - { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 }, 131 - { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 }, 132 - 133 - { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 }, 134 - { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 }, 135 - 136 - { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 }, 137 - { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 }, 138 - { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 139 - 140 - { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 }, 141 - { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 }, 142 - { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 143 - 144 - { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 }, 145 - { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 }, 146 - { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 }, 147 - { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 148 - 149 - { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 150 - 151 - #endif /* CONFIG_SOC_AU1200 */ 106 + { AU1550_DSCR_CMD0_MAC1_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 107 + { AU1550_DSCR_CMD0_MAC1_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 }, 152 108 153 109 { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 154 - { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 155 - 156 - /* Provide 16 user definable device types */ 157 - { ~0, 0, 0, 0, 0, 0, 0 }, 158 - { ~0, 0, 0, 0, 0, 0, 0 }, 159 - { ~0, 0, 0, 0, 0, 0, 0 }, 160 - { ~0, 0, 0, 0, 0, 0, 0 }, 161 - { ~0, 0, 0, 0, 0, 0, 0 }, 162 - { ~0, 0, 0, 0, 0, 0, 0 }, 163 - { ~0, 0, 0, 0, 0, 0, 0 }, 164 - { ~0, 0, 0, 0, 0, 0, 0 }, 165 - { ~0, 0, 0, 0, 0, 0, 0 }, 166 - { ~0, 0, 0, 0, 0, 0, 0 }, 167 - { ~0, 0, 0, 0, 0, 0, 0 }, 168 - { ~0, 0, 0, 0, 0, 0, 0 }, 169 - { ~0, 0, 0, 0, 0, 0, 0 }, 170 - { ~0, 0, 0, 0, 0, 0, 0 }, 171 - { ~0, 0, 0, 0, 0, 0, 0 }, 172 - { ~0, 0, 0, 0, 0, 0, 0 }, 110 + { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 173 111 }; 174 112 175 - #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) 113 + static dbdev_tab_t au1200_dbdev_tab[] __initdata = { 114 + { AU1200_DSCR_CMD0_UART0_TX, DEV_FLAGS_OUT, 0, 8, 0x11100004, 0, 0 }, 115 + { AU1200_DSCR_CMD0_UART0_RX, DEV_FLAGS_IN, 0, 8, 0x11100000, 0, 0 }, 116 + { AU1200_DSCR_CMD0_UART1_TX, DEV_FLAGS_OUT, 0, 8, 0x11200004, 0, 0 }, 117 + { AU1200_DSCR_CMD0_UART1_RX, DEV_FLAGS_IN, 0, 8, 0x11200000, 0, 0 }, 176 118 119 + { AU1200_DSCR_CMD0_DMA_REQ0, 0, 0, 0, 0x00000000, 0, 0 }, 120 + { AU1200_DSCR_CMD0_DMA_REQ1, 0, 0, 0, 0x00000000, 0, 0 }, 121 + 122 + { AU1200_DSCR_CMD0_MAE_BE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 123 + { AU1200_DSCR_CMD0_MAE_FE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 124 + { AU1200_DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 125 + { AU1200_DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 126 + 127 + { AU1200_DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 }, 128 + { AU1200_DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 }, 129 + { AU1200_DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 }, 130 + { AU1200_DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 }, 131 + 132 + { AU1200_DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 }, 133 + { AU1200_DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 }, 134 + 135 + { AU1200_DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 }, 136 + { AU1200_DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 }, 137 + { AU1200_DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 138 + { AU1200_DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 }, 139 + { AU1200_DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 }, 140 + { AU1200_DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 141 + 142 + { AU1200_DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 }, 143 + { AU1200_DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 }, 144 + { AU1200_DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 }, 145 + { AU1200_DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 146 + 147 + { AU1200_DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 }, 148 + 149 + { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 150 + { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 151 + }; 152 + 153 + /* 32 predefined plus 32 custom */ 154 + #define DBDEV_TAB_SIZE 64 177 155 178 156 static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; 179 157 ··· 1002 1028 .resume = alchemy_dbdma_resume, 1003 1029 }; 1004 1030 1005 - static int __init au1xxx_dbdma_init(void) 1031 + static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable) 1006 1032 { 1007 - int irq_nr, ret; 1033 + int ret; 1034 + 1035 + dbdev_tab = kzalloc(sizeof(dbdev_tab_t) * DBDEV_TAB_SIZE, GFP_KERNEL); 1036 + if (!dbdev_tab) 1037 + return -ENOMEM; 1038 + 1039 + memcpy(dbdev_tab, idtable, 32 * sizeof(dbdev_tab_t)); 1040 + for (ret = 32; ret < DBDEV_TAB_SIZE; ret++) 1041 + dbdev_tab[ret].dev_id = ~0; 1008 1042 1009 1043 dbdma_gptr->ddma_config = 0; 1010 1044 dbdma_gptr->ddma_throttle = 0; 1011 1045 dbdma_gptr->ddma_inten = 0xffff; 1012 1046 au_sync(); 1013 1047 1014 - switch (alchemy_get_cputype()) { 1015 - case ALCHEMY_CPU_AU1550: 1016 - irq_nr = AU1550_DDMA_INT; 1017 - break; 1018 - case ALCHEMY_CPU_AU1200: 1019 - irq_nr = AU1200_DDMA_INT; 1020 - break; 1021 - default: 1022 - return -ENODEV; 1023 - } 1024 - 1025 - ret = request_irq(irq_nr, dbdma_interrupt, IRQF_DISABLED, 1026 - "Au1xxx dbdma", (void *)dbdma_gptr); 1048 + ret = request_irq(irq, dbdma_interrupt, IRQF_DISABLED, "dbdma", 1049 + (void *)dbdma_gptr); 1027 1050 if (ret) 1028 1051 printk(KERN_ERR "Cannot grab DBDMA interrupt!\n"); 1029 1052 else { 1030 1053 dbdma_initialized = 1; 1031 - printk(KERN_INFO "Alchemy DBDMA initialized\n"); 1032 1054 register_syscore_ops(&alchemy_dbdma_syscore_ops); 1033 1055 } 1034 1056 1035 1057 return ret; 1036 1058 } 1037 - subsys_initcall(au1xxx_dbdma_init); 1038 1059 1039 - #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ 1060 + static int __init alchemy_dbdma_init(void) 1061 + { 1062 + switch (alchemy_get_cputype()) { 1063 + case ALCHEMY_CPU_AU1550: 1064 + return dbdma_setup(AU1550_DDMA_INT, au1550_dbdev_tab); 1065 + case ALCHEMY_CPU_AU1200: 1066 + return dbdma_setup(AU1200_DDMA_INT, au1200_dbdev_tab); 1067 + } 1068 + return 0; 1069 + } 1070 + subsys_initcall(alchemy_dbdma_init);
+25 -29
arch/mips/alchemy/common/dma.c
··· 40 40 #include <asm/mach-au1x00/au1000.h> 41 41 #include <asm/mach-au1x00/au1000_dma.h> 42 42 43 - #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || \ 44 - defined(CONFIG_SOC_AU1100) 45 43 /* 46 44 * A note on resource allocation: 47 45 * ··· 168 170 const struct dma_dev *dev; 169 171 int i, ret; 170 172 171 - #if defined(CONFIG_SOC_AU1100) 172 - if (dev_id < 0 || dev_id >= (DMA_NUM_DEV + DMA_NUM_DEV_BANK2)) 173 - return -EINVAL; 174 - #else 175 - if (dev_id < 0 || dev_id >= DMA_NUM_DEV) 176 - return -EINVAL; 177 - #endif 173 + if (alchemy_get_cputype() == ALCHEMY_CPU_AU1100) { 174 + if (dev_id < 0 || dev_id >= (DMA_NUM_DEV + DMA_NUM_DEV_BANK2)) 175 + return -EINVAL; 176 + } else { 177 + if (dev_id < 0 || dev_id >= DMA_NUM_DEV) 178 + return -EINVAL; 179 + } 178 180 179 181 for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) 180 182 if (au1000_dma_table[i].dev_id < 0) ··· 237 239 238 240 static int __init au1000_dma_init(void) 239 241 { 240 - int base, i; 242 + int base, i; 241 243 242 - switch (alchemy_get_cputype()) { 243 - case ALCHEMY_CPU_AU1000: 244 - base = AU1000_DMA_INT_BASE; 245 - break; 246 - case ALCHEMY_CPU_AU1500: 247 - base = AU1500_DMA_INT_BASE; 248 - break; 249 - case ALCHEMY_CPU_AU1100: 250 - base = AU1100_DMA_INT_BASE; 251 - break; 252 - default: 253 - goto out; 254 - } 244 + switch (alchemy_get_cputype()) { 245 + case ALCHEMY_CPU_AU1000: 246 + base = AU1000_DMA_INT_BASE; 247 + break; 248 + case ALCHEMY_CPU_AU1500: 249 + base = AU1500_DMA_INT_BASE; 250 + break; 251 + case ALCHEMY_CPU_AU1100: 252 + base = AU1100_DMA_INT_BASE; 253 + break; 254 + default: 255 + goto out; 256 + } 255 257 256 - for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) 257 - au1000_dma_table[i].irq = base + i; 258 + for (i = 0; i < NUM_AU1000_DMA_CHANNELS; i++) 259 + au1000_dma_table[i].irq = base + i; 258 260 259 - printk(KERN_INFO "Alchemy DMA initialized\n"); 261 + printk(KERN_INFO "Alchemy DMA initialized\n"); 260 262 261 263 out: 262 - return 0; 264 + return 0; 263 265 } 264 266 arch_initcall(au1000_dma_init); 265 - 266 - #endif /* AU1000 AU1500 AU1100 */
+8 -8
arch/mips/alchemy/common/platform.c
··· 263 263 .flags = IORESOURCE_IRQ, 264 264 }, 265 265 [2] = { 266 - .start = DSCR_CMD0_SDMS_TX0, 267 - .end = DSCR_CMD0_SDMS_TX0, 266 + .start = AU1200_DSCR_CMD0_SDMS_TX0, 267 + .end = AU1200_DSCR_CMD0_SDMS_TX0, 268 268 .flags = IORESOURCE_DMA, 269 269 }, 270 270 [3] = { 271 - .start = DSCR_CMD0_SDMS_RX0, 272 - .end = DSCR_CMD0_SDMS_RX0, 271 + .start = AU1200_DSCR_CMD0_SDMS_RX0, 272 + .end = AU1200_DSCR_CMD0_SDMS_RX0, 273 273 .flags = IORESOURCE_DMA, 274 274 } 275 275 }; ··· 299 299 .flags = IORESOURCE_IRQ, 300 300 }, 301 301 [2] = { 302 - .start = DSCR_CMD0_SDMS_TX1, 303 - .end = DSCR_CMD0_SDMS_TX1, 302 + .start = AU1200_DSCR_CMD0_SDMS_TX1, 303 + .end = AU1200_DSCR_CMD0_SDMS_TX1, 304 304 .flags = IORESOURCE_DMA, 305 305 }, 306 306 [3] = { 307 - .start = DSCR_CMD0_SDMS_RX1, 308 - .end = DSCR_CMD0_SDMS_RX1, 307 + .start = AU1200_DSCR_CMD0_SDMS_RX1, 308 + .end = AU1200_DSCR_CMD0_SDMS_RX1, 309 309 .flags = IORESOURCE_DMA, 310 310 } 311 311 };
+10 -10
arch/mips/alchemy/devboards/db1200/platform.c
··· 215 215 .flags = IORESOURCE_IRQ, 216 216 }, 217 217 [2] = { 218 - .start = DSCR_CMD0_DMA_REQ1, 219 - .end = DSCR_CMD0_DMA_REQ1, 218 + .start = AU1200_DSCR_CMD0_DMA_REQ1, 219 + .end = AU1200_DSCR_CMD0_DMA_REQ1, 220 220 .flags = IORESOURCE_DMA, 221 221 }, 222 222 }; ··· 358 358 .flags = IORESOURCE_IRQ, 359 359 }, 360 360 [2] = { 361 - .start = DSCR_CMD0_PSC0_TX, 362 - .end = DSCR_CMD0_PSC0_TX, 361 + .start = AU1200_DSCR_CMD0_PSC0_TX, 362 + .end = AU1200_DSCR_CMD0_PSC0_TX, 363 363 .flags = IORESOURCE_DMA, 364 364 }, 365 365 [3] = { 366 - .start = DSCR_CMD0_PSC0_RX, 367 - .end = DSCR_CMD0_PSC0_RX, 366 + .start = AU1200_DSCR_CMD0_PSC0_RX, 367 + .end = AU1200_DSCR_CMD0_PSC0_RX, 368 368 .flags = IORESOURCE_DMA, 369 369 }, 370 370 }; ··· 416 416 .flags = IORESOURCE_IRQ, 417 417 }, 418 418 [2] = { 419 - .start = DSCR_CMD0_PSC1_TX, 420 - .end = DSCR_CMD0_PSC1_TX, 419 + .start = AU1200_DSCR_CMD0_PSC1_TX, 420 + .end = AU1200_DSCR_CMD0_PSC1_TX, 421 421 .flags = IORESOURCE_DMA, 422 422 }, 423 423 [3] = { 424 - .start = DSCR_CMD0_PSC1_RX, 425 - .end = DSCR_CMD0_PSC1_RX, 424 + .start = AU1200_DSCR_CMD0_PSC1_RX, 425 + .end = AU1200_DSCR_CMD0_PSC1_RX, 426 426 .flags = IORESOURCE_DMA, 427 427 }, 428 428 };
+2 -2
arch/mips/alchemy/devboards/pb1200/platform.c
··· 118 118 .flags = IORESOURCE_IRQ 119 119 }, 120 120 [2] = { 121 - .start = DSCR_CMD0_DMA_REQ1, 122 - .end = DSCR_CMD0_DMA_REQ1, 121 + .start = AU1200_DSCR_CMD0_DMA_REQ1, 122 + .end = AU1200_DSCR_CMD0_DMA_REQ1, 123 123 .flags = IORESOURCE_DMA, 124 124 }, 125 125 };
+55 -59
arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
··· 126 126 #define SW_STATUS_INUSE (1 << 0) 127 127 128 128 /* Command 0 device IDs. */ 129 - #ifdef CONFIG_SOC_AU1550 130 - #define DSCR_CMD0_UART0_TX 0 131 - #define DSCR_CMD0_UART0_RX 1 132 - #define DSCR_CMD0_UART3_TX 2 133 - #define DSCR_CMD0_UART3_RX 3 134 - #define DSCR_CMD0_DMA_REQ0 4 135 - #define DSCR_CMD0_DMA_REQ1 5 136 - #define DSCR_CMD0_DMA_REQ2 6 137 - #define DSCR_CMD0_DMA_REQ3 7 138 - #define DSCR_CMD0_USBDEV_RX0 8 139 - #define DSCR_CMD0_USBDEV_TX0 9 140 - #define DSCR_CMD0_USBDEV_TX1 10 141 - #define DSCR_CMD0_USBDEV_TX2 11 142 - #define DSCR_CMD0_USBDEV_RX3 12 143 - #define DSCR_CMD0_USBDEV_RX4 13 144 - #define DSCR_CMD0_PSC0_TX 14 145 - #define DSCR_CMD0_PSC0_RX 15 146 - #define DSCR_CMD0_PSC1_TX 16 147 - #define DSCR_CMD0_PSC1_RX 17 148 - #define DSCR_CMD0_PSC2_TX 18 149 - #define DSCR_CMD0_PSC2_RX 19 150 - #define DSCR_CMD0_PSC3_TX 20 151 - #define DSCR_CMD0_PSC3_RX 21 152 - #define DSCR_CMD0_PCI_WRITE 22 153 - #define DSCR_CMD0_NAND_FLASH 23 154 - #define DSCR_CMD0_MAC0_RX 24 155 - #define DSCR_CMD0_MAC0_TX 25 156 - #define DSCR_CMD0_MAC1_RX 26 157 - #define DSCR_CMD0_MAC1_TX 27 158 - #endif /* CONFIG_SOC_AU1550 */ 129 + #define AU1550_DSCR_CMD0_UART0_TX 0 130 + #define AU1550_DSCR_CMD0_UART0_RX 1 131 + #define AU1550_DSCR_CMD0_UART3_TX 2 132 + #define AU1550_DSCR_CMD0_UART3_RX 3 133 + #define AU1550_DSCR_CMD0_DMA_REQ0 4 134 + #define AU1550_DSCR_CMD0_DMA_REQ1 5 135 + #define AU1550_DSCR_CMD0_DMA_REQ2 6 136 + #define AU1550_DSCR_CMD0_DMA_REQ3 7 137 + #define AU1550_DSCR_CMD0_USBDEV_RX0 8 138 + #define AU1550_DSCR_CMD0_USBDEV_TX0 9 139 + #define AU1550_DSCR_CMD0_USBDEV_TX1 10 140 + #define AU1550_DSCR_CMD0_USBDEV_TX2 11 141 + #define AU1550_DSCR_CMD0_USBDEV_RX3 12 142 + #define AU1550_DSCR_CMD0_USBDEV_RX4 13 143 + #define AU1550_DSCR_CMD0_PSC0_TX 14 144 + #define AU1550_DSCR_CMD0_PSC0_RX 15 145 + #define AU1550_DSCR_CMD0_PSC1_TX 16 146 + #define AU1550_DSCR_CMD0_PSC1_RX 17 147 + #define AU1550_DSCR_CMD0_PSC2_TX 18 148 + #define AU1550_DSCR_CMD0_PSC2_RX 19 149 + #define AU1550_DSCR_CMD0_PSC3_TX 20 150 + #define AU1550_DSCR_CMD0_PSC3_RX 21 151 + #define AU1550_DSCR_CMD0_PCI_WRITE 22 152 + #define AU1550_DSCR_CMD0_NAND_FLASH 23 153 + #define AU1550_DSCR_CMD0_MAC0_RX 24 154 + #define AU1550_DSCR_CMD0_MAC0_TX 25 155 + #define AU1550_DSCR_CMD0_MAC1_RX 26 156 + #define AU1550_DSCR_CMD0_MAC1_TX 27 159 157 160 - #ifdef CONFIG_SOC_AU1200 161 - #define DSCR_CMD0_UART0_TX 0 162 - #define DSCR_CMD0_UART0_RX 1 163 - #define DSCR_CMD0_UART1_TX 2 164 - #define DSCR_CMD0_UART1_RX 3 165 - #define DSCR_CMD0_DMA_REQ0 4 166 - #define DSCR_CMD0_DMA_REQ1 5 167 - #define DSCR_CMD0_MAE_BE 6 168 - #define DSCR_CMD0_MAE_FE 7 169 - #define DSCR_CMD0_SDMS_TX0 8 170 - #define DSCR_CMD0_SDMS_RX0 9 171 - #define DSCR_CMD0_SDMS_TX1 10 172 - #define DSCR_CMD0_SDMS_RX1 11 173 - #define DSCR_CMD0_AES_TX 13 174 - #define DSCR_CMD0_AES_RX 12 175 - #define DSCR_CMD0_PSC0_TX 14 176 - #define DSCR_CMD0_PSC0_RX 15 177 - #define DSCR_CMD0_PSC1_TX 16 178 - #define DSCR_CMD0_PSC1_RX 17 179 - #define DSCR_CMD0_CIM_RXA 18 180 - #define DSCR_CMD0_CIM_RXB 19 181 - #define DSCR_CMD0_CIM_RXC 20 182 - #define DSCR_CMD0_MAE_BOTH 21 183 - #define DSCR_CMD0_LCD 22 184 - #define DSCR_CMD0_NAND_FLASH 23 185 - #define DSCR_CMD0_PSC0_SYNC 24 186 - #define DSCR_CMD0_PSC1_SYNC 25 187 - #define DSCR_CMD0_CIM_SYNC 26 188 - #endif /* CONFIG_SOC_AU1200 */ 158 + #define AU1200_DSCR_CMD0_UART0_TX 0 159 + #define AU1200_DSCR_CMD0_UART0_RX 1 160 + #define AU1200_DSCR_CMD0_UART1_TX 2 161 + #define AU1200_DSCR_CMD0_UART1_RX 3 162 + #define AU1200_DSCR_CMD0_DMA_REQ0 4 163 + #define AU1200_DSCR_CMD0_DMA_REQ1 5 164 + #define AU1200_DSCR_CMD0_MAE_BE 6 165 + #define AU1200_DSCR_CMD0_MAE_FE 7 166 + #define AU1200_DSCR_CMD0_SDMS_TX0 8 167 + #define AU1200_DSCR_CMD0_SDMS_RX0 9 168 + #define AU1200_DSCR_CMD0_SDMS_TX1 10 169 + #define AU1200_DSCR_CMD0_SDMS_RX1 11 170 + #define AU1200_DSCR_CMD0_AES_TX 13 171 + #define AU1200_DSCR_CMD0_AES_RX 12 172 + #define AU1200_DSCR_CMD0_PSC0_TX 14 173 + #define AU1200_DSCR_CMD0_PSC0_RX 15 174 + #define AU1200_DSCR_CMD0_PSC1_TX 16 175 + #define AU1200_DSCR_CMD0_PSC1_RX 17 176 + #define AU1200_DSCR_CMD0_CIM_RXA 18 177 + #define AU1200_DSCR_CMD0_CIM_RXB 19 178 + #define AU1200_DSCR_CMD0_CIM_RXC 20 179 + #define AU1200_DSCR_CMD0_MAE_BOTH 21 180 + #define AU1200_DSCR_CMD0_LCD 22 181 + #define AU1200_DSCR_CMD0_NAND_FLASH 23 182 + #define AU1200_DSCR_CMD0_PSC0_SYNC 24 183 + #define AU1200_DSCR_CMD0_PSC1_SYNC 25 184 + #define AU1200_DSCR_CMD0_CIM_SYNC 26 189 185 190 186 #define DSCR_CMD0_THROTTLE 30 191 187 #define DSCR_CMD0_ALWAYS 31
+4 -4
arch/mips/include/asm/mach-db1x00/db1x00.h
··· 31 31 32 32 #ifdef CONFIG_MIPS_DB1550 33 33 34 - #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 35 - #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX 36 - #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX 37 - #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX 34 + #define DBDMA_AC97_TX_CHAN AU1550_DSCR_CMD0_PSC1_TX 35 + #define DBDMA_AC97_RX_CHAN AU1550_DSCR_CMD0_PSC1_RX 36 + #define DBDMA_I2S_TX_CHAN AU1550_DSCR_CMD0_PSC3_TX 37 + #define DBDMA_I2S_RX_CHAN AU1550_DSCR_CMD0_PSC3_RX 38 38 39 39 #define SPI_PSC_BASE AU1550_PSC0_PHYS_ADDR 40 40 #define AC97_PSC_BASE AU1550_PSC1_PHYS_ADDR
+4 -4
arch/mips/include/asm/mach-pb1x00/pb1200.h
··· 28 28 #include <asm/mach-au1x00/au1000.h> 29 29 #include <asm/mach-au1x00/au1xxx_psc.h> 30 30 31 - #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 32 - #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX 33 - #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX 34 - #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX 31 + #define DBDMA_AC97_TX_CHAN AU1200_DSCR_CMD0_PSC1_TX 32 + #define DBDMA_AC97_RX_CHAN AU1200_DSCR_CMD0_PSC1_RX 33 + #define DBDMA_I2S_TX_CHAN AU1200_DSCR_CMD0_PSC1_TX 34 + #define DBDMA_I2S_RX_CHAN AU1200_DSCR_CMD0_PSC1_RX 35 35 36 36 /* 37 37 * SPI and SMB are muxed on the Pb1200 board.
+4 -4
arch/mips/include/asm/mach-pb1x00/pb1550.h
··· 30 30 #include <linux/types.h> 31 31 #include <asm/mach-au1x00/au1xxx_psc.h> 32 32 33 - #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX 34 - #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX 35 - #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX 36 - #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX 33 + #define DBDMA_AC97_TX_CHAN AU1550_DSCR_CMD0_PSC1_TX 34 + #define DBDMA_AC97_RX_CHAN AU1550_DSCR_CMD0_PSC1_RX 35 + #define DBDMA_I2S_TX_CHAN AU1550_DSCR_CMD0_PSC3_TX 36 + #define DBDMA_I2S_RX_CHAN AU1550_DSCR_CMD0_PSC3_RX 37 37 38 38 #define SPI_PSC_BASE AU1550_PSC0_PHYS_ADDR 39 39 #define AC97_PSC_BASE AU1550_PSC1_PHYS_ADDR