Skip to content

Commit

Permalink
Temporary AST setup for Palmetto and Barreleye
Browse files Browse the repository at this point in the history
Removed when pinmux driver is ready.

Signed-off-by: Norman James <nkskjames@gmail.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
  • Loading branch information
nkskjames authored and shenki committed Dec 10, 2015
1 parent 2eaa566 commit 6da1b0f
Showing 1 changed file with 70 additions and 7 deletions.
77 changes: 70 additions & 7 deletions arch/arm/mach-aspeed/aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,69 @@ static void ast_host_uart_setup(unsigned int speed, unsigned int clock)
ast_uart_out(UART_FCR, 0x7);
}

static void __init do_common_setup(void)
{
/* Enable LPC FWH cycles, Enable LPC to AHB bridge */
writel(0x00000500, AST_IO(AST_BASE_LPC | 0x80));

/* Flash controller */
writel(0x00000003, AST_IO(AST_BASE_SPI | 0x00));
writel(0x00002404, AST_IO(AST_BASE_SPI | 0x04));

/* Set UART routing */
writel(0x00000000, AST_IO(AST_BASE_LPC | 0x9c));

/* SCU setup */
writel(0x01C000FF, AST_IO(AST_BASE_SCU | 0x88));
writel(0xC1C000FF, AST_IO(AST_BASE_SCU | 0x8c));
writel(0x01C0007F, AST_IO(AST_BASE_SCU | 0x88));
writel(0x003FA009, AST_IO(AST_BASE_SCU | 0x90));

/* Setup scratch registers */
writel(0x00000042, AST_IO(AST_BASE_LPC | 0x170));
writel(0x00004000, AST_IO(AST_BASE_LPC | 0x174));
}

static void __init do_barreleye_setup(void)
{
u32 reg;

do_common_setup();

/* Setup PNOR address mapping for 64M flash */
writel(0x30000C00, AST_IO(AST_BASE_LPC | 0x88));
writel(0xFC0003FF, AST_IO(AST_BASE_LPC | 0x8C));

/* GPIO setup */
writel(0x9E82FCE7, AST_IO(AST_BASE_GPIO | 0x00));
writel(0x0370E677, AST_IO(AST_BASE_GPIO | 0x04));

/*
* Do read/modify/write on power gpio to prevent resetting power on
* reboot
*/
reg = readl(AST_IO(AST_BASE_GPIO | 0x20));
reg |= 0xCFC8F7FD;
writel(reg, AST_IO(AST_BASE_GPIO | 0x20));
writel(0xC738F20A, AST_IO(AST_BASE_GPIO | 0x24));
writel(0x0031FFAF, AST_IO(AST_BASE_GPIO | 0x80));
}

static void __init do_palmetto_setup(void)
{
do_common_setup();

/* Setup PNOR address mapping for 32M flash */
writel(0x30000E00, AST_IO(AST_BASE_LPC | 0x88));
writel(0xFE0001FF, AST_IO(AST_BASE_LPC | 0x8C));

/* GPIO setup */
writel(0x13008CE7, AST_IO(AST_BASE_GPIO | 0x00));
writel(0x0370E677, AST_IO(AST_BASE_GPIO | 0x04));
writel(0xDF48F7FF, AST_IO(AST_BASE_GPIO | 0x20));
writel(0xC738F202, AST_IO(AST_BASE_GPIO | 0x24));
}

#define SCU_PASSWORD 0x1688A8A8

static void __init aspeed_init_early(void)
Expand All @@ -128,17 +191,17 @@ static void __init aspeed_init_early(void)
writel(0, AST_IO(AST_BASE_WDT | 0x2c));

/*
* temporary: enable i2c usage of the shared GPIO/I2C pins for
* i2c busses 4 - 8
* ensure all IPs are reset on watchdog expiry
*/
reg = readl(AST_IO(AST_BASE_SCU | 0x90));
reg |= 0x3E0000;
writel(reg, AST_IO(AST_BASE_SCU | 0x90));
writel(0x003ffff3, AST_IO(AST_BASE_SCU | 0x9C));

/*
* ensure all IPs are reset on watchdog expiry
* Temporary setup of AST registers until pinmux driver is complete
*/
writel(0x003ffff3, AST_IO(AST_BASE_SCU | 0x9C));
if (of_machine_is_compatible("rackspace,barreleye-bmc"))
do_barreleye_setup();
if (of_machine_is_compatible("tyan,palmetto-bmc"))
do_palmetto_setup();
}

static void __init aspeed_map_io(void)
Expand Down

0 comments on commit 6da1b0f

Please sign in to comment.