The DDR SDRAM initialization code has not been mainlined yet, but U-Boot proper should work. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>master
parent
323d1f9d5b
commit
28f40d4a4d
@ -0,0 +1,64 @@ |
||||
/* |
||||
* Device Tree Source for UniPhier PH1-Pro5 4KBOX Board (EVB-Pro5-4KBOX-M-V0) |
||||
* |
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
/dts-v1/; |
||||
/include/ "uniphier-ph1-pro5.dtsi" |
||||
|
||||
/ { |
||||
model = "UniPhier PH1-Pro5 4KBOX Board"; |
||||
compatible = "socionext,ph1-pro5-4kbox", "socionext,ph1-pro5"; |
||||
|
||||
memory { |
||||
device_type = "memory"; |
||||
reg = <0x80000000 0x40000000>; |
||||
}; |
||||
|
||||
chosen { |
||||
bootargs = "console=ttyS1,115200"; |
||||
stdout-path = &serial1; |
||||
}; |
||||
|
||||
aliases { |
||||
serial1 = &serial1; |
||||
serial2 = &serial2; |
||||
i2c0 = &i2c0; |
||||
i2c5 = &i2c5; |
||||
i2c6 = &i2c6; |
||||
}; |
||||
}; |
||||
|
||||
&serial1 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&serial2 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
&i2c0 { |
||||
status = "okay"; |
||||
}; |
||||
|
||||
/* for U-boot only */ |
||||
/ { |
||||
soc { |
||||
u-boot,dm-pre-reloc; |
||||
}; |
||||
}; |
||||
|
||||
&serial1 { |
||||
u-boot,dm-pre-reloc; |
||||
}; |
||||
|
||||
&pinctrl { |
||||
u-boot,dm-pre-reloc; |
||||
}; |
||||
|
||||
&pinctrl_uart1 { |
||||
u-boot,dm-pre-reloc; |
||||
}; |
@ -0,0 +1,75 @@ |
||||
/*
|
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <spl.h> |
||||
#include <linux/io.h> |
||||
#include <mach/boot-device.h> |
||||
#include <mach/sbc-regs.h> |
||||
#include <mach/sg-regs.h> |
||||
|
||||
static struct boot_device_info boot_device_table[] = { |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 128KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 128KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 256KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 256KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 512KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 512KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 128KB, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 128MB, Addr 4)"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 512MB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 512KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 128KB, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 128KB, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, ONFI, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, ONFI, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, ONFI, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, ONFI, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, ONFI, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, ONFI, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, ONFI, Addr 4)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, ONFI, Addr 4)"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_MMC1, "eMMC Boot (1.8V)"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NONE, "Reserved"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 128MB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 128KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 256KB, Addr 5)"}, |
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 256KB, Addr 5)"}, |
||||
{ /* sentinel */ } |
||||
}; |
||||
|
||||
static int get_boot_mode_sel(void) |
||||
{ |
||||
return (readl(SG_PINMON0) >> 1) & 0x1f; |
||||
} |
||||
|
||||
u32 ph1_pro5_boot_device(void) |
||||
{ |
||||
int boot_mode; |
||||
|
||||
boot_mode = get_boot_mode_sel(); |
||||
|
||||
return boot_device_table[boot_mode].type; |
||||
} |
||||
|
||||
void ph1_pro5_boot_mode_show(void) |
||||
{ |
||||
int mode_sel, i; |
||||
|
||||
mode_sel = get_boot_mode_sel(); |
||||
|
||||
puts("Boot Mode Pin:\n"); |
||||
|
||||
for (i = 0; i < ARRAY_SIZE(boot_device_table); i++) |
||||
printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i, |
||||
boot_device_table[i].info); |
||||
} |
@ -0,0 +1,44 @@ |
||||
/*
|
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <linux/io.h> |
||||
#include <mach/init.h> |
||||
#include <mach/sc-regs.h> |
||||
|
||||
void ph1_pro5_clk_init(void) |
||||
{ |
||||
u32 tmp; |
||||
|
||||
/* deassert reset */ |
||||
tmp = readl(SC_RSTCTRL); |
||||
#ifdef CONFIG_USB_XHCI_UNIPHIER |
||||
tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO; |
||||
#endif |
||||
#ifdef CONFIG_NAND_DENALI |
||||
tmp |= SC_RSTCTRL_NRST_NAND; |
||||
#endif |
||||
writel(tmp, SC_RSTCTRL); |
||||
readl(SC_RSTCTRL); /* dummy read */ |
||||
|
||||
#ifdef CONFIG_USB_XHCI_UNIPHIER |
||||
tmp = readl(SC_RSTCTRL2); |
||||
tmp |= SC_RSTCTRL2_NRST_USB3B1; |
||||
writel(tmp, SC_RSTCTRL2); |
||||
readl(SC_RSTCTRL2); /* dummy read */ |
||||
#endif |
||||
|
||||
/* privide clocks */ |
||||
tmp = readl(SC_CLKCTRL); |
||||
#ifdef CONFIG_USB_XHCI_UNIPHIER |
||||
tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 | |
||||
SC_CLKCTRL_CEN_GIO; |
||||
#endif |
||||
#ifdef CONFIG_NAND_DENALI |
||||
tmp |= SC_CLKCTRL_CEN_NAND; |
||||
#endif |
||||
writel(tmp, SC_CLKCTRL); |
||||
readl(SC_CLKCTRL); /* dummy read */ |
||||
} |
@ -0,0 +1,39 @@ |
||||
/*
|
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.m@jp.panasonic.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <linux/io.h> |
||||
#include <mach/init.h> |
||||
#include <mach/sc-regs.h> |
||||
|
||||
int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd) |
||||
{ |
||||
u32 tmp; |
||||
|
||||
/*
|
||||
* deassert reset |
||||
* UMCA2: Ch1 (DDR3) |
||||
* UMCA1, UMC31: Ch0 (WIO1) |
||||
* UMCA0, UMC30: Ch0 (WIO0) |
||||
*/ |
||||
tmp = readl(SC_RSTCTRL4); |
||||
tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 | |
||||
SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | |
||||
SC_RSTCTRL4_NRST_UMC31 | SC_RSTCTRL4_NRST_UMC30; |
||||
writel(tmp, SC_RSTCTRL4); |
||||
readl(SC_RSTCTRL); /* dummy read */ |
||||
|
||||
/* privide clocks */ |
||||
tmp = readl(SC_CLKCTRL); |
||||
tmp |= SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI; |
||||
writel(tmp, SC_CLKCTRL); |
||||
tmp = readl(SC_CLKCTRL4); |
||||
tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC1 | |
||||
SC_CLKCTRL4_CEN_UMC0; |
||||
writel(tmp, SC_CLKCTRL4); |
||||
readl(SC_CLKCTRL4); /* dummy read */ |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,42 @@ |
||||
/*
|
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <common.h> |
||||
#include <spl.h> |
||||
#include <linux/compiler.h> |
||||
#include <mach/init.h> |
||||
#include <mach/micro-support-card.h> |
||||
|
||||
int ph1_pro5_init(const struct uniphier_board_data *bd) |
||||
{ |
||||
ph1_pro4_sbc_init(bd); |
||||
|
||||
support_card_reset(); |
||||
|
||||
support_card_init(); |
||||
|
||||
led_puts("L0"); |
||||
|
||||
memconf_init(bd); |
||||
|
||||
led_puts("L1"); |
||||
|
||||
ph1_pro5_early_clk_init(bd); |
||||
|
||||
led_puts("L2"); |
||||
|
||||
led_puts("L3"); |
||||
|
||||
#ifdef CONFIG_SPL_SERIAL_SUPPORT |
||||
preloader_console_init(); |
||||
#endif |
||||
|
||||
led_puts("L4"); |
||||
|
||||
led_puts("L5"); |
||||
|
||||
return 0; |
||||
} |
@ -0,0 +1,43 @@ |
||||
/*
|
||||
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
||||
* |
||||
* SPDX-License-Identifier: GPL-2.0+ |
||||
*/ |
||||
|
||||
#include <linux/io.h> |
||||
#include <mach/init.h> |
||||
#include <mach/sg-regs.h> |
||||
|
||||
void ph1_pro5_pin_init(void) |
||||
{ |
||||
/* Comment format: PAD Name -> Function Name */ |
||||
|
||||
#ifdef CONFIG_NAND_DENALI |
||||
sg_set_pinsel(19, 0, 4, 8); /* XNFRE -> XNFRE */ |
||||
sg_set_pinsel(20, 0, 4, 8); /* XNFWE -> XNFWE */ |
||||
sg_set_pinsel(21, 0, 4, 8); /* NFALE -> NFALE */ |
||||
sg_set_pinsel(22, 0, 4, 8); /* NFCLE -> NFCLE */ |
||||
sg_set_pinsel(23, 0, 4, 8); /* XNFWP -> XNFWP */ |
||||
sg_set_pinsel(24, 0, 4, 8); /* XNFCE0 -> XNFCE0 */ |
||||
sg_set_pinsel(25, 0, 4, 8); /* NRYBY0 -> NRYBY0 */ |
||||
sg_set_pinsel(26, 0, 4, 8); /* XNFCE1 -> XNFCE1 */ |
||||
sg_set_pinsel(27, 0, 4, 8); /* NRYBY1 -> NRYBY1 */ |
||||
sg_set_pinsel(28, 0, 4, 8); /* NFD0 -> NFD0 */ |
||||
sg_set_pinsel(29, 0, 4, 8); /* NFD1 -> NFD1 */ |
||||
sg_set_pinsel(30, 0, 4, 8); /* NFD2 -> NFD2 */ |
||||
sg_set_pinsel(31, 0, 4, 8); /* NFD3 -> NFD3 */ |
||||
sg_set_pinsel(32, 0, 4, 8); /* NFD4 -> NFD4 */ |
||||
sg_set_pinsel(33, 0, 4, 8); /* NFD5 -> NFD5 */ |
||||
sg_set_pinsel(34, 0, 4, 8); /* NFD6 -> NFD6 */ |
||||
sg_set_pinsel(35, 0, 4, 8); /* NFD7 -> NFD7 */ |
||||
#endif |
||||
|
||||
#ifdef CONFIG_USB_XHCI_UNIPHIER |
||||
sg_set_pinsel(124, 0, 4, 8); /* USB0VBUS -> USB0VBUS */ |
||||
sg_set_pinsel(125, 0, 4, 8); /* USB0OD -> USB0OD */ |
||||
sg_set_pinsel(126, 0, 4, 8); /* USB1VBUS -> USB1VBUS */ |
||||
sg_set_pinsel(127, 0, 4, 8); /* USB1OD -> USB1OD */ |
||||
#endif |
||||
|
||||
writel(1, SG_LOADPINCTRL); |
||||
} |
@ -0,0 +1,30 @@ |
||||
CONFIG_ARM=y |
||||
CONFIG_ARCH_UNIPHIER=y |
||||
CONFIG_ARCH_UNIPHIER_PH1_PRO5=y |
||||
CONFIG_SYS_MALLOC_F_LEN=0x2000 |
||||
CONFIG_MICRO_SUPPORT_CARD=y |
||||
CONFIG_SYS_TEXT_BASE=0x84000000 |
||||
CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro5-4kbox" |
||||
CONFIG_HUSH_PARSER=y |
||||
# CONFIG_CMD_XIMG is not set |
||||
# CONFIG_CMD_ENV_EXISTS is not set |
||||
CONFIG_CMD_NAND=y |
||||
CONFIG_CMD_I2C=y |
||||
CONFIG_CMD_USB=y |
||||
# CONFIG_CMD_FPGA is not set |
||||
CONFIG_CMD_TFTPPUT=y |
||||
CONFIG_CMD_PING=y |
||||
CONFIG_CMD_TIME=y |
||||
# CONFIG_CMD_MISC is not set |
||||
CONFIG_NET_RANDOM_ETHADDR=y |
||||
CONFIG_SPL_SIMPLE_BUS=y |
||||
CONFIG_NAND_DENALI=y |
||||
CONFIG_SYS_NAND_DENALI_64BIT=y |
||||
CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8 |
||||
CONFIG_SPL_NAND_DENALI=y |
||||
CONFIG_UNIPHIER_SERIAL=y |
||||
CONFIG_PINCTRL=y |
||||
CONFIG_SPL_PINCTRL=y |
||||
CONFIG_USB=y |
||||
CONFIG_USB_XHCI_HCD=y |
||||
CONFIG_USB_STORAGE=y |
Loading…
Reference in new issue