hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/arch/mips/loongson32/common/platform.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of the GNU General Public License as published by the
6
- * Free Software Foundation; either version 2 of the License, or (at your
7
- * option) any later version.
84 */
95
106 #include <linux/clk.h>
....@@ -81,42 +77,6 @@
8177 },
8278 };
8379
84
-/* DMA */
85
-static struct resource ls1x_dma_resources[] = {
86
- [0] = {
87
- .start = LS1X_DMAC_BASE,
88
- .end = LS1X_DMAC_BASE + SZ_4 - 1,
89
- .flags = IORESOURCE_MEM,
90
- },
91
- [1] = {
92
- .start = LS1X_DMA0_IRQ,
93
- .end = LS1X_DMA0_IRQ,
94
- .flags = IORESOURCE_IRQ,
95
- },
96
- [2] = {
97
- .start = LS1X_DMA1_IRQ,
98
- .end = LS1X_DMA1_IRQ,
99
- .flags = IORESOURCE_IRQ,
100
- },
101
- [3] = {
102
- .start = LS1X_DMA2_IRQ,
103
- .end = LS1X_DMA2_IRQ,
104
- .flags = IORESOURCE_IRQ,
105
- },
106
-};
107
-
108
-struct platform_device ls1x_dma_pdev = {
109
- .name = "ls1x-dma",
110
- .id = -1,
111
- .num_resources = ARRAY_SIZE(ls1x_dma_resources),
112
- .resource = ls1x_dma_resources,
113
-};
114
-
115
-void __init ls1x_dma_set_platdata(struct plat_ls1x_dma *pdata)
116
-{
117
- ls1x_dma_pdev.dev.platform_data = pdata;
118
-}
119
-
12080 /* Synopsys Ethernet GMAC */
12181 static struct stmmac_mdio_bus_data ls1x_mdio_bus_data = {
12282 .phy_mask = 0,
....@@ -138,7 +98,7 @@
13898 if (plat_dat->bus_id) {
13999 __raw_writel(__raw_readl(LS1X_MUX_CTRL0) | GMAC1_USE_UART1 |
140100 GMAC1_USE_UART0, LS1X_MUX_CTRL0);
141
- switch (plat_dat->interface) {
101
+ switch (plat_dat->phy_interface) {
142102 case PHY_INTERFACE_MODE_RGMII:
143103 val &= ~(GMAC1_USE_TXCLK | GMAC1_USE_PWM23);
144104 break;
....@@ -147,12 +107,12 @@
147107 break;
148108 default:
149109 pr_err("unsupported mii mode %d\n",
150
- plat_dat->interface);
110
+ plat_dat->phy_interface);
151111 return -ENOTSUPP;
152112 }
153113 val &= ~GMAC1_SHUT;
154114 } else {
155
- switch (plat_dat->interface) {
115
+ switch (plat_dat->phy_interface) {
156116 case PHY_INTERFACE_MODE_RGMII:
157117 val &= ~(GMAC0_USE_TXCLK | GMAC0_USE_PWM01);
158118 break;
....@@ -161,7 +121,7 @@
161121 break;
162122 default:
163123 pr_err("unsupported mii mode %d\n",
164
- plat_dat->interface);
124
+ plat_dat->phy_interface);
165125 return -ENOTSUPP;
166126 }
167127 val &= ~GMAC0_SHUT;
....@@ -171,7 +131,7 @@
171131 plat_dat = dev_get_platdata(&pdev->dev);
172132
173133 val &= ~PHY_INTF_SELI;
174
- if (plat_dat->interface == PHY_INTERFACE_MODE_RMII)
134
+ if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII)
175135 val |= 0x4 << PHY_INTF_SELI_SHIFT;
176136 __raw_writel(val, LS1X_MUX_CTRL1);
177137
....@@ -186,9 +146,9 @@
186146 .bus_id = 0,
187147 .phy_addr = -1,
188148 #if defined(CONFIG_LOONGSON1_LS1B)
189
- .interface = PHY_INTERFACE_MODE_MII,
149
+ .phy_interface = PHY_INTERFACE_MODE_MII,
190150 #elif defined(CONFIG_LOONGSON1_LS1C)
191
- .interface = PHY_INTERFACE_MODE_RMII,
151
+ .phy_interface = PHY_INTERFACE_MODE_RMII,
192152 #endif
193153 .mdio_bus_data = &ls1x_mdio_bus_data,
194154 .dma_cfg = &ls1x_eth_dma_cfg,
....@@ -226,7 +186,7 @@
226186 static struct plat_stmmacenet_data ls1x_eth1_pdata = {
227187 .bus_id = 1,
228188 .phy_addr = -1,
229
- .interface = PHY_INTERFACE_MODE_MII,
189
+ .phy_interface = PHY_INTERFACE_MODE_MII,
230190 .mdio_bus_data = &ls1x_mdio_bus_data,
231191 .dma_cfg = &ls1x_eth_dma_cfg,
232192 .has_gmac = 1,
....@@ -290,33 +250,6 @@
290250 .num_resources = ARRAY_SIZE(ls1x_gpio1_resources),
291251 .resource = ls1x_gpio1_resources,
292252 };
293
-
294
-/* NAND Flash */
295
-static struct resource ls1x_nand_resources[] = {
296
- [0] = {
297
- .start = LS1X_NAND_BASE,
298
- .end = LS1X_NAND_BASE + SZ_32 - 1,
299
- .flags = IORESOURCE_MEM,
300
- },
301
- [1] = {
302
- /* DMA channel 0 is dedicated to NAND */
303
- .start = LS1X_DMA_CHANNEL0,
304
- .end = LS1X_DMA_CHANNEL0,
305
- .flags = IORESOURCE_DMA,
306
- },
307
-};
308
-
309
-struct platform_device ls1x_nand_pdev = {
310
- .name = "ls1x-nand",
311
- .id = -1,
312
- .num_resources = ARRAY_SIZE(ls1x_nand_resources),
313
- .resource = ls1x_nand_resources,
314
-};
315
-
316
-void __init ls1x_nand_set_platdata(struct plat_ls1x_nand *pdata)
317
-{
318
- ls1x_nand_pdev.dev.platform_data = pdata;
319
-}
320253
321254 /* USB EHCI */
322255 static u64 ls1x_ehci_dmamask = DMA_BIT_MASK(32);