aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-23 16:44:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-23 16:44:43 -0400
commit9e259f9352d52053058a234f7c062c4e4f56dc85 (patch)
treebfb1c442e27f95ddb9a04bae2a44ca9e3dd69a85 /drivers
parent5563ae9b39c5ba492be1b18f2d72fd43ba549915 (diff)
parentf0fc40aff6fee100ffbed8328a0df88f8aa75fce (diff)
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM 32-bit SoC platform updates from Olof Johansson: "Most of the SoC updates in this cycle are cleanups and moves to more modern infrastructure: - Davinci was moved to common clock framework - OMAP1-based Amstrad E3 "Superphone" saw a bunch of cleanups to the keyboard interface (bitbanged AT keyboard via GPIO). - Removal of some stale code for Renesas platforms - Power management improvements for i.MX6LL" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (112 commits) ARM: uniphier: select RESET_CONTROLLER arm64: uniphier: select RESET_CONTROLLER ARM: uniphier: remove empty Makefile ARM: exynos: Clear global variable on init error path ARM: exynos: Remove outdated maintainer information ARM: shmobile: Always enable ARCH_TIMER on SoCs with A7 and/or A15 ARM: shmobile: r8a7779: hide unused r8a7779_platform_cpu_kill soc: r9a06g032: don't build SMP files for non-SMP config ARM: shmobile: Add the R9A06G032 SMP enabler driver ARM: at91: pm: configure wakeup sources for ULP1 mode ARM: at91: pm: add PMC fast startup registers defines ARM: at91: pm: Add ULP1 mode support ARM: at91: pm: Use ULP0 naming instead of slow clock ARM: hisi: handle of_iomap and fix missing of_node_put ARM: hisi: check of_iomap and fix missing of_node_put ARM: hisi: fix error handling and missing of_node_put ARM: mx5: Set the DBGEN bit in ARM_GPC register ARM: imx51: Configure M4IF to avoid visual artifacts ARM: imx: call imx6sx_cpuidle_init() conditionally for 6sll ARM: imx: fix i.MX6SLL build ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/davinci/psc-da830.c3
-rw-r--r--drivers/clk/davinci/psc-da850.c3
-rw-r--r--drivers/clk/davinci/psc-dm365.c3
-rw-r--r--drivers/clk/davinci/psc-dm644x.c3
-rw-r--r--drivers/clk/davinci/psc-dm646x.c3
-rw-r--r--drivers/input/serio/ams_delta_serio.c198
-rw-r--r--drivers/net/ethernet/smsc/smc911x.c13
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c9
-rw-r--r--drivers/net/ethernet/smsc/smc91x.h1
-rw-r--r--drivers/soc/renesas/Makefile3
-rw-r--r--drivers/soc/renesas/r9a06g032-smp.c96
-rw-r--r--drivers/soc/renesas/rcar-sysc.c64
-rw-r--r--drivers/soc/ti/pm33xx.c16
13 files changed, 268 insertions, 147 deletions
diff --git a/drivers/clk/davinci/psc-da830.c b/drivers/clk/davinci/psc-da830.c
index 081b039fcb02..6481337382a6 100644
--- a/drivers/clk/davinci/psc-da830.c
+++ b/drivers/clk/davinci/psc-da830.c
@@ -14,6 +14,7 @@
14 14
15#include "psc.h" 15#include "psc.h"
16 16
17LPSC_CLKDEV1(aemif_clkdev, NULL, "ti-aemif");
17LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0"); 18LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0");
18LPSC_CLKDEV1(mmcsd_clkdev, NULL, "da830-mmc.0"); 19LPSC_CLKDEV1(mmcsd_clkdev, NULL, "da830-mmc.0");
19LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0"); 20LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
@@ -22,7 +23,7 @@ static const struct davinci_lpsc_clk_info da830_psc0_info[] = {
22 LPSC(0, 0, tpcc, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED), 23 LPSC(0, 0, tpcc, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED),
23 LPSC(1, 0, tptc0, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED), 24 LPSC(1, 0, tptc0, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED),
24 LPSC(2, 0, tptc1, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED), 25 LPSC(2, 0, tptc1, pll0_sysclk2, NULL, LPSC_ALWAYS_ENABLED),
25 LPSC(3, 0, aemif, pll0_sysclk3, NULL, LPSC_ALWAYS_ENABLED), 26 LPSC(3, 0, aemif, pll0_sysclk3, aemif_clkdev, LPSC_ALWAYS_ENABLED),
26 LPSC(4, 0, spi0, pll0_sysclk2, spi0_clkdev, 0), 27 LPSC(4, 0, spi0, pll0_sysclk2, spi0_clkdev, 0),
27 LPSC(5, 0, mmcsd, pll0_sysclk2, mmcsd_clkdev, 0), 28 LPSC(5, 0, mmcsd, pll0_sysclk2, mmcsd_clkdev, 0),
28 LPSC(6, 0, aintc, pll0_sysclk4, NULL, LPSC_ALWAYS_ENABLED), 29 LPSC(6, 0, aintc, pll0_sysclk4, NULL, LPSC_ALWAYS_ENABLED),
diff --git a/drivers/clk/davinci/psc-da850.c b/drivers/clk/davinci/psc-da850.c
index d196dcbed560..5a18bca464cd 100644
--- a/drivers/clk/davinci/psc-da850.c
+++ b/drivers/clk/davinci/psc-da850.c
@@ -16,8 +16,7 @@
16 16
17#include "psc.h" 17#include "psc.h"
18 18
19LPSC_CLKDEV2(emifa_clkdev, NULL, "ti-aemif", 19LPSC_CLKDEV1(emifa_clkdev, NULL, "ti-aemif");
20 "aemif", "davinci_nand.0");
21LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0"); 20LPSC_CLKDEV1(spi0_clkdev, NULL, "spi_davinci.0");
22LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "da830-mmc.0"); 21LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "da830-mmc.0");
23LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0"); 22LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
diff --git a/drivers/clk/davinci/psc-dm365.c b/drivers/clk/davinci/psc-dm365.c
index 8c73086cc676..c75424f4ea3b 100644
--- a/drivers/clk/davinci/psc-dm365.c
+++ b/drivers/clk/davinci/psc-dm365.c
@@ -21,7 +21,8 @@ LPSC_CLKDEV1(mmcsd1_clkdev, NULL, "da830-mmc.1");
21LPSC_CLKDEV1(asp0_clkdev, NULL, "davinci-mcbsp"); 21LPSC_CLKDEV1(asp0_clkdev, NULL, "davinci-mcbsp");
22LPSC_CLKDEV1(usb_clkdev, "usb", NULL); 22LPSC_CLKDEV1(usb_clkdev, "usb", NULL);
23LPSC_CLKDEV1(spi2_clkdev, NULL, "spi_davinci.2"); 23LPSC_CLKDEV1(spi2_clkdev, NULL, "spi_davinci.2");
24LPSC_CLKDEV1(aemif_clkdev, "aemif", NULL); 24LPSC_CLKDEV2(aemif_clkdev, "aemif", NULL,
25 NULL, "ti-aemif");
25LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "da830-mmc.0"); 26LPSC_CLKDEV1(mmcsd0_clkdev, NULL, "da830-mmc.0");
26LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1"); 27LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1");
27LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0"); 28LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
diff --git a/drivers/clk/davinci/psc-dm644x.c b/drivers/clk/davinci/psc-dm644x.c
index fc0230e3a3d6..0cea6e0bd5f0 100644
--- a/drivers/clk/davinci/psc-dm644x.c
+++ b/drivers/clk/davinci/psc-dm644x.c
@@ -21,7 +21,8 @@ LPSC_CLKDEV2(emac_clkdev, NULL, "davinci_emac.1",
21 "fck", "davinci_mdio.0"); 21 "fck", "davinci_mdio.0");
22LPSC_CLKDEV1(usb_clkdev, "usb", NULL); 22LPSC_CLKDEV1(usb_clkdev, "usb", NULL);
23LPSC_CLKDEV1(ide_clkdev, NULL, "palm_bk3710"); 23LPSC_CLKDEV1(ide_clkdev, NULL, "palm_bk3710");
24LPSC_CLKDEV1(aemif_clkdev, "aemif", NULL); 24LPSC_CLKDEV2(aemif_clkdev, "aemif", NULL,
25 NULL, "ti-aemif");
25LPSC_CLKDEV1(mmcsd_clkdev, NULL, "dm6441-mmc.0"); 26LPSC_CLKDEV1(mmcsd_clkdev, NULL, "dm6441-mmc.0");
26LPSC_CLKDEV1(asp0_clkdev, NULL, "davinci-mcbsp"); 27LPSC_CLKDEV1(asp0_clkdev, NULL, "davinci-mcbsp");
27LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1"); 28LPSC_CLKDEV1(i2c_clkdev, NULL, "i2c_davinci.1");
diff --git a/drivers/clk/davinci/psc-dm646x.c b/drivers/clk/davinci/psc-dm646x.c
index c3f82ed70a80..20012dc7471a 100644
--- a/drivers/clk/davinci/psc-dm646x.c
+++ b/drivers/clk/davinci/psc-dm646x.c
@@ -18,7 +18,8 @@
18LPSC_CLKDEV1(ide_clkdev, NULL, "palm_bk3710"); 18LPSC_CLKDEV1(ide_clkdev, NULL, "palm_bk3710");
19LPSC_CLKDEV2(emac_clkdev, NULL, "davinci_emac.1", 19LPSC_CLKDEV2(emac_clkdev, NULL, "davinci_emac.1",
20 "fck", "davinci_mdio.0"); 20 "fck", "davinci_mdio.0");
21LPSC_CLKDEV1(aemif_clkdev, "aemif", NULL); 21LPSC_CLKDEV2(aemif_clkdev, "aemif", NULL,
22 NULL, "ti-aemif");
22LPSC_CLKDEV1(mcasp0_clkdev, NULL, "davinci-mcasp.0"); 23LPSC_CLKDEV1(mcasp0_clkdev, NULL, "davinci-mcasp.0");
23LPSC_CLKDEV1(mcasp1_clkdev, NULL, "davinci-mcasp.1"); 24LPSC_CLKDEV1(mcasp1_clkdev, NULL, "davinci-mcasp.1");
24LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0"); 25LPSC_CLKDEV1(uart0_clkdev, NULL, "serial8250.0");
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index 3df501c3421b..f8663d7891f2 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -20,32 +20,33 @@
20 * However, when used with the E3 mailboard that producecs non-standard 20 * However, when used with the E3 mailboard that producecs non-standard
21 * scancodes, a custom key table must be prepared and loaded from userspace. 21 * scancodes, a custom key table must be prepared and loaded from userspace.
22 */ 22 */
23#include <linux/gpio.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/platform_data/ams-delta-fiq.h>
25#include <linux/platform_device.h>
26#include <linux/regulator/consumer.h>
25#include <linux/serio.h> 27#include <linux/serio.h>
26#include <linux/slab.h> 28#include <linux/slab.h>
27#include <linux/module.h> 29#include <linux/module.h>
28 30
29#include <asm/mach-types.h> 31#define DRIVER_NAME "ams-delta-serio"
30#include <mach/board-ams-delta.h>
31
32#include <mach/ams-delta-fiq.h>
33 32
34MODULE_AUTHOR("Matt Callow"); 33MODULE_AUTHOR("Matt Callow");
35MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver"); 34MODULE_DESCRIPTION("AMS Delta (E3) keyboard port driver");
36MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
37 36
38static struct serio *ams_delta_serio; 37struct ams_delta_serio {
38 struct serio *serio;
39 struct regulator *vcc;
40 unsigned int *fiq_buffer;
41};
39 42
40static int check_data(int data) 43static int check_data(struct serio *serio, int data)
41{ 44{
42 int i, parity = 0; 45 int i, parity = 0;
43 46
44 /* check valid stop bit */ 47 /* check valid stop bit */
45 if (!(data & 0x400)) { 48 if (!(data & 0x400)) {
46 dev_warn(&ams_delta_serio->dev, 49 dev_warn(&serio->dev, "invalid stop bit, data=0x%X\n", data);
47 "invalid stop bit, data=0x%X\n",
48 data);
49 return SERIO_FRAME; 50 return SERIO_FRAME;
50 } 51 }
51 /* calculate the parity */ 52 /* calculate the parity */
@@ -55,9 +56,9 @@ static int check_data(int data)
55 } 56 }
56 /* it should be odd */ 57 /* it should be odd */
57 if (!(parity & 0x01)) { 58 if (!(parity & 0x01)) {
58 dev_warn(&ams_delta_serio->dev, 59 dev_warn(&serio->dev,
59 "parity check failed, data=0x%X parity=0x%X\n", 60 "parity check failed, data=0x%X parity=0x%X\n", data,
60 data, parity); 61 parity);
61 return SERIO_PARITY; 62 return SERIO_PARITY;
62 } 63 }
63 return 0; 64 return 0;
@@ -65,127 +66,130 @@ static int check_data(int data)
65 66
66static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id) 67static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id)
67{ 68{
68 int *circ_buff = &fiq_buffer[FIQ_CIRC_BUFF]; 69 struct ams_delta_serio *priv = dev_id;
70 int *circ_buff = &priv->fiq_buffer[FIQ_CIRC_BUFF];
69 int data, dfl; 71 int data, dfl;
70 u8 scancode; 72 u8 scancode;
71 73
72 fiq_buffer[FIQ_IRQ_PEND] = 0; 74 priv->fiq_buffer[FIQ_IRQ_PEND] = 0;
73 75
74 /* 76 /*
75 * Read data from the circular buffer, check it 77 * Read data from the circular buffer, check it
76 * and then pass it on the serio 78 * and then pass it on the serio
77 */ 79 */
78 while (fiq_buffer[FIQ_KEYS_CNT] > 0) { 80 while (priv->fiq_buffer[FIQ_KEYS_CNT] > 0) {
79 81
80 data = circ_buff[fiq_buffer[FIQ_HEAD_OFFSET]++]; 82 data = circ_buff[priv->fiq_buffer[FIQ_HEAD_OFFSET]++];
81 fiq_buffer[FIQ_KEYS_CNT]--; 83 priv->fiq_buffer[FIQ_KEYS_CNT]--;
82 if (fiq_buffer[FIQ_HEAD_OFFSET] == fiq_buffer[FIQ_BUF_LEN]) 84 if (priv->fiq_buffer[FIQ_HEAD_OFFSET] ==
83 fiq_buffer[FIQ_HEAD_OFFSET] = 0; 85 priv->fiq_buffer[FIQ_BUF_LEN])
86 priv->fiq_buffer[FIQ_HEAD_OFFSET] = 0;
84 87
85 dfl = check_data(data); 88 dfl = check_data(priv->serio, data);
86 scancode = (u8) (data >> 1) & 0xFF; 89 scancode = (u8) (data >> 1) & 0xFF;
87 serio_interrupt(ams_delta_serio, scancode, dfl); 90 serio_interrupt(priv->serio, scancode, dfl);
88 } 91 }
89 return IRQ_HANDLED; 92 return IRQ_HANDLED;
90} 93}
91 94
92static int ams_delta_serio_open(struct serio *serio) 95static int ams_delta_serio_open(struct serio *serio)
93{ 96{
94 /* enable keyboard */ 97 struct ams_delta_serio *priv = serio->port_data;
95 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1);
96 98
97 return 0; 99 /* enable keyboard */
100 return regulator_enable(priv->vcc);
98} 101}
99 102
100static void ams_delta_serio_close(struct serio *serio) 103static void ams_delta_serio_close(struct serio *serio)
101{ 104{
105 struct ams_delta_serio *priv = serio->port_data;
106
102 /* disable keyboard */ 107 /* disable keyboard */
103 gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0); 108 regulator_disable(priv->vcc);
104} 109}
105 110
106static const struct gpio ams_delta_gpios[] __initconst_or_module = { 111static int ams_delta_serio_init(struct platform_device *pdev)
107 {
108 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA,
109 .flags = GPIOF_DIR_IN,
110 .label = "serio-data",
111 },
112 {
113 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK,
114 .flags = GPIOF_DIR_IN,
115 .label = "serio-clock",
116 },
117 {
118 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR,
119 .flags = GPIOF_OUT_INIT_LOW,
120 .label = "serio-power",
121 },
122 {
123 .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT,
124 .flags = GPIOF_OUT_INIT_LOW,
125 .label = "serio-dataout",
126 },
127};
128
129static int __init ams_delta_serio_init(void)
130{ 112{
131 int err; 113 struct ams_delta_serio *priv;
132 114 struct serio *serio;
133 if (!machine_is_ams_delta()) 115 int irq, err;
134 return -ENODEV;
135 116
136 ams_delta_serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 117 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
137 if (!ams_delta_serio) 118 if (!priv)
138 return -ENOMEM; 119 return -ENOMEM;
139 120
140 ams_delta_serio->id.type = SERIO_8042; 121 priv->fiq_buffer = pdev->dev.platform_data;
141 ams_delta_serio->open = ams_delta_serio_open; 122 if (!priv->fiq_buffer)
142 ams_delta_serio->close = ams_delta_serio_close; 123 return -EINVAL;
143 strlcpy(ams_delta_serio->name, "AMS DELTA keyboard adapter", 124
144 sizeof(ams_delta_serio->name)); 125 priv->vcc = devm_regulator_get(&pdev->dev, "vcc");
145 strlcpy(ams_delta_serio->phys, "GPIO/serio0", 126 if (IS_ERR(priv->vcc)) {
146 sizeof(ams_delta_serio->phys)); 127 err = PTR_ERR(priv->vcc);
147 128 dev_err(&pdev->dev, "regulator request failed (%d)\n", err);
148 err = gpio_request_array(ams_delta_gpios, 129 /*
149 ARRAY_SIZE(ams_delta_gpios)); 130 * When running on a non-dt platform and requested regulator
150 if (err) { 131 * is not available, devm_regulator_get() never returns
151 pr_err("ams_delta_serio: Couldn't request gpio pins\n"); 132 * -EPROBE_DEFER as it is not able to justify if the regulator
152 goto serio; 133 * may still appear later. On the other hand, the board can
134 * still set full constriants flag at late_initcall in order
135 * to instruct devm_regulator_get() to returnn a dummy one
136 * if sufficient. Hence, if we get -ENODEV here, let's convert
137 * it to -EPROBE_DEFER and wait for the board to decide or
138 * let Deferred Probe infrastructure handle this error.
139 */
140 if (err == -ENODEV)
141 err = -EPROBE_DEFER;
142 return err;
153 } 143 }
154 144
155 err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 145 irq = platform_get_irq(pdev, 0);
156 ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, 146 if (irq < 0)
157 "ams-delta-serio", 0); 147 return -ENXIO;
148
149 err = devm_request_irq(&pdev->dev, irq, ams_delta_serio_interrupt,
150 IRQ_TYPE_EDGE_RISING, DRIVER_NAME, priv);
158 if (err < 0) { 151 if (err < 0) {
159 pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", 152 dev_err(&pdev->dev, "IRQ request failed (%d)\n", err);
160 gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); 153 return err;
161 goto gpio;
162 } 154 }
163 /*
164 * Since GPIO register handling for keyboard clock pin is performed
165 * at FIQ level, switch back from edge to simple interrupt handler
166 * to avoid bad interaction.
167 */
168 irq_set_handler(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
169 handle_simple_irq);
170 155
171 serio_register_port(ams_delta_serio); 156 serio = kzalloc(sizeof(*serio), GFP_KERNEL);
172 dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); 157 if (!serio)
158 return -ENOMEM;
159
160 priv->serio = serio;
161
162 serio->id.type = SERIO_8042;
163 serio->open = ams_delta_serio_open;
164 serio->close = ams_delta_serio_close;
165 strlcpy(serio->name, "AMS DELTA keyboard adapter", sizeof(serio->name));
166 strlcpy(serio->phys, dev_name(&pdev->dev), sizeof(serio->phys));
167 serio->dev.parent = &pdev->dev;
168 serio->port_data = priv;
169
170 serio_register_port(serio);
171
172 platform_set_drvdata(pdev, priv);
173
174 dev_info(&serio->dev, "%s\n", serio->name);
173 175
174 return 0; 176 return 0;
175gpio:
176 gpio_free_array(ams_delta_gpios,
177 ARRAY_SIZE(ams_delta_gpios));
178serio:
179 kfree(ams_delta_serio);
180 return err;
181} 177}
182module_init(ams_delta_serio_init);
183 178
184static void __exit ams_delta_serio_exit(void) 179static int ams_delta_serio_exit(struct platform_device *pdev)
185{ 180{
186 serio_unregister_port(ams_delta_serio); 181 struct ams_delta_serio *priv = platform_get_drvdata(pdev);
187 free_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); 182
188 gpio_free_array(ams_delta_gpios, 183 serio_unregister_port(priv->serio);
189 ARRAY_SIZE(ams_delta_gpios)); 184
185 return 0;
190} 186}
191module_exit(ams_delta_serio_exit); 187
188static struct platform_driver ams_delta_serio_driver = {
189 .probe = ams_delta_serio_init,
190 .remove = ams_delta_serio_exit,
191 .driver = {
192 .name = DRIVER_NAME
193 },
194};
195module_platform_driver(ams_delta_serio_driver);
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 05157442a980..b1b53f6c452f 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -74,7 +74,6 @@ static const char version[] =
74#include <linux/skbuff.h> 74#include <linux/skbuff.h>
75 75
76#include <linux/dmaengine.h> 76#include <linux/dmaengine.h>
77#include <linux/dma/pxa-dma.h>
78 77
79#include <asm/io.h> 78#include <asm/io.h>
80 79
@@ -1795,7 +1794,6 @@ static int smc911x_probe(struct net_device *dev)
1795#ifdef SMC_USE_DMA 1794#ifdef SMC_USE_DMA
1796 struct dma_slave_config config; 1795 struct dma_slave_config config;
1797 dma_cap_mask_t mask; 1796 dma_cap_mask_t mask;
1798 struct pxad_param param;
1799#endif 1797#endif
1800 1798
1801 DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__); 1799 DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
@@ -1971,15 +1969,8 @@ static int smc911x_probe(struct net_device *dev)
1971 1969
1972 dma_cap_zero(mask); 1970 dma_cap_zero(mask);
1973 dma_cap_set(DMA_SLAVE, mask); 1971 dma_cap_set(DMA_SLAVE, mask);
1974 param.prio = PXAD_PRIO_LOWEST; 1972 lp->rxdma = dma_request_channel(mask, NULL, NULL);
1975 param.drcmr = -1UL; 1973 lp->txdma = dma_request_channel(mask, NULL, NULL);
1976
1977 lp->rxdma =
1978 dma_request_slave_channel_compat(mask, pxad_filter_fn,
1979 &param, &dev->dev, "rx");
1980 lp->txdma =
1981 dma_request_slave_channel_compat(mask, pxad_filter_fn,
1982 &param, &dev->dev, "tx");
1983 lp->rxdma_active = 0; 1974 lp->rxdma_active = 0;
1984 lp->txdma_active = 0; 1975 lp->txdma_active = 0;
1985 1976
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 080428762858..b944828f9ea3 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2019,17 +2019,10 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr,
2019# endif 2019# endif
2020 if (lp->cfg.flags & SMC91X_USE_DMA) { 2020 if (lp->cfg.flags & SMC91X_USE_DMA) {
2021 dma_cap_mask_t mask; 2021 dma_cap_mask_t mask;
2022 struct pxad_param param;
2023 2022
2024 dma_cap_zero(mask); 2023 dma_cap_zero(mask);
2025 dma_cap_set(DMA_SLAVE, mask); 2024 dma_cap_set(DMA_SLAVE, mask);
2026 param.prio = PXAD_PRIO_LOWEST; 2025 lp->dma_chan = dma_request_channel(mask, NULL, NULL);
2027 param.drcmr = -1UL;
2028
2029 lp->dma_chan =
2030 dma_request_slave_channel_compat(mask, pxad_filter_fn,
2031 &param, &dev->dev,
2032 "data");
2033 } 2026 }
2034#endif 2027#endif
2035 2028
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index b337ee97e0c0..a27352229fc2 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -301,7 +301,6 @@ struct smc_local {
301 * as RX which can overrun memory and lose packets. 301 * as RX which can overrun memory and lose packets.
302 */ 302 */
303#include <linux/dma-mapping.h> 303#include <linux/dma-mapping.h>
304#include <linux/dma/pxa-dma.h>
305 304
306#ifdef SMC_insl 305#ifdef SMC_insl
307#undef SMC_insl 306#undef SMC_insl
diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile
index 7dc0f20d7907..c37b0803c1b6 100644
--- a/drivers/soc/renesas/Makefile
+++ b/drivers/soc/renesas/Makefile
@@ -18,6 +18,9 @@ obj-$(CONFIG_SYSC_R8A77970) += r8a77970-sysc.o
18obj-$(CONFIG_SYSC_R8A77980) += r8a77980-sysc.o 18obj-$(CONFIG_SYSC_R8A77980) += r8a77980-sysc.o
19obj-$(CONFIG_SYSC_R8A77990) += r8a77990-sysc.o 19obj-$(CONFIG_SYSC_R8A77990) += r8a77990-sysc.o
20obj-$(CONFIG_SYSC_R8A77995) += r8a77995-sysc.o 20obj-$(CONFIG_SYSC_R8A77995) += r8a77995-sysc.o
21ifdef CONFIG_SMP
22obj-$(CONFIG_ARCH_R9A06G032) += r9a06g032-smp.o
23endif
21 24
22# Family 25# Family
23obj-$(CONFIG_RST_RCAR) += rcar-rst.o 26obj-$(CONFIG_RST_RCAR) += rcar-rst.o
diff --git a/drivers/soc/renesas/r9a06g032-smp.c b/drivers/soc/renesas/r9a06g032-smp.c
new file mode 100644
index 000000000000..a1926e8d73f2
--- /dev/null
+++ b/drivers/soc/renesas/r9a06g032-smp.c
@@ -0,0 +1,96 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * R9A06G032 Second CA7 enabler.
4 *
5 * Copyright (C) 2018 Renesas Electronics Europe Limited
6 *
7 * Michel Pollet <michel.pollet@bp.renesas.com>, <buserror@gmail.com>
8 * Derived from actions,s500-smp
9 */
10
11#include <linux/io.h>
12#include <linux/of.h>
13#include <linux/of_address.h>
14#include <linux/smp.h>
15
16/*
17 * The second CPU is parked in ROM at boot time. It requires waking it after
18 * writing an address into the BOOTADDR register of sysctrl.
19 *
20 * So the default value of the "cpu-release-addr" corresponds to BOOTADDR...
21 *
22 * *However* the BOOTADDR register is not available when the kernel
23 * starts in NONSEC mode.
24 *
25 * So for NONSEC mode, the bootloader re-parks the second CPU into a pen
26 * in SRAM, and changes the "cpu-release-addr" of linux's DT to a SRAM address,
27 * which is not restricted.
28 */
29
30static void __iomem *cpu_bootaddr;
31
32static DEFINE_SPINLOCK(cpu_lock);
33
34static int
35r9a06g032_smp_boot_secondary(unsigned int cpu,
36 struct task_struct *idle)
37{
38 if (!cpu_bootaddr)
39 return -ENODEV;
40
41 spin_lock(&cpu_lock);
42
43 writel(__pa_symbol(secondary_startup), cpu_bootaddr);
44 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
45
46 spin_unlock(&cpu_lock);
47
48 return 0;
49}
50
51static void __init r9a06g032_smp_prepare_cpus(unsigned int max_cpus)
52{
53 struct device_node *dn;
54 int ret = -EINVAL, dns;
55 u32 bootaddr;
56
57 dn = of_get_cpu_node(1, NULL);
58 if (!dn) {
59 pr_err("CPU#1: missing device tree node\n");
60 return;
61 }
62 /*
63 * Determine the address from which the CPU is polling.
64 * The bootloader *does* change this property.
65 * Note: The property can be either 64 or 32 bits, so handle both cases
66 */
67 if (of_find_property(dn, "cpu-release-addr", &dns)) {
68 if (dns == sizeof(u64)) {
69 u64 temp;
70
71 ret = of_property_read_u64(dn,
72 "cpu-release-addr", &temp);
73 bootaddr = temp;
74 } else {
75 ret = of_property_read_u32(dn,
76 "cpu-release-addr",
77 &bootaddr);
78 }
79 }
80 of_node_put(dn);
81 if (ret) {
82 pr_err("CPU#1: invalid cpu-release-addr property\n");
83 return;
84 }
85 pr_info("CPU#1: cpu-release-addr %08x\n", bootaddr);
86
87 cpu_bootaddr = ioremap(bootaddr, sizeof(bootaddr));
88}
89
90static const struct smp_operations r9a06g032_smp_ops __initconst = {
91 .smp_prepare_cpus = r9a06g032_smp_prepare_cpus,
92 .smp_boot_secondary = r9a06g032_smp_boot_secondary,
93};
94
95CPU_METHOD_OF_DECLARE(r9a06g032_smp,
96 "renesas,r9a06g032-smp", &r9a06g032_smp_ops);
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index 50d03d8b4f9a..029188e8be6e 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -58,6 +58,12 @@
58 58
59#define RCAR_PD_ALWAYS_ON 32 /* Always-on power area */ 59#define RCAR_PD_ALWAYS_ON 32 /* Always-on power area */
60 60
61struct rcar_sysc_ch {
62 u16 chan_offs;
63 u8 chan_bit;
64 u8 isr_bit;
65};
66
61static void __iomem *rcar_sysc_base; 67static void __iomem *rcar_sysc_base;
62static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */ 68static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */
63 69
@@ -143,12 +149,12 @@ static int rcar_sysc_power(const struct rcar_sysc_ch *sysc_ch, bool on)
143 return ret; 149 return ret;
144} 150}
145 151
146int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch) 152static int rcar_sysc_power_down(const struct rcar_sysc_ch *sysc_ch)
147{ 153{
148 return rcar_sysc_power(sysc_ch, false); 154 return rcar_sysc_power(sysc_ch, false);
149} 155}
150 156
151int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch) 157static int rcar_sysc_power_up(const struct rcar_sysc_ch *sysc_ch)
152{ 158{
153 return rcar_sysc_power(sysc_ch, true); 159 return rcar_sysc_power(sysc_ch, true);
154} 160}
@@ -315,6 +321,8 @@ struct rcar_pm_domains {
315 struct generic_pm_domain *domains[RCAR_PD_ALWAYS_ON + 1]; 321 struct generic_pm_domain *domains[RCAR_PD_ALWAYS_ON + 1];
316}; 322};
317 323
324static struct genpd_onecell_data *rcar_sysc_onecell_data;
325
318static int __init rcar_sysc_pd_init(void) 326static int __init rcar_sysc_pd_init(void)
319{ 327{
320 const struct rcar_sysc_info *info; 328 const struct rcar_sysc_info *info;
@@ -326,9 +334,6 @@ static int __init rcar_sysc_pd_init(void)
326 unsigned int i; 334 unsigned int i;
327 int error; 335 int error;
328 336
329 if (rcar_sysc_base)
330 return 0;
331
332 np = of_find_matching_node_and_match(NULL, rcar_sysc_matches, &match); 337 np = of_find_matching_node_and_match(NULL, rcar_sysc_matches, &match);
333 if (!np) 338 if (!np)
334 return -ENODEV; 339 return -ENODEV;
@@ -361,6 +366,7 @@ static int __init rcar_sysc_pd_init(void)
361 366
362 domains->onecell_data.domains = domains->domains; 367 domains->onecell_data.domains = domains->domains;
363 domains->onecell_data.num_domains = ARRAY_SIZE(domains->domains); 368 domains->onecell_data.num_domains = ARRAY_SIZE(domains->domains);
369 rcar_sysc_onecell_data = &domains->onecell_data;
364 370
365 for (i = 0, syscier = 0; i < info->num_areas; i++) 371 for (i = 0, syscier = 0; i < info->num_areas; i++)
366 syscier |= BIT(info->areas[i].isr_bit); 372 syscier |= BIT(info->areas[i].isr_bit);
@@ -448,27 +454,39 @@ void __init rcar_sysc_nullify(struct rcar_sysc_area *areas,
448 } 454 }
449} 455}
450 456
451void __init rcar_sysc_init(phys_addr_t base, u32 syscier) 457#ifdef CONFIG_ARCH_R8A7779
458static int rcar_sysc_power_cpu(unsigned int idx, bool on)
452{ 459{
453 u32 syscimr; 460 struct generic_pm_domain *genpd;
461 struct rcar_sysc_pd *pd;
462 unsigned int i;
454 463
455 if (!rcar_sysc_pd_init()) 464 if (!rcar_sysc_onecell_data)
456 return; 465 return -ENODEV;
457 466
458 rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); 467 for (i = 0; i < rcar_sysc_onecell_data->num_domains; i++) {
468 genpd = rcar_sysc_onecell_data->domains[i];
469 if (!genpd)
470 continue;
459 471
460 /* 472 pd = to_rcar_pd(genpd);
461 * Mask all interrupt sources to prevent the CPU from receiving them. 473 if (!(pd->flags & PD_CPU) || pd->ch.chan_bit != idx)
462 * Make sure not to clear reserved bits that were set before. 474 continue;
463 */
464 syscimr = ioread32(rcar_sysc_base + SYSCIMR);
465 syscimr |= syscier;
466 pr_debug("%s: syscimr = 0x%08x\n", __func__, syscimr);
467 iowrite32(syscimr, rcar_sysc_base + SYSCIMR);
468 475
469 /* 476 return on ? rcar_sysc_power_up(&pd->ch)
470 * SYSC needs all interrupt sources enabled to control power. 477 : rcar_sysc_power_down(&pd->ch);
471 */ 478 }
472 pr_debug("%s: syscier = 0x%08x\n", __func__, syscier); 479
473 iowrite32(syscier, rcar_sysc_base + SYSCIER); 480 return -ENOENT;
481}
482
483int rcar_sysc_power_down_cpu(unsigned int cpu)
484{
485 return rcar_sysc_power_cpu(cpu, false);
486}
487
488int rcar_sysc_power_up_cpu(unsigned int cpu)
489{
490 return rcar_sysc_power_cpu(cpu, true);
474} 491}
492#endif /* CONFIG_ARCH_R8A7779 */
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index 652739c7f718..d0dab323651f 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -41,6 +41,8 @@ static struct am33xx_pm_sram_addr *pm_sram;
41static struct device *pm33xx_dev; 41static struct device *pm33xx_dev;
42static struct wkup_m3_ipc *m3_ipc; 42static struct wkup_m3_ipc *m3_ipc;
43 43
44static unsigned long suspend_wfi_flags;
45
44static u32 sram_suspend_address(unsigned long addr) 46static u32 sram_suspend_address(unsigned long addr)
45{ 47{
46 return ((unsigned long)am33xx_do_wfi_sram + 48 return ((unsigned long)am33xx_do_wfi_sram +
@@ -53,7 +55,7 @@ static int am33xx_pm_suspend(suspend_state_t suspend_state)
53 int i, ret = 0; 55 int i, ret = 0;
54 56
55 ret = pm_ops->soc_suspend((unsigned long)suspend_state, 57 ret = pm_ops->soc_suspend((unsigned long)suspend_state,
56 am33xx_do_wfi_sram); 58 am33xx_do_wfi_sram, suspend_wfi_flags);
57 59
58 if (ret) { 60 if (ret) {
59 dev_err(pm33xx_dev, "PM: Kernel suspend failure\n"); 61 dev_err(pm33xx_dev, "PM: Kernel suspend failure\n");
@@ -227,6 +229,7 @@ static int am33xx_push_sram_idle(void)
227 ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data; 229 ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data;
228 ro_sram_data.amx3_pm_sram_data_phys = 230 ro_sram_data.amx3_pm_sram_data_phys =
229 gen_pool_virt_to_phys(sram_pool_data, ocmcram_location_data); 231 gen_pool_virt_to_phys(sram_pool_data, ocmcram_location_data);
232 ro_sram_data.rtc_base_virt = pm_ops->get_rtc_base_addr();
230 233
231 /* Save physical address to calculate resume offset during pm init */ 234 /* Save physical address to calculate resume offset during pm init */
232 am33xx_do_wfi_sram_phys = gen_pool_virt_to_phys(sram_pool, 235 am33xx_do_wfi_sram_phys = gen_pool_virt_to_phys(sram_pool,
@@ -310,6 +313,17 @@ static int am33xx_pm_probe(struct platform_device *pdev)
310 suspend_set_ops(&am33xx_pm_ops); 313 suspend_set_ops(&am33xx_pm_ops);
311#endif /* CONFIG_SUSPEND */ 314#endif /* CONFIG_SUSPEND */
312 315
316 /*
317 * For a system suspend we must flush the caches, we want
318 * the DDR in self-refresh, we want to save the context
319 * of the EMIF, and we want the wkup_m3 to handle low-power
320 * transition.
321 */
322 suspend_wfi_flags |= WFI_FLAG_FLUSH_CACHE;
323 suspend_wfi_flags |= WFI_FLAG_SELF_REFRESH;
324 suspend_wfi_flags |= WFI_FLAG_SAVE_EMIF;
325 suspend_wfi_flags |= WFI_FLAG_WAKE_M3;
326
313 ret = pm_ops->init(); 327 ret = pm_ops->init();
314 if (ret) { 328 if (ret) {
315 dev_err(dev, "Unable to call core pm init!\n"); 329 dev_err(dev, "Unable to call core pm init!\n");