Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c9f8be7 authored by Colin Tuckley's avatar Colin Tuckley Committed by Russell King
Browse files

ARM: 5873/1: ARM: Fix the reset logic for ARM RealView boards



Extend the patch from Philby John to the other "RealView" boards.
Rename the constants and offsets to reflect their actual functions.

Cc: Philby John <pjohn@in.mvista.com>
Signed-off-by: default avatarColin Tuckley <colin.tuckley@arm.com>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 62a8c5bc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@
#define REALVIEW_PB1176_L220_BASE		0x10110000 /* L220 registers */

/*
 * Control register SYS_RESETCTL is set to 1 to force a soft reset
 * Control register SYS_RESETCTL Bit 8 is set to 1 to force a soft reset
 */
#define REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL    0x0100
#define REALVIEW_PB1176_SYS_SOFT_RESET    0x0100

#endif	/* __ASM_ARCH_BOARD_PB1176_H */
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@
 *     SYS_CLD, SYS_BOOTCS
 */
#define REALVIEW_SYS_LOCK_LOCKED    (1 << 16)
#define REALVIEW_SYS_LOCKVAL_MASK	0xA05F	       /* Enable write access */
#define REALVIEW_SYS_LOCK_VAL	0xA05F	       /* Enable write access */

/*
 * REALVIEW_SYS_FLASH
+15 −0
Original line number Diff line number Diff line
@@ -381,6 +381,20 @@ static struct sys_timer realview_eb_timer = {
	.init		= realview_eb_timer_init,
};

static void realview_eb_reset(char mode)
{
	void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
	void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);

	/*
	 * To reset, we hit the on-board reset register
	 * in the system FPGA
	 */
	__raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
	if (core_tile_eb11mp())
		__raw_writel(0x0008, reset_ctrl);
}

static void __init realview_eb_init(void)
{
	int i;
@@ -408,6 +422,7 @@ static void __init realview_eb_init(void)
#ifdef CONFIG_LEDS
	leds_event = realview_leds_event;
#endif
	realview_reset = realview_eb_reset;
}

MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
+4 −6
Original line number Diff line number Diff line
@@ -292,12 +292,10 @@ static struct sys_timer realview_pb1176_timer = {

static void realview_pb1176_reset(char mode)
{
	void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) +
		REALVIEW_SYS_RESETCTL_OFFSET;
	void __iomem *rst_hdr_ctrl = __io_address(REALVIEW_SYS_BASE) +
		REALVIEW_SYS_LOCK_OFFSET;
	__raw_writel(REALVIEW_SYS_LOCKVAL_MASK, rst_hdr_ctrl);
	__raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl);
	void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
	void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);
	__raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
	__raw_writel(REALVIEW_PB1176_SYS_SOFT_RESET, reset_ctrl);
}

static void realview_pb1176_fixup(struct machine_desc *mdesc,
+5 −6
Original line number Diff line number Diff line
@@ -301,17 +301,16 @@ static struct sys_timer realview_pb11mp_timer = {

static void realview_pb11mp_reset(char mode)
{
	void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) +
		REALVIEW_SYS_RESETCTL_OFFSET;
	unsigned int val;
	void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
	void __iomem *lock_ctrl = __io_address(REALVIEW_SYS_LOCK);

	/*
	 * To reset, we hit the on-board reset register
	 * in the system FPGA
	 */
	val = __raw_readl(hdr_ctrl);
	val |= REALVIEW_PB11MP_SYS_CTRL_RESET_CONFIGCLR;
	__raw_writel(val, hdr_ctrl);
	__raw_writel(REALVIEW_SYS_LOCK_VAL, lock_ctrl);
	__raw_writel(0x0000, reset_ctrl);
	__raw_writel(0x0004, reset_ctrl);
}

static void __init realview_pb11mp_init(void)
Loading