Skip to content

Commit 0dd5174

Browse files
committed
imx: Add gpc power control function
This adds a generic controller function to handle the various GPC power regions. For the HB Pulse we use this to power off both PCIE regions on boot to help return the devices to a sane state on reboot and sudden power off. Signed-off-by: Jon Nettleton <[email protected]>
1 parent c3f941c commit 0dd5174

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

arch/arm/include/asm/arch-imx8m/sys_proto.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ void set_wdog_reset(struct wdog_regs *wdog);
1212
void enable_tzc380(void);
1313
void restore_boot_params(void);
1414
int imx8m_usb_power(int usb_id, bool on);
15+
int imx8m_gpc_power(int id, bool on);
1516
extern unsigned long rom_pointer[];
1617
enum boot_device get_boot_device(void);
1718
bool is_usb_boot(void);

arch/arm/mach-imx/imx8m/soc.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ void reset_cpu(ulong addr)
236236
}
237237
}
238238

239-
#ifdef CONFIG_USB_XHCI_IMX8M
240239
#define FSL_SIP_GPC 0xC2000000
241240
#define FSL_SIP_CONFIG_GPC_PM_DOMAIN 0x03
241+
242+
#ifdef CONFIG_USB_XHCI_IMX8M
242243
int imx8m_usb_power(int usb_id, bool on)
243244
{
244245
unsigned long ret;
@@ -254,3 +255,16 @@ int imx8m_usb_power(int usb_id, bool on)
254255
return 0;
255256
}
256257
#endif
258+
259+
int imx8m_gpc_power(int id, bool on)
260+
{
261+
unsigned long ret;
262+
263+
ret = call_imx_sip(FSL_SIP_GPC,
264+
FSL_SIP_CONFIG_GPC_PM_DOMAIN, id, on, 0);
265+
if (ret)
266+
return -EPERM;
267+
268+
return 0;
269+
}
270+

board/solidrun/imx8mq_hb/imx8mq_hb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,8 @@ int board_late_init(void)
306306
init_usb_clk(0);
307307
init_usb_clk(1);
308308

309+
imx8m_gpc_power(10, false);
310+
imx8m_gpc_power(1, false);
311+
309312
return 0;
310313
}

0 commit comments

Comments
 (0)