Skip to content

Commit 1dcbae8

Browse files
dgerlachnmenon
authored andcommitted
soc: ti: wkup_m3_ipc: Add support for IO Isolation
AM43xx support isolation of the IOs so that control is taken from the peripheral they are connected to and overridden by values present in the CTRL_CONF_* registers for the pad in the control module. The actual toggling happens from the wkup_m3, so use a DT property from the wkup_m3_ipc node to allow the PM code to communicate the necessity for placing the IOs into isolation to the firmware. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Drew Fustini <dfustini@baylibre.com> Signed-off-by: Nishanth Menon <nm@ti.com> Link: https://lore.kernel.org/r/20220414192722.2978837-3-dfustini@baylibre.com
1 parent d4c41d3 commit 1dcbae8

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

drivers/soc/ti/wkup_m3_ipc.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#define IPC_VTT_STAT_MASK (0x1 << 3)
4747
#define IPC_VTT_GPIO_PIN_SHIFT (0x4)
4848
#define IPC_VTT_GPIO_PIN_MASK (0x3f << 4)
49+
#define IPC_IO_ISOLATION_STAT_SHIFT (10)
50+
#define IPC_IO_ISOLATION_STAT_MASK (0x1 << 10)
4951

5052
#define M3_STATE_UNKNOWN 0
5153
#define M3_STATE_RESET 1
@@ -228,6 +230,11 @@ static void wkup_m3_set_vtt_gpio(struct wkup_m3_ipc *m3_ipc, int gpio)
228230
(gpio << IPC_VTT_GPIO_PIN_SHIFT);
229231
}
230232

233+
static void wkup_m3_set_io_isolation(struct wkup_m3_ipc *m3_ipc)
234+
{
235+
m3_ipc->isolation_conf = (1 << IPC_IO_ISOLATION_STAT_SHIFT);
236+
}
237+
231238
/* Public functions */
232239
/**
233240
* wkup_m3_set_mem_type - Pass wkup_m3 which type of memory is in use
@@ -308,8 +315,8 @@ static int wkup_m3_prepare_low_power(struct wkup_m3_ipc *m3_ipc, int state)
308315
wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->resume_addr, 0);
309316
wkup_m3_ctrl_ipc_write(m3_ipc, m3_power_state, 1);
310317
wkup_m3_ctrl_ipc_write(m3_ipc, m3_ipc->mem_type |
311-
m3_ipc->vtt_conf, 4);
312-
318+
m3_ipc->vtt_conf |
319+
m3_ipc->isolation_conf, 4);
313320
wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 2);
314321
wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 3);
315322
wkup_m3_ctrl_ipc_write(m3_ipc, DS_IPC_DEFAULT, 5);
@@ -516,6 +523,9 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
516523
dev_warn(dev, "Invalid VTT GPIO(%d) pin\n", temp);
517524
}
518525

526+
if (of_find_property(np, "ti,set-io-isolation", NULL))
527+
wkup_m3_set_io_isolation(m3_ipc);
528+
519529
/*
520530
* Wait for firmware loading completion in a thread so we
521531
* can boot the wkup_m3 as soon as it's ready without holding

include/linux/wkup_m3_ipc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct wkup_m3_ipc {
3434
int mem_type;
3535
unsigned long resume_addr;
3636
int vtt_conf;
37+
int isolation_conf;
3738
int state;
3839

3940
struct completion sync_complete;

0 commit comments

Comments
 (0)