diff options
author | Evert Pap <evert.pap@sintecs.nl> | 2016-09-22 08:35:33 (GMT) |
---|---|---|
committer | Evert Pap <evert.pap@sintecs.nl> | 2016-09-22 08:35:33 (GMT) |
commit | f029d670556a685862f5498dc5d206ed0a92f43b (patch) | |
tree | bcca136cc51ffe15303b6d9662affe426a14cabd /board | |
parent | 8a5268d587c7b565684396dc69f70153cf5fd174 (diff) | |
parent | 126fe70d7746d7e60a6331391cab6713368b78dc (diff) | |
download | u-boot-fsl-qoriq-f029d670556a685862f5498dc5d206ed0a92f43b.tar.xz |
Merge branch 'master' into scalys
Diffstat (limited to 'board')
167 files changed, 6535 insertions, 635 deletions
diff --git a/board/Barix/ipam390/README.ipam390 b/board/Barix/ipam390/README.ipam390 index 5c45fca..be09280 100644 --- a/board/Barix/ipam390/README.ipam390 +++ b/board/Barix/ipam390/README.ipam390 @@ -31,9 +31,9 @@ loading the next image from a different media, etc). Compilation =========== -run "./MAKEALL ipam390" in the u-boot source tree. -Once this build completes you will have a u-boot.ais file that needs to -be written to the nand flash. +run "tools/buildman/buildman -k ipam390" in the u-boot source tree. +Once this build completes you will have a ../current/ipam390/u-boot.ais file +that needs to be written to the nand flash. Flashing the images to NAND ========================== @@ -71,13 +71,13 @@ here[1] to create an uboot-uart-ais.bin file - cd to the u-boot source tree - compile the u-boot for the ipam390 board: -$ ./MAKEALL ipam390 +$ tools/buildman/buildman -k ipam390 -> Now we shall have u-boot.bin - Create u-boot-uart-ais.bin -$ mono HexAIS_OMAP-L138.exe -entrypoint 0xC1080000 -ini -ipam390-ais-uart.cfg -o ./uboot-uart-ais.bin ./u-boot.bin@0xC1080000; +$ mono HexAIS_OMAP-L138.exe -entrypoint 0xC1080000 -ini ipam390-ais-uart.cfg \ + -o ../current/ipam390/uboot-uart-ais.bin ./u-boot.bin@0xC1080000; Note: The ipam390-ais-uart.cfg is found in the board directory for the ipam390 board, u-boot:/board/Barix/ipam390/ipam390-ais-uart.cfg diff --git a/board/advantech/dms-ba16/Kconfig b/board/advantech/dms-ba16/Kconfig new file mode 100644 index 0000000..040eb86 --- /dev/null +++ b/board/advantech/dms-ba16/Kconfig @@ -0,0 +1,31 @@ +if TARGET_ADVANTECH_DMS_BA16 + +choice + prompt "DDR Size" + default SYS_DDR_2G + +config SYS_DDR_1G + bool "1GiB" + +config SYS_DDR_2G + bool "2GiB" + +endchoice + +config IMX_CONFIG + default "board/advantech/dms-ba16/dms-ba16_2g.cfg" if SYS_DDR_2G + default "board/advantech/dms-ba16/dms-ba16_1g.cfg" if SYS_DDR_1G + +config SYS_BOARD + default "dms-ba16" + +config SYS_VENDOR + default "advantech" + +config SYS_SOC + default "mx6" + +config SYS_CONFIG_NAME + default "advantech_dms-ba16" + +endif diff --git a/board/advantech/dms-ba16/MAINTAINERS b/board/advantech/dms-ba16/MAINTAINERS new file mode 100644 index 0000000..e8ea3dd --- /dev/null +++ b/board/advantech/dms-ba16/MAINTAINERS @@ -0,0 +1,8 @@ +ADVANTECH_DMS-BA16 BOARD +M: Akshay Bhat <akshaybhat@timesys.com> +M: Ken Lin <Ken.Lin@advantech.com.tw> +S: Maintained +F: board/advantech/dms-ba16/ +F: include/configs/advantech_dms-ba16.h +F: configs/dms-ba16_defconfig +F: configs/dms-ba16-1g_defconfig diff --git a/board/advantech/dms-ba16/Makefile b/board/advantech/dms-ba16/Makefile new file mode 100644 index 0000000..ec9aaa8 --- /dev/null +++ b/board/advantech/dms-ba16/Makefile @@ -0,0 +1,8 @@ +# +# Copyright 2016 Timesys Corporation +# Copyright 2016 Advantech Corporation +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := dms-ba16.o diff --git a/board/advantech/dms-ba16/clocks.cfg b/board/advantech/dms-ba16/clocks.cfg new file mode 100644 index 0000000..abc769c --- /dev/null +++ b/board/advantech/dms-ba16/clocks.cfg @@ -0,0 +1,25 @@ +/* set the default clock gate to save power */ +DATA 4, CCM_CCGR0, 0x00C03F3F +DATA 4, CCM_CCGR1, 0x0030FC03 +DATA 4, CCM_CCGR2, 0x0FFFC000 +DATA 4, CCM_CCGR3, 0x3FF00000 +DATA 4, CCM_CCGR4, 0x00FFF300 +DATA 4, CCM_CCGR5, 0x0F0000C3 +DATA 4, CCM_CCGR6, 0x000003FF + +/* enable AXI cache for VDOA/VPU/IPU */ +DATA 4, MX6_IOMUXC_GPR4, 0xF00000CF +/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ +DATA 4, MX6_IOMUXC_GPR6, 0x007F007F +DATA 4, MX6_IOMUXC_GPR7, 0x007F007F + +/* + * Setup CCM_CCOSR register as follows: + * + * cko1_en 1 --> CKO1 enabled + * cko1_div 111 --> divide by 8 + * cko1_sel 1011 --> ahb_clk_root + * + * This sets CKO1 at ahb_clk_root/8 132/8 16.5 MHz + */ +DATA 4, CCM_CCOSR, 0x000000fb diff --git a/board/advantech/dms-ba16/ddr-setup.cfg b/board/advantech/dms-ba16/ddr-setup.cfg new file mode 100644 index 0000000..4c43e64 --- /dev/null +++ b/board/advantech/dms-ba16/ddr-setup.cfg @@ -0,0 +1,39 @@ +/* DDR IO */ +DATA 4, MX6_IOM_GRP_DDR_TYPE, 0x000c0000 +DATA 4, MX6_IOM_GRP_DDRPKE, 0x00000000 +DATA 4, MX6_IOM_DRAM_SDCLK_0, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDCLK_1, 0x00000030 +DATA 4, MX6_IOM_DRAM_CAS, 0x00000030 +DATA 4, MX6_IOM_DRAM_RAS, 0x00000030 +DATA 4, MX6_IOM_GRP_ADDDS, 0x00000030 +DATA 4, MX6_IOM_DRAM_RESET, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDBA2, 0x00000000 +DATA 4, MX6_IOM_DRAM_SDODT0, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDODT1, 0x00000030 +DATA 4, MX6_IOM_GRP_CTLDS, 0x00000030 +DATA 4, MX6_IOM_DDRMODE_CTL, 0x00020000 +DATA 4, MX6_IOM_DRAM_SDQS0, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS1, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS2, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS3, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS4, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS5, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS6, 0x00000030 +DATA 4, MX6_IOM_DRAM_SDQS7, 0x00000030 +DATA 4, MX6_IOM_GRP_DDRMODE, 0x00020000 +DATA 4, MX6_IOM_GRP_B0DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B1DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B2DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B3DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B4DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B5DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B6DS, 0x00000030 +DATA 4, MX6_IOM_GRP_B7DS, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM0, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM1, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM2, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM3, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM4, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM5, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM6, 0x00000030 +DATA 4, MX6_IOM_DRAM_DQM7, 0x00000030 diff --git a/board/advantech/dms-ba16/dms-ba16.c b/board/advantech/dms-ba16/dms-ba16.c new file mode 100644 index 0000000..f0f1976 --- /dev/null +++ b/board/advantech/dms-ba16/dms-ba16.c @@ -0,0 +1,570 @@ +/* + * Copyright 2016 Timesys Corporation + * Copyright 2016 Advantech Corporation + * Copyright 2012 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <asm/arch/clock.h> +#include <asm/arch/imx-regs.h> +#include <asm/arch/iomux.h> +#include <asm/arch/mx6-pins.h> +#include <asm/errno.h> +#include <asm/gpio.h> +#include <asm/imx-common/mxc_i2c.h> +#include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/boot_mode.h> +#include <asm/imx-common/video.h> +#include <mmc.h> +#include <fsl_esdhc.h> +#include <miiphy.h> +#include <netdev.h> +#include <asm/arch/mxc_hdmi.h> +#include <asm/arch/crm_regs.h> +#include <asm/io.h> +#include <asm/arch/sys_proto.h> +#include <i2c.h> +#include <pwm.h> +DECLARE_GLOBAL_DATA_PTR; + +#define NC_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ + PAD_CTL_HYS) + +#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ + PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP | \ + PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \ + PAD_CTL_SRE_FAST | PAD_CTL_HYS) + +#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | PAD_CTL_PUE | \ + PAD_CTL_SPEED_HIGH | PAD_CTL_DSE_48ohm | PAD_CTL_SRE_FAST) + +#define ENET_CLK_PAD_CTRL (PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_120ohm | PAD_CTL_SRE_FAST) + +#define ENET_RX_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ + PAD_CTL_SPEED_HIGH | PAD_CTL_SRE_FAST) + +#define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \ + PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST) + +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) + +#define I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL) + +int dram_init(void) +{ + gd->ram_size = imx_ddr_size(); + + return 0; +} + +static iomux_v3_cfg_t const uart3_pads[] = { + MX6_PAD_EIM_D31__UART3_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_EIM_D23__UART3_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_EIM_D24__UART3_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), +}; + +static iomux_v3_cfg_t const uart4_pads[] = { + MX6_PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), + MX6_PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), +}; + +static iomux_v3_cfg_t const enet_pads[] = { + MX6_PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TXC__RGMII_TXC | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TD0__RGMII_TD0 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TD1__RGMII_TD1 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TD2__RGMII_TD2 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TD3__RGMII_TD3 | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_RGMII_TX_CTL__RGMII_TX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL), + MX6_PAD_ENET_REF_CLK__ENET_TX_CLK | MUX_PAD_CTRL(ENET_CLK_PAD_CTRL), + MX6_PAD_RGMII_RXC__RGMII_RXC | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + MX6_PAD_RGMII_RD0__RGMII_RD0 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + MX6_PAD_RGMII_RD1__RGMII_RD1 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + MX6_PAD_RGMII_RD2__RGMII_RD2 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + MX6_PAD_RGMII_RD3__RGMII_RD3 | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_RX_PAD_CTRL), + /* AR8033 PHY Reset */ + MX6_PAD_ENET_TX_EN__GPIO1_IO28 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void setup_iomux_enet(void) +{ + imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads)); + + /* Reset AR8033 PHY */ + gpio_direction_output(IMX_GPIO_NR(1, 28), 0); + udelay(500); + gpio_set_value(IMX_GPIO_NR(1, 28), 1); +} + +static iomux_v3_cfg_t const usdhc2_pads[] = { + MX6_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static iomux_v3_cfg_t const usdhc3_pads[] = { + MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; + +static iomux_v3_cfg_t const usdhc4_pads[] = { + MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT1__SD4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT2__SD4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT3__SD4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT4__SD4_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT5__SD4_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT6__SD4_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT7__SD4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_NANDF_CS0__GPIO6_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_NANDF_CS1__GPIO6_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static iomux_v3_cfg_t const ecspi1_pads[] = { + MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), + MX6_PAD_EIM_EB2__GPIO2_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static struct i2c_pads_info i2c_pad_info1 = { + .scl = { + .i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL | I2C_PAD, + .gpio_mode = MX6_PAD_CSI0_DAT9__GPIO5_IO27 | I2C_PAD, + .gp = IMX_GPIO_NR(5, 27) + }, + .sda = { + .i2c_mode = MX6_PAD_CSI0_DAT8__I2C1_SDA | I2C_PAD, + .gpio_mode = MX6_PAD_CSI0_DAT8__GPIO5_IO26 | I2C_PAD, + .gp = IMX_GPIO_NR(5, 26) + } +}; + +static struct i2c_pads_info i2c_pad_info2 = { + .scl = { + .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL | I2C_PAD, + .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 | I2C_PAD, + .gp = IMX_GPIO_NR(4, 12) + }, + .sda = { + .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA | I2C_PAD, + .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 | I2C_PAD, + .gp = IMX_GPIO_NR(4, 13) + } +}; + +static struct i2c_pads_info i2c_pad_info3 = { + .scl = { + .i2c_mode = MX6_PAD_GPIO_3__I2C3_SCL | I2C_PAD, + .gpio_mode = MX6_PAD_GPIO_3__GPIO1_IO03 | I2C_PAD, + .gp = IMX_GPIO_NR(1, 3) + }, + .sda = { + .i2c_mode = MX6_PAD_GPIO_6__I2C3_SDA | I2C_PAD, + .gpio_mode = MX6_PAD_GPIO_6__GPIO1_IO06 | I2C_PAD, + .gp = IMX_GPIO_NR(1, 6) + } +}; + +#ifdef CONFIG_MXC_SPI +int board_spi_cs_gpio(unsigned bus, unsigned cs) +{ + return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(2, 30)) : -1; +} + +static void setup_spi(void) +{ + imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads)); +} +#endif + +static iomux_v3_cfg_t const pcie_pads[] = { + MX6_PAD_GPIO_5__GPIO1_IO05 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void setup_pcie(void) +{ + imx_iomux_v3_setup_multiple_pads(pcie_pads, ARRAY_SIZE(pcie_pads)); +} + +static void setup_iomux_uart(void) +{ + imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads)); + imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads)); +} + +#ifdef CONFIG_FSL_ESDHC +struct fsl_esdhc_cfg usdhc_cfg[3] = { + {USDHC2_BASE_ADDR}, + {USDHC3_BASE_ADDR}, + {USDHC4_BASE_ADDR}, +}; + +#define USDHC2_CD_GPIO IMX_GPIO_NR(1, 4) +#define USDHC4_CD_GPIO IMX_GPIO_NR(6, 11) + +int board_mmc_getcd(struct mmc *mmc) +{ + struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; + int ret = 0; + + switch (cfg->esdhc_base) { + case USDHC2_BASE_ADDR: + ret = !gpio_get_value(USDHC2_CD_GPIO); + break; + case USDHC3_BASE_ADDR: + ret = 1; /* eMMC is always present */ + break; + case USDHC4_BASE_ADDR: + ret = !gpio_get_value(USDHC4_CD_GPIO); + break; + } + + return ret; +} + +int board_mmc_init(bd_t *bis) +{ + int ret; + int i; + + for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) { + switch (i) { + case 0: + imx_iomux_v3_setup_multiple_pads( + usdhc2_pads, ARRAY_SIZE(usdhc2_pads)); + gpio_direction_input(USDHC2_CD_GPIO); + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); + break; + case 1: + imx_iomux_v3_setup_multiple_pads( + usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); + usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); + break; + case 2: + imx_iomux_v3_setup_multiple_pads( + usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); + gpio_direction_input(USDHC4_CD_GPIO); + usdhc_cfg[2].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); + break; + default: + printf("Warning: you configured more USDHC controllers\n" + "(%d) then supported by the board (%d)\n", + i + 1, CONFIG_SYS_FSL_USDHC_NUM); + return -EINVAL; + } + + ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + if (ret) + return ret; + } + + return 0; +} +#endif + +static int mx6_rgmii_rework(struct phy_device *phydev) +{ + /* set device address 0x7 */ + phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7); + /* offset 0x8016: CLK_25M Clock Select */ + phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016); + /* enable register write, no post increment, address 0x7 */ + phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007); + /* set to 125 MHz from local PLL source */ + phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x18); + /* set debug port address: SerDes Test and System Mode Control */ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); + /* enable rgmii tx clock delay */ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); + + return 0; +} + +int board_phy_config(struct phy_device *phydev) +{ + mx6_rgmii_rework(phydev); + + if (phydev->drv->config) + phydev->drv->config(phydev); + + return 0; +} + +#if defined(CONFIG_VIDEO_IPUV3) +static iomux_v3_cfg_t const backlight_pads[] = { + /* Power for LVDS Display */ + MX6_PAD_EIM_D22__GPIO3_IO22 | MUX_PAD_CTRL(NO_PAD_CTRL), +#define LVDS_POWER_GP IMX_GPIO_NR(3, 22) + /* Backlight enable for LVDS display */ + MX6_PAD_GPIO_0__GPIO1_IO00 | MUX_PAD_CTRL(NO_PAD_CTRL), +#define LVDS_BACKLIGHT_GP IMX_GPIO_NR(1, 0) + /* backlight PWM brightness control */ + MX6_PAD_SD1_DAT3__PWM1_OUT | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + +static void do_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} + +int board_cfb_skip(void) +{ + gpio_direction_output(LVDS_POWER_GP, 1); + + return 0; +} + +static int detect_baseboard(struct display_info_t const *dev) +{ + return 0 == dev->addr; +} + +struct display_info_t const displays[] = {{ + .bus = -1, + .addr = 0, + .pixfmt = IPU_PIX_FMT_RGB24, + .detect = detect_baseboard, + .enable = NULL, + .mode = { + .name = "SHARP-LQ156M1LG21", + .refresh = 60, + .xres = 1920, + .yres = 1080, + .pixclock = 7851, + .left_margin = 100, + .right_margin = 40, + .upper_margin = 30, + .lower_margin = 3, + .hsync_len = 10, + .vsync_len = 2, + .sync = FB_SYNC_EXT, + .vmode = FB_VMODE_NONINTERLACED +} }, { + .bus = -1, + .addr = 3, + .pixfmt = IPU_PIX_FMT_RGB24, + .detect = detect_hdmi, + .enable = do_enable_hdmi, + .mode = { + .name = "HDMI", + .refresh = 60, + .xres = 1024, + .yres = 768, + .pixclock = 15385, + .left_margin = 220, + .right_margin = 40, + .upper_margin = 21, + .lower_margin = 7, + .hsync_len = 60, + .vsync_len = 10, + .sync = FB_SYNC_EXT, + .vmode = FB_VMODE_NONINTERLACED +} } }; +size_t display_count = ARRAY_SIZE(displays); + +static void setup_display(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; + + clrbits_le32(&mxc_ccm->cscmr2, MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV); + + imx_setup_hdmi(); + + /* Set LDB_DI0 as clock source for IPU_DI0 */ + clrsetbits_le32(&mxc_ccm->chsccdr, + MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_MASK, + (CHSCCDR_CLK_SEL_LDB_DI0 << + MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET)); + + /* Turn on IPU LDB DI0 clocks */ + setbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_LDB_DI0_MASK); + + enable_ipu_clock(); + + writel(IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES | + IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_HIGH | + IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW | + IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG | + IOMUXC_GPR2_DATA_WIDTH_CH1_24BIT | + IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG | + IOMUXC_GPR2_DATA_WIDTH_CH0_24BIT | + IOMUXC_GPR2_SPLIT_MODE_EN_MASK | + IOMUXC_GPR2_LVDS_CH0_MODE_ENABLED_DI0 | + IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0, + &iomux->gpr[2]); + + clrsetbits_le32(&iomux->gpr[3], + IOMUXC_GPR3_LVDS0_MUX_CTL_MASK | + IOMUXC_GPR3_LVDS1_MUX_CTL_MASK | + IOMUXC_GPR3_HDMI_MUX_CTL_MASK, + (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 << + IOMUXC_GPR3_LVDS0_MUX_CTL_OFFSET)); + + /* backlights off until needed */ + imx_iomux_v3_setup_multiple_pads(backlight_pads, + ARRAY_SIZE(backlight_pads)); + + gpio_direction_input(LVDS_POWER_GP); + gpio_direction_input(LVDS_BACKLIGHT_GP); +} +#endif /* CONFIG_VIDEO_IPUV3 */ + +/* + * Do not overwrite the console + * Use always serial for U-Boot console + */ +int overwrite_console(void) +{ + return 1; +} + +int board_eth_init(bd_t *bis) +{ + setup_iomux_enet(); + setup_pcie(); + + return cpu_eth_init(bis); +} + +static iomux_v3_cfg_t const misc_pads[] = { + MX6_PAD_KEY_ROW2__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL), + MX6_PAD_EIM_A25__GPIO5_IO02 | MUX_PAD_CTRL(NC_PAD_CTRL), + MX6_PAD_EIM_CS0__GPIO2_IO23 | MUX_PAD_CTRL(NC_PAD_CTRL), + MX6_PAD_EIM_CS1__GPIO2_IO24 | MUX_PAD_CTRL(NC_PAD_CTRL), + MX6_PAD_EIM_OE__GPIO2_IO25 | MUX_PAD_CTRL(NC_PAD_CTRL), + MX6_PAD_EIM_BCLK__GPIO6_IO31 | MUX_PAD_CTRL(NC_PAD_CTRL), + MX6_PAD_GPIO_1__GPIO1_IO01 | MUX_PAD_CTRL(NC_PAD_CTRL), +}; +#define SUS_S3_OUT IMX_GPIO_NR(4, 11) +#define WIFI_EN IMX_GPIO_NR(6, 14) + +int setup_ba16_sata(void) +{ + struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; + int ret; + + ret = enable_sata_clock(); + if (ret) + return ret; + + clrsetbits_le32(&iomuxc_regs->gpr[13], + IOMUXC_GPR13_SATA_MASK, + IOMUXC_GPR13_SATA_PHY_8_RXEQ_3P0DB + |IOMUXC_GPR13_SATA_PHY_7_SATA2M + |IOMUXC_GPR13_SATA_SPEED_3G + |(1<<IOMUXC_GPR13_SATA_PHY_6_SHIFT) + |IOMUXC_GPR13_SATA_SATA_PHY_5_SS_DISABLED + |IOMUXC_GPR13_SATA_SATA_PHY_4_ATTEN_12_16 + |IOMUXC_GPR13_SATA_PHY_3_TXBOOST_3P33_DB + |IOMUXC_GPR13_SATA_PHY_2_TX_1P133V + |IOMUXC_GPR13_SATA_PHY_1_SLOW); + + return 0; +} + +int board_early_init_f(void) +{ + imx_iomux_v3_setup_multiple_pads(misc_pads, + ARRAY_SIZE(misc_pads)); + + setup_iomux_uart(); + +#if defined(CONFIG_VIDEO_IPUV3) + /* Set LDB clock to PLL2 PFD0 */ + select_ldb_di_clock_source(MXC_PLL2_PFD0_CLK); +#endif + return 0; +} + +int board_init(void) +{ + gpio_direction_output(SUS_S3_OUT, 1); + gpio_direction_output(WIFI_EN, 1); +#if defined(CONFIG_VIDEO_IPUV3) + setup_display(); +#endif + /* address of boot parameters */ + gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; + +#ifdef CONFIG_MXC_SPI + setup_spi(); +#endif + setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); + setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); + setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3); + + return 0; +} + +#ifdef CONFIG_CMD_BMODE +static const struct boot_mode board_boot_modes[] = { + /* 4 bit bus width */ + {"sd2", MAKE_CFGVAL(0x40, 0x28, 0x00, 0x00)}, + {"sd3", MAKE_CFGVAL(0x40, 0x30, 0x00, 0x00)}, + {NULL, 0}, +}; +#endif + +int board_late_init(void) +{ +#ifdef CONFIG_CMD_BMODE + add_board_boot_modes(board_boot_modes); +#endif + /* + * We need at least 200ms between power on and backlight on + * as per specifications from CHI MEI + */ + mdelay(250); + + /* enable backlight PWM 1 */ + pwm_init(0, 0, 0); + + /* duty cycle 5000000ns, period: 5000000ns */ + pwm_config(0, 5000000, 5000000); + + /* Backlight Power */ + gpio_direction_output(LVDS_BACKLIGHT_GP, 1); + + pwm_enable(0); + +#ifdef CONFIG_CMD_SATA + setup_ba16_sata(); +#endif + + return 0; +} + +int checkboard(void) +{ + printf("BOARD: %s\n", CONFIG_BOARD_NAME); + return 0; +} diff --git a/board/advantech/dms-ba16/dms-ba16_1g.cfg b/board/advantech/dms-ba16/dms-ba16_1g.cfg new file mode 100644 index 0000000..d5de1fd --- /dev/null +++ b/board/advantech/dms-ba16/dms-ba16_1g.cfg @@ -0,0 +1,25 @@ +/* + * + * Copyright 2015 Timesys Corporation. + * Copyright 2015 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + * + * Refer doc/README.imximage for more details about how-to configure + * and create imximage boot image + * + * The syntax is taken as close as possible with the kwbimage + */ + +IMAGE_VERSION 2 +BOOT_FROM sd + +#define __ASSEMBLY__ +#include <config.h> +#include "asm/arch/mx6-ddr.h" +#include "asm/arch/iomux.h" +#include "asm/arch/crm_regs.h" + +#include "ddr-setup.cfg" +#include "micron-1g.cfg" +#include "clocks.cfg" diff --git a/board/advantech/dms-ba16/dms-ba16_2g.cfg b/board/advantech/dms-ba16/dms-ba16_2g.cfg new file mode 100644 index 0000000..a731af6 --- /dev/null +++ b/board/advantech/dms-ba16/dms-ba16_2g.cfg @@ -0,0 +1,25 @@ +/* + * + * Copyright 2015 Timesys Corporation. + * Copyright 2015 General Electric Company + * + * SPDX-License-Identifier: GPL-2.0+ + * + * Refer doc/README.imximage for more details about how-to configure + * and create imximage boot image + * + * The syntax is taken as close as possible with the kwbimage + */ + +IMAGE_VERSION 2 +BOOT_FROM sd + +#define __ASSEMBLY__ +#include <config.h> +#include "asm/arch/mx6-ddr.h" +#include "asm/arch/iomux.h" +#include "asm/arch/crm_regs.h" + +#include "ddr-setup.cfg" +#include "samsung-2g.cfg" +#include "clocks.cfg" diff --git a/board/advantech/dms-ba16/micron-1g.cfg b/board/advantech/dms-ba16/micron-1g.cfg new file mode 100644 index 0000000..8cfefe2 --- /dev/null +++ b/board/advantech/dms-ba16/micron-1g.cfg @@ -0,0 +1,63 @@ +/* Calibrations */ +/* ZQ */ +DATA 4, MX6_MMDC_P0_MPZQHWCTRL, 0xa1390003 +/* write leveling */ +DATA 4, MX6_MMDC_P0_MPWLDECTRL0, 0x001F001F +DATA 4, MX6_MMDC_P0_MPWLDECTRL1, 0x001F001F +DATA 4, MX6_MMDC_P1_MPWLDECTRL0, 0x001F001F +DATA 4, MX6_MMDC_P1_MPWLDECTRL1, 0x001F001F +/* Read DQS Gating calibration */ +DATA 4, MX6_MMDC_P0_MPDGCTRL0, 0x43480350 +DATA 4, MX6_MMDC_P0_MPDGCTRL1, 0x033C0340 +DATA 4, MX6_MMDC_P1_MPDGCTRL0, 0x43480350 +DATA 4, MX6_MMDC_P1_MPDGCTRL1, 0x03340314 +/* Read calibration */ +DATA 4, MX6_MMDC_P0_MPRDDLCTL, 0x382E2C32 +DATA 4, MX6_MMDC_P1_MPRDDLCTL, 0x38363044 +/* Write calibration */ +DATA 4 MX6_MMDC_P0_MPWRDLCTL, 0x3A38403A +DATA 4 MX6_MMDC_P1_MPWRDLCTL, 0x4432483E +/* read data bit delay */ +DATA 4, MX6_MMDC_P0_MPRDDQBY0DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY1DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY2DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY3DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY0DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY1DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY2DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY3DL, 0x33333333 + +/* Complete calibration by forced measurment */ +DATA 4, MX6_MMDC_P0_MPMUR0, 0x00000800 +DATA 4, MX6_MMDC_P1_MPMUR0, 0x00000800 + +/* MMDC init */ +DATA 4, MX6_MMDC_P0_MDPDC, 0x00020036 +DATA 4, MX6_MMDC_P0_MDOTC, 0x09444040 +DATA 4, MX6_MMDC_P0_MDCFG0, 0x555A79A5 +DATA 4, MX6_MMDC_P0_MDCFG1, 0xDB538E64 +DATA 4, MX6_MMDC_P0_MDCFG2, 0x01ff00db +DATA 4, MX6_MMDC_P0_MDMISC, 0x00001740 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 +DATA 4, MX6_MMDC_P0_MDRWD, 0x000026d2 +DATA 4, MX6_MMDC_P0_MDOR, 0x005a1023 +DATA 4, MX6_MMDC_P0_MDASP, 0x00000027 +DATA 4, MX6_MMDC_P0_MDCTL, 0x831a0000 + +/* Initialize memory */ +DATA 4, MX6_MMDC_P0_MDSCR, 0x04088032 +DATA 4, MX6_MMDC_P0_MDSCR, 0x0408803a +DATA 4, MX6_MMDC_P0_MDSCR, 0x00008033 +DATA 4, MX6_MMDC_P0_MDSCR, 0x0000803b +DATA 4, MX6_MMDC_P0_MDSCR, 0x00048031 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00048039 +DATA 4, MX6_MMDC_P0_MDSCR, 0x09408030 +DATA 4, MX6_MMDC_P0_MDSCR, 0x09408038 +DATA 4, MX6_MMDC_P0_MDSCR, 0x04008040 +DATA 4, MX6_MMDC_P0_MDSCR, 0x04008048 +DATA 4, MX6_MMDC_P0_MDREF, 0x00005800 +DATA 4, MX6_MMDC_P0_MPODTCTRL, 0x00033337 +DATA 4, MX6_MMDC_P1_MPODTCTRL, 0x00033337 +DATA 4, MX6_MMDC_P0_MDPDC, 0x00025576 +DATA 4, MX6_MMDC_P0_MAPSR, 0x00011006 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00000000 diff --git a/board/advantech/dms-ba16/samsung-2g.cfg b/board/advantech/dms-ba16/samsung-2g.cfg new file mode 100644 index 0000000..4166cc9 --- /dev/null +++ b/board/advantech/dms-ba16/samsung-2g.cfg @@ -0,0 +1,63 @@ +/* Calibrations */ +/* ZQ */ +DATA 4, MX6_MMDC_P0_MPZQHWCTRL, 0xa1390003 +/* write leveling */ +DATA 4, MX6_MMDC_P0_MPWLDECTRL0, 0x001F001F +DATA 4, MX6_MMDC_P0_MPWLDECTRL1, 0x001F001F +DATA 4, MX6_MMDC_P1_MPWLDECTRL0, 0x001F001F +DATA 4, MX6_MMDC_P1_MPWLDECTRL1, 0x001F001F +/* Read DQS Gating calibration */ +DATA 4, MX6_MMDC_P0_MPDGCTRL0, 0x45380544 +DATA 4, MX6_MMDC_P0_MPDGCTRL1, 0x05280530 +DATA 4, MX6_MMDC_P1_MPDGCTRL0, 0x4530053C +DATA 4, MX6_MMDC_P1_MPDGCTRL1, 0x0530050C +/* Read calibration */ +DATA 4, MX6_MMDC_P0_MPRDDLCTL, 0x36303032 +DATA 4, MX6_MMDC_P1_MPRDDLCTL, 0x38363042 +/* Write calibration */ +DATA 4, MX6_MMDC_P0_MPWRDLCTL, 0x3A3A423E +DATA 4, MX6_MMDC_P1_MPWRDLCTL, 0x4A38483E +/* read data bit delay */ +DATA 4, MX6_MMDC_P0_MPRDDQBY0DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY1DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY2DL, 0x33333333 +DATA 4, MX6_MMDC_P0_MPRDDQBY3DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY0DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY1DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY2DL, 0x33333333 +DATA 4, MX6_MMDC_P1_MPRDDQBY3DL, 0x33333333 + +/* Complete calibration by forced measurment */ +DATA 4, MX6_MMDC_P0_MPMUR0, 0x00000800 +DATA 4, MX6_MMDC_P1_MPMUR0, 0x00000800 + +/* MMDC init */ +DATA 4, MX6_MMDC_P0_MDPDC, 0x00020036 +DATA 4, MX6_MMDC_P0_MDOTC, 0x09444040 +DATA 4, MX6_MMDC_P0_MDCFG0, 0x8A8F79A4 +DATA 4, MX6_MMDC_P0_MDCFG1, 0xDB538E64 +DATA 4, MX6_MMDC_P0_MDCFG2, 0x01ff00db +DATA 4, MX6_MMDC_P0_MDMISC, 0x00001740 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00008000 +DATA 4, MX6_MMDC_P0_MDRWD, 0x000026d2 +DATA 4, MX6_MMDC_P0_MDOR, 0x008F1023 +DATA 4, MX6_MMDC_P0_MDASP, 0x00000047 +DATA 4, MX6_MMDC_P0_MDCTL, 0x841a0000 + +/* Initialize memory */ +DATA 4, MX6_MMDC_P0_MDSCR, 0x04088032 +DATA 4, MX6_MMDC_P0_MDSCR, 0x0408803a +DATA 4, MX6_MMDC_P0_MDSCR, 0x00008033 +DATA 4, MX6_MMDC_P0_MDSCR, 0x0000803b +DATA 4, MX6_MMDC_P0_MDSCR, 0x00408031 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00408039 +DATA 4, MX6_MMDC_P0_MDSCR, 0x09408030 +DATA 4, MX6_MMDC_P0_MDSCR, 0x09408038 +DATA 4, MX6_MMDC_P0_MDSCR, 0x04008040 +DATA 4, MX6_MMDC_P0_MDSCR, 0x04008048 +DATA 4, MX6_MMDC_P0_MDREF, 0x00005800 +DATA 4, MX6_MMDC_P0_MPODTCTRL, 0x00011117 +DATA 4, MX6_MMDC_P1_MPODTCTRL, 0x00011117 +DATA 4, MX6_MMDC_P0_MDPDC, 0x00025576 +DATA 4, MX6_MMDC_P0_MAPSR, 0x00011006 +DATA 4, MX6_MMDC_P0_MDSCR, 0x00000000 diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index bd72100..b61daaa 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -21,24 +21,11 @@ int board_init(void) return 0; } -static const struct eth_pdata gxbb_eth_pdata = { - .iobase = GXBB_ETH_BASE, - .phy_interface = PHY_INTERFACE_MODE_RGMII, -}; - -U_BOOT_DEVICE(meson_eth) = { - .name = "eth_designware", - .platdata = &gxbb_eth_pdata, -}; - int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE]; ssize_t len; - /* Select Ethernet function */ - setbits_le32(GXBB_PINMUX(6), 0x3fff); - /* Set RGMII mode */ setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF | GXBB_ETH_REG_0_TX_PHASE(1) | diff --git a/board/armltd/vexpress/Makefile b/board/armltd/vexpress/Makefile index 1dd6780..95f4ec0 100644 --- a/board/armltd/vexpress/Makefile +++ b/board/armltd/vexpress/Makefile @@ -6,3 +6,4 @@ # obj-y := vexpress_common.o +obj-$(CONFIG_TARGET_VEXPRESS_CA15_TC2) += vexpress_tc2.o diff --git a/board/armltd/vexpress/vexpress_tc2.c b/board/armltd/vexpress/vexpress_tc2.c new file mode 100644 index 0000000..ebb41a8 --- /dev/null +++ b/board/armltd/vexpress/vexpress_tc2.c @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2016 Linaro + * Jon Medhurst <tixy@linaro.org> + * + * TC2 specific code for Versatile Express. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <asm/io.h> + +#define SCC_BASE 0x7fff0000 + +bool armv7_boot_nonsec_default(void) +{ +#ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT + return false +#else + /* + * The Serial Configuration Controller (SCC) register at address 0x700 + * contains flags for configuring the behaviour of the Boot Monitor + * (which CPUs execute from reset). Two of these bits are of interest: + * + * bit 12 = Use per-cpu mailboxes for power management + * bit 13 = Power down the non-boot cluster + * + * It is only when both of these are false that U-Boot's current + * implementation of 'nonsec' mode can work as expected because we + * rely on getting all CPUs to execute _nonsec_init, so let's check that. + */ + return (readl((u32 *)(SCC_BASE + 0x700)) & ((1 << 12) | (1 << 13))) == 0; +#endif +} diff --git a/board/atmark-techno/armadillo-800eva/armadillo-800eva.c b/board/atmark-techno/armadillo-800eva/armadillo-800eva.c index 0e9c222..28e6111 100644 --- a/board/atmark-techno/armadillo-800eva/armadillo-800eva.c +++ b/board/atmark-techno/armadillo-800eva/armadillo-800eva.c @@ -315,7 +315,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; int board_late_init(void) diff --git a/board/bachmann/ot1200/ot1200_spl.c b/board/bachmann/ot1200/ot1200_spl.c index f651a40..9d28da4 100644 --- a/board/bachmann/ot1200/ot1200_spl.c +++ b/board/bachmann/ot1200/ot1200_spl.c @@ -85,6 +85,8 @@ static struct mx6_ddr_sysinfo ot1200_ddr_sysinfo = { .bi_on = 1, /* Bank interleaving enabled */ /* war 1 */ .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; /* MT41K128M16JT-125 */ diff --git a/board/barco/platinum/spl_picon.c b/board/barco/platinum/spl_picon.c index 098542f..ec57cf1 100644 --- a/board/barco/platinum/spl_picon.c +++ b/board/barco/platinum/spl_picon.c @@ -138,6 +138,8 @@ static void spl_dram_init(int width) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; mx6sdl_dram_iocfg(width, &mx6sdl_ddr_ioregs, &mx6sdl_grp_ioregs); diff --git a/board/barco/platinum/spl_titanium.c b/board/barco/platinum/spl_titanium.c index a3a4255..d1ba85a 100644 --- a/board/barco/platinum/spl_titanium.c +++ b/board/barco/platinum/spl_titanium.c @@ -141,6 +141,8 @@ static void spl_dram_init(int width) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; mx6dq_dram_iocfg(width, &mx6dq_ddr_ioregs, &mx6dq_grp_ioregs); diff --git a/board/cadence/xtfpga/Kconfig b/board/cadence/xtfpga/Kconfig new file mode 100644 index 0000000..69296be --- /dev/null +++ b/board/cadence/xtfpga/Kconfig @@ -0,0 +1,39 @@ +if TARGET_XTFPGA + +choice + prompt "XTFPGA board type select" + +config XTFPGA_LX60 + bool "Support Avnet LX60" +config XTFPGA_LX110 + bool "Support Avnet LX110" +config XTFPGA_LX200 + bool "Support Avnet LX200" +config XTFPGA_ML605 + bool "Support Xilinx ML605" +config XTFPGA_KC705 + bool "Support Xilinx KC705" + +endchoice + +config SYS_BOARD + string + default "xtfpga" + +config SYS_VENDOR + string + default "cadence" + +config SYS_CONFIG_NAME + string + default "xtfpga" + +config BOARD_SDRAM_SIZE + hex + default 0x04000000 if XTFPGA_LX60 + default 0x03000000 if XTFPGA_LX110 + default 0x06000000 if XTFPGA_LX200 + default 0x18000000 if XTFPGA_ML605 + default 0x38000000 if XTFPGA_KC705 + +endif diff --git a/board/cadence/xtfpga/MAINTAINERS b/board/cadence/xtfpga/MAINTAINERS new file mode 100644 index 0000000..f4a2b94 --- /dev/null +++ b/board/cadence/xtfpga/MAINTAINERS @@ -0,0 +1,7 @@ +XTFPGA BOARD +M: Max Filippov <jcmvbkbc@gmail.com> +S: Maintained +F: board/cadence/xtfpga/ +F: include/configs/xtfpga.h +F: configs/xtfpga_defconfig +F: drivers/sysreset/sysreset_xtfpga.c diff --git a/board/cadence/xtfpga/Makefile b/board/cadence/xtfpga/Makefile new file mode 100644 index 0000000..fd8f720 --- /dev/null +++ b/board/cadence/xtfpga/Makefile @@ -0,0 +1,7 @@ +# +# (C) Copyright 2007 - 2013, Tensilica Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ${BOARD}.o diff --git a/board/cadence/xtfpga/README b/board/cadence/xtfpga/README new file mode 100644 index 0000000..5f29e25 --- /dev/null +++ b/board/cadence/xtfpga/README @@ -0,0 +1,125 @@ + Tensilica 'xtfpga' Evaluation Boards + ==================================== + +Tensilica's 'xtfpga' evaluation boards are actually a set of different +boards that share configurations. The following is a list of supported +hardware by this board type: + +- XT-AV60 / LX60 +- XT-AV110 / LX110 +- XT-AV200 / LX200 +- ML605 +- KC705 + +All boards provide the following common configurations: + +- An Xtensa or Diamond processor core. +- An on-chip-debug (OCD) JTAG interface. +- A 16550 compatible UART and serial port. +- An OpenCores Wishbone 10/100-base-T ethernet interface. +- A 32 char two line LCD display. (except for the LX200) + +LX60/LX110/LX200: + +- Virtex-4 (XC4VLX60 / XCV4LX200) / Virtext-5 (XC5VLX110) +- 128MB / 64MB (LX60) memory +- 16MB / 4MB (LX60) Linear Flash + +ML605 + +- Virtex-6 (XC6VLX240T) +- 512MB DDR3 memory +- 16MB Linear BPI Flash + +KC705 (Xilinx) + +- Kintex-7 XC7K325T FPGA +- 1GB DDR3 memory +- 128MB Linear BPI Flash + + +Setting up the Board +-------------------- + +The serial port defaults to 115200 baud, no parity and 1 stop bit. +A terminal emulator must be set accordingly to see the U-Boot prompt. + + +Board Configurations LX60/LX110/LX200/ML605/KC705 +------------------------------------------------- + +The LX60/LX110/LX200/ML605 contain an 8-way DIP switch that controls +the boot mapping and selects from a range of default ethernet MAC +addresses. + +Boot Mapping (DIP switch 8): + + DIP switch 8 maps the system ROM address space (in which the + reset vector resides) to either SRAM (off, 0, down) or Flash + (on, 1, up). This mapping is implemented in the FPGA bitstream + and cannot be disabled by software, therefore DIP switch 8 is no + available for application use. Note DIP switch 7 is reserved by + Tensilica for future possible hardware use. + + Mapping to SRAM allows U-Boot to be debugged with an OCD/JTAG + tool such as the Xtensa OCD Daemon connected via a suppored probe. + See the tools documentation for supported probes and how to + connect them. Be aware that the board has only 128 KB of SRAM, + therefore U-Boot must fit within this space to debug an image + intended for the Flash. This issues is discussed in a separate + section toward the end. + + Mapping to flash allows U-Boot to start on reset, provided it + has been programmed into the first two 64 KB sectors of the Flash. + + The Flash is always mapped at a device (memory mapped I/O) address + (the address is board specific and is expressed as CFG_FLASH_BASE). + The device address is used by U-Boot to program the flash, and may + be used to specify an application to run or U-Boot image to boot. + +Default MAC Address (DIP switches 1-6): + + When the board is first powered on, or after the environment has + been reinitialized, the ethernet MAC address receives a default + value whose least significant 6 bits come from DIP switches 1-6. + The default is 00:50:C2:13:6F:xx where xx ranges from 0..3F + according to the DIP switches, where "on"==1 and "off"==0, and + switch 1 is the least-significant bit. + + After initial startup, the MAC address is stored in the U-Boot + environment variable 'ethaddr'. The user may change this to any + other address with the "setenv" comamnd. After the environment + has been saved to Flash by the "saveenv" command, this will be + used and the DIP switches no longer consulted. DIP swithes 1-6 + may then be used for application purposes. + +The KC705 board contains 4-way DIP switch, way 1 is the boot mapping +switch and ways 2-4 control the low three bits of the MAC address. + + +Limitation of SDRAM Size for OCD Debugging on the LX60 +------------------------------------------------------ + +The XT-AV60 board has only 128 KB of SDRAM that can be mapped +to the system ROM address space for debugging a ROM image under +OCD/JTAG. This limits the useful size of U-Boot to 128 KB (0x20000) +or the first 2 sectors of the flash. + +This can pose a problem if all the sources are compiled with -O0 +for debugging. The code size is then too large, in which case it +would be necessary to temporarily alter the linker script to place +the load addresses (LMA) in the RAM (VMA) so that OCD loads U-Boot +directly there and does not unpack. In practice this is not really +necessary as long as only a limited set of sources need to be +debugged, because the image can still fit into the 128 KB SRAM. + +The recommended procedure for debugging is to first build U-Boot +with the default optimization level (-Os), and then touch and +rebuild incrementally with -O0 so that only the touched sources +are recompiled with -O0. To build with -O0, pass it in the KCFLAGS +variable to make. + +Because this problem is easy to fall into and difficult to debug +if one doesn't expect it, the linker script provides a link-time +check and fatal error message if the image size exceeds 128 KB. + diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c new file mode 100644 index 0000000..5899aa6 --- /dev/null +++ b/board/cadence/xtfpga/xtfpga.c @@ -0,0 +1,115 @@ +/* + * (C) Copyright 2007 - 2013 Tensilica Inc. + * (C) Copyright 2014 - 2016 Cadence Design Systems Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <command.h> +#include <dm/platdata.h> +#include <dm/platform_data/net_ethoc.h> +#include <linux/ctype.h> +#include <linux/string.h> +#include <linux/stringify.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* + * Check board idendity. + * (Print information about the board to stdout.) + */ + + +#if defined(CONFIG_XTFPGA_LX60) +const char *board = "XT_AV60"; +const char *description = "Avnet Xilinx LX60 FPGA Evaluation Board / "; +#elif defined(CONFIG_XTFPGA_LX110) +const char *board = "XT_AV110"; +const char *description = "Avnet Xilinx Virtex-5 LX110 Evaluation Kit / "; +#elif defined(CONFIG_XTFPGA_LX200) +const char *board = "XT_AV200"; +const char *description = "Avnet Xilinx Virtex-4 LX200 Evaluation Kit / "; +#elif defined(CONFIG_XTFPGA_ML605) +const char *board = "XT_ML605"; +const char *description = "Xilinx Virtex-6 FPGA ML605 Evaluation Kit / "; +#elif defined(CONFIG_XTFPGA_KC705) +const char *board = "XT_KC705"; +const char *description = "Xilinx Kintex-7 FPGA KC705 Evaluation Kit / "; +#else +const char *board = "<unknown>"; +const char *description = ""; +#endif + +int checkboard(void) +{ + printf("Board: %s: %sTensilica bitstream\n", board, description); + return 0; +} + +void dram_init_banksize(void) +{ + gd->bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE); + gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; +} + +int board_postclk_init(void) +{ + /* + * Obtain CPU clock frequency from board and cache in global + * data structure (Hz). Return 0 on success (OK to continue), + * else non-zero (hang). + */ + +#ifdef CONFIG_SYS_FPGAREG_FREQ + gd->cpu_clk = (*(volatile unsigned long *)CONFIG_SYS_FPGAREG_FREQ); +#else + /* early Tensilica bitstreams lack this reg, but most run at 50 MHz */ + gd->cpu_clk = 50000000UL; +#endif + return 0; +} + +/* + * Miscellaneous late initializations. + * The environment has been set up, so we can set the Ethernet address. + */ + +int misc_init_r(void) +{ +#ifdef CONFIG_CMD_NET + /* + * Initialize ethernet environment variables and board info. + * Default MAC address comes from CONFIG_ETHADDR + DIP switches 1-6. + */ + + char *s = getenv("ethaddr"); + if (s == 0) { + unsigned int x; + char s[] = __stringify(CONFIG_ETHBASE); + x = (*(volatile u32 *)CONFIG_SYS_FPGAREG_DIPSW) + & FPGAREG_MAC_MASK; + sprintf(&s[15], "%02x", x); + setenv("ethaddr", s); + } +#endif /* CONFIG_CMD_NET */ + + return 0; +} + +U_BOOT_DEVICE(sysreset) = { + .name = "xtfpga_sysreset", +}; + +static struct ethoc_eth_pdata ethoc_pdata = { + .eth_pdata = { + .iobase = CONFIG_SYS_ETHOC_BASE, + }, + .packet_base = CONFIG_SYS_ETHOC_BUFFER_ADDR, +}; + +U_BOOT_DEVICE(ethoc) = { + .name = "ethoc", + .platdata = ðoc_pdata, +}; diff --git a/board/ccv/xpress/spl.c b/board/ccv/xpress/spl.c index d15b842..bea837d 100644 --- a/board/ccv/xpress/spl.c +++ b/board/ccv/xpress/spl.c @@ -60,6 +60,8 @@ struct mx6_ddr_sysinfo ddr_sysinfo = { .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static struct mx6_ddr3_cfg mem_ddr = { diff --git a/board/cei/cei-tk1-som/Kconfig b/board/cei/cei-tk1-som/Kconfig new file mode 100644 index 0000000..5fcb51f --- /dev/null +++ b/board/cei/cei-tk1-som/Kconfig @@ -0,0 +1,12 @@ +if TARGET_CEI_TK1_SOM + +config SYS_BOARD + default "cei-tk1-som" + +config SYS_VENDOR + default "cei" + +config SYS_CONFIG_NAME + default "cei-tk1-som" + +endif diff --git a/board/cei/cei-tk1-som/MAINTAINERS b/board/cei/cei-tk1-som/MAINTAINERS new file mode 100644 index 0000000..192e1a3 --- /dev/null +++ b/board/cei/cei-tk1-som/MAINTAINERS @@ -0,0 +1,6 @@ +TK1-SOM BOARD +M: Peter.Chubb@data61.csiro.au +S: Maintained +F: board/cei/tk1-som/ +F: include/configs/cei-tk1-som.h +F: configs/cei-tk1-som_defconfig diff --git a/board/cei/cei-tk1-som/Makefile b/board/cei/cei-tk1-som/Makefile new file mode 100644 index 0000000..127b104 --- /dev/null +++ b/board/cei/cei-tk1-som/Makefile @@ -0,0 +1,9 @@ +# +# (C) Copyright 2014 +# NVIDIA Corporation <www.nvidia.com> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ../../nvidia/venice2/as3722_init.o +obj-y += cei-tk1-som.o diff --git a/board/cei/cei-tk1-som/cei-tk1-som.c b/board/cei/cei-tk1-som/cei-tk1-som.c new file mode 100644 index 0000000..9ba7490 --- /dev/null +++ b/board/cei/cei-tk1-som/cei-tk1-som.c @@ -0,0 +1,65 @@ +/* + * (C) Copyright 2014 + * NVIDIA Corporation <www.nvidia.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <power/as3722.h> + +#include <asm/arch/gpio.h> +#include <asm/arch/pinmux.h> + +#include "pinmux-config-cei-tk1-som.h" + +DECLARE_GLOBAL_DATA_PTR; + +/* + * Routine: pinmux_init + * Description: Do individual peripheral pinmux configs + */ +void pinmux_init(void) +{ + pinmux_clear_tristate_input_clamping(); + + gpio_config_table(cei_tk1_som_gpio_inits, + ARRAY_SIZE(cei_tk1_som_gpio_inits)); + + pinmux_config_pingrp_table(cei_tk1_som_pingrps, + ARRAY_SIZE(cei_tk1_som_pingrps)); + + pinmux_config_drvgrp_table(cei_tk1_som_drvgrps, + ARRAY_SIZE(cei_tk1_som_drvgrps)); + + pinmux_config_mipipadctrlgrp_table(cei_tk1_som_mipipadctrlgrps, + ARRAY_SIZE(cei_tk1_som_mipipadctrlgrps)); +} + +#ifdef CONFIG_PCI_TEGRA +int tegra_pcie_board_init(void) +{ + struct udevice *pmic; + int err; + + err = as3722_init(&pmic); + if (err) { + error("failed to initialize AS3722 PMIC: %d\n", err); + return err; + } + + err = as3722_sd_enable(pmic, 4); + if (err < 0) { + error("failed to enable SD4: %d\n", err); + return err; + } + + err = as3722_sd_set_voltage(pmic, 4, 0x24); + if (err < 0) { + error("failed to set SD4 voltage: %d\n", err); + return err; + } + + return 0; +} +#endif /* PCI */ diff --git a/board/cei/cei-tk1-som/pinmux-config-cei-tk1-som.h b/board/cei/cei-tk1-som/pinmux-config-cei-tk1-som.h new file mode 100644 index 0000000..3431bfe --- /dev/null +++ b/board/cei/cei-tk1-som/pinmux-config-cei-tk1-som.h @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* + * THIS FILE IS AUTO-GENERATED - DO NOT EDIT! + * + * To generate this file, use the tegra-pinmux-scripts tool available from + * https://github.com/NVIDIA/tegra-pinmux-scripts + * Run "board-to-uboot.py cei-tk1-som". + */ + +#ifndef _PINMUX_CONFIG_CEI_TK1_SOM_H_ +#define _PINMUX_CONFIG_CEI_TK1_SOM_H_ + +#define GPIO_INIT(_port, _gpio, _init) \ + { \ + .gpio = TEGRA_GPIO(_port, _gpio), \ + .init = TEGRA_GPIO_INIT_##_init, \ + } + +static const struct tegra_gpio_config cei_tk1_som_gpio_inits[] = { + /* port, pin, init_val */ + GPIO_INIT(G, 0, IN), + GPIO_INIT(G, 1, IN), + GPIO_INIT(G, 2, IN), + GPIO_INIT(G, 3, IN), + GPIO_INIT(G, 4, IN), + GPIO_INIT(H, 4, IN), + GPIO_INIT(H, 7, IN), + GPIO_INIT(I, 0, OUT0), + GPIO_INIT(I, 1, IN), + GPIO_INIT(I, 3, IN), + GPIO_INIT(I, 6, IN), + GPIO_INIT(J, 0, IN), + GPIO_INIT(J, 2, IN), + GPIO_INIT(K, 2, IN), + GPIO_INIT(K, 6, OUT0), + GPIO_INIT(N, 7, IN), + GPIO_INIT(O, 1, IN), + GPIO_INIT(O, 4, IN), + GPIO_INIT(Q, 0, IN), + GPIO_INIT(Q, 3, IN), + GPIO_INIT(R, 0, IN), + GPIO_INIT(R, 2, OUT0), + GPIO_INIT(R, 4, IN), + GPIO_INIT(R, 6, IN), + GPIO_INIT(S, 2, IN), + GPIO_INIT(S, 3, IN), + GPIO_INIT(S, 4, IN), + GPIO_INIT(S, 5, IN), + GPIO_INIT(S, 6, IN), + GPIO_INIT(S, 7, IN), + GPIO_INIT(T, 0, IN), + GPIO_INIT(T, 1, IN), + GPIO_INIT(V, 0, IN), + GPIO_INIT(V, 1, IN), + GPIO_INIT(X, 1, IN), + GPIO_INIT(X, 4, IN), + GPIO_INIT(BB, 3, OUT0), + GPIO_INIT(BB, 6, OUT0), + GPIO_INIT(BB, 7, OUT0), + GPIO_INIT(CC, 1, IN), + GPIO_INIT(CC, 2, IN), +}; + +#define PINCFG(_pingrp, _mux, _pull, _tri, _io, _od, _rcv_sel) \ + { \ + .pingrp = PMUX_PINGRP_##_pingrp, \ + .func = PMUX_FUNC_##_mux, \ + .pull = PMUX_PULL_##_pull, \ + .tristate = PMUX_TRI_##_tri, \ + .io = PMUX_PIN_##_io, \ + .od = PMUX_PIN_OD_##_od, \ + .rcv_sel = PMUX_PIN_RCV_SEL_##_rcv_sel, \ + .lock = PMUX_PIN_LOCK_DEFAULT, \ + .ioreset = PMUX_PIN_IO_RESET_DEFAULT, \ + } + +static const struct pmux_pingrp_config cei_tk1_som_pingrps[] = { + /* pingrp, mux, pull, tri, e_input, od, rcv_sel */ + PINCFG(CLK_32K_OUT_PA0, SOC, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(UART3_CTS_N_PA1, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP2_FS_PA2, I2S1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP2_SCLK_PA3, I2S1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP2_DIN_PA4, I2S1, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(DAP2_DOUT_PA5, I2S1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_CLK_PA6, SDMMC3, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_CMD_PA7, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PB0, UARTD, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PB1, UARTD, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_DAT3_PB4, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_DAT2_PB5, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_DAT1_PB6, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_DAT0_PB7, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(UART3_RTS_N_PC0, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(UART2_TXD_PC2, IRDA, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(UART2_RXD_PC3, IRDA, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(GEN1_I2C_SCL_PC4, I2C1, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(GEN1_I2C_SDA_PC5, I2C1, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(PC7, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PG0, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PG1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PG2, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PG3, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PG4, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PG5, SPI4, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PG6, SPI4, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PG7, SPI4, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PH0, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH1, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH2, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH3, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH4, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PH5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH6, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PH7, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PI0, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PI1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PI2, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PI3, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PI4, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PI5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PI6, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PI7, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PJ0, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PJ2, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(UART2_CTS_N_PJ5, UARTB, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(UART2_RTS_N_PJ6, UARTB, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PJ7, UARTD, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PK0, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PK1, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PK2, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PK3, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PK4, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SPDIF_OUT_PK5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SPDIF_IN_PK6, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PK7, UARTD, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP1_FS_PN0, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP1_DIN_PN1, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP1_DOUT_PN2, I2S0, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP1_SCLK_PN3, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(USB_VBUS_EN0_PN4, USB, NORMAL, NORMAL, INPUT, DISABLE, DEFAULT), + PINCFG(USB_VBUS_EN1_PN5, USB, NORMAL, NORMAL, INPUT, DISABLE, DEFAULT), + PINCFG(HDMI_INT_PN7, DEFAULT, DOWN, TRISTATE, INPUT, DEFAULT, NORMAL), + PINCFG(ULPI_DATA7_PO0, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA0_PO1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA1_PO2, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA2_PO3, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA3_PO4, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA4_PO5, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA5_PO6, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DATA6_PO7, ULPI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP3_FS_PP0, I2S2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP3_DIN_PP1, I2S2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP3_DOUT_PP2, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP3_SCLK_PP3, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP4_FS_PP4, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP4_DIN_PP5, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP4_DOUT_PP6, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP4_SCLK_PP7, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL0_PQ0, DEFAULT, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL1_PQ1, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL2_PQ2, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL3_PQ3, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL4_PQ4, KBC, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL5_PQ5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL6_PQ6, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_COL7_PQ7, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW0_PR0, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW1_PR1, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW2_PR2, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW3_PR3, KBC, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW4_PR4, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW5_PR5, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW6_PR6, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW7_PR7, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW8_PS0, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW9_PS1, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW10_PS2, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW11_PS3, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW12_PS4, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW13_PS5, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW14_PS6, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW15_PS7, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW16_PT0, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(KB_ROW17_PT1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(GEN2_I2C_SCL_PT5, I2C2, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(GEN2_I2C_SDA_PT6, I2C2, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(SDMMC4_CMD_PT7, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PU0, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU1, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU2, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU3, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU4, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU5, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PU6, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PV0, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PV1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_CD_N_PV2, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_WP_N_PV3, SDMMC1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DDC_SCL_PV4, I2C4, NORMAL, NORMAL, INPUT, DEFAULT, NORMAL), + PINCFG(DDC_SDA_PV5, I2C4, NORMAL, NORMAL, INPUT, DEFAULT, NORMAL), + PINCFG(GPIO_W2_AUD_PW2, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_W3_AUD_PW3, SPI6, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP_MCLK1_PW4, EXTPERIPH1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(CLK2_OUT_PW5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(UART3_TXD_PW6, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(UART3_RXD_PW7, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DVFS_PWM_PX0, CLDVFS, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X1_AUD_PX1, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(DVFS_CLK_PX2, CLDVFS, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X3_AUD_PX3, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X4_AUD_PX4, DEFAULT, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X5_AUD_PX5, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X6_AUD_PX6, GMI, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(GPIO_X7_AUD_PX7, RSVD1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_CLK_PY0, SPI1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_DIR_PY1, SPI1, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_NXT_PY2, SPI1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(ULPI_STP_PY3, SPI1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_DAT3_PY4, SDMMC1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_DAT2_PY5, SDMMC1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_DAT1_PY6, SDMMC1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_DAT0_PY7, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_CLK_PZ0, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC1_CMD_PZ1, SDMMC1, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PWR_I2C_SCL_PZ6, I2CPWR, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(PWR_I2C_SDA_PZ7, I2CPWR, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(SDMMC4_DAT0_PAA0, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT1_PAA1, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT2_PAA2, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT3_PAA3, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT4_PAA4, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT5_PAA5, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT6_PAA6, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_DAT7_PAA7, SDMMC4, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PBB0, VIMCLK2_ALT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(CAM_I2C_SCL_PBB1, I2C3, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(CAM_I2C_SDA_PBB2, I2C3, NORMAL, NORMAL, INPUT, ENABLE, DEFAULT), + PINCFG(PBB3, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PBB4, VGP4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PBB5, RSVD3, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PBB6, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PBB7, DEFAULT, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(CAM_MCLK_PCC0, VI_ALT3, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PCC1, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(PCC2, DEFAULT, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC4_CLK_PCC4, SDMMC4, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(CLK2_REQ_PCC5, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PEX_L0_RST_N_PDD1, PE0, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PEX_L0_CLKREQ_N_PDD2, PE0, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PEX_WAKE_N_PDD3, PE, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(PEX_L1_RST_N_PDD5, PE1, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PEX_L1_CLKREQ_N_PDD6, PE1, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(CLK3_OUT_PEE0, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(CLK3_REQ_PEE1, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(DAP_MCLK1_REQ_PEE2, RSVD4, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(HDMI_CEC_PEE3, CEC, NORMAL, NORMAL, INPUT, DISABLE, DEFAULT), + PINCFG(SDMMC3_CLK_LB_OUT_PEE4, SDMMC3, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(SDMMC3_CLK_LB_IN_PEE5, SDMMC3, UP, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(DP_HPD_PFF0, RSVD2, DOWN, TRISTATE, OUTPUT, DEFAULT, DEFAULT), + PINCFG(USB_VBUS_EN2_PFF1, RSVD2, DOWN, TRISTATE, OUTPUT, DISABLE, DEFAULT), + PINCFG(PFF2, RSVD2, DOWN, TRISTATE, OUTPUT, DISABLE, DEFAULT), + PINCFG(CORE_PWR_REQ, PWRON, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(CPU_PWR_REQ, CPU, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT), + PINCFG(PWR_INT_N, PMI, UP, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(RESET_OUT_N, RESET_OUT_N, NORMAL, NORMAL, INPUT, DEFAULT, DEFAULT), + PINCFG(CLK_32K_IN, CLK, NORMAL, TRISTATE, INPUT, DEFAULT, DEFAULT), + PINCFG(JTAG_RTCK, RTCK, UP, NORMAL, OUTPUT, DEFAULT, DEFAULT), +}; + +#define DRVCFG(_drvgrp, _slwf, _slwr, _drvup, _drvdn, _lpmd, _schmt, _hsm) \ + { \ + .drvgrp = PMUX_DRVGRP_##_drvgrp, \ + .slwf = _slwf, \ + .slwr = _slwr, \ + .drvup = _drvup, \ + .drvdn = _drvdn, \ + .lpmd = PMUX_LPMD_##_lpmd, \ + .schmt = PMUX_SCHMT_##_schmt, \ + .hsm = PMUX_HSM_##_hsm, \ + } + +static const struct pmux_drvgrp_config cei_tk1_som_drvgrps[] = { +}; + +#define MIPIPADCTRLCFG(_grp, _mux) \ + { \ + .grp = PMUX_MIPIPADCTRLGRP_##_grp, \ + .func = PMUX_FUNC_##_mux, \ + } + +static const struct pmux_mipipadctrlgrp_config cei_tk1_som_mipipadctrlgrps[] = { + /* grp, mux */ + MIPIPADCTRLCFG(DSI_B, DSI_B), +}; + +#endif /* PINMUX_CONFIG_CEI_TK1_SOM_H */ diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 566c19b..28e9a8f 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -588,7 +588,7 @@ struct node_info nodes[] = { /* * Both entries target the same flash chip. The st,m25p compatible * is used in the vendor device trees, while upstream uses (the - * documented) jedec,spi-nor comptatible. + * documented) jedec,spi-nor compatible. */ { "st,m25p", MTD_DEV_TYPE_NOR, }, { "jedec,spi-nor", MTD_DEV_TYPE_NOR, }, @@ -616,6 +616,8 @@ int ft_board_setup(void *blob, bd_t *bd) enetaddr, 6, 1); } + fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); + baseboard_rev = cl_eeprom_get_board_rev(0); err = cl_eeprom_get_product_name((uchar *)baseboard_name, 0); if (err || baseboard_rev == 0) @@ -630,8 +632,6 @@ int ft_board_setup(void *blob, bd_t *bd) NULL, 0, 1); } - fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); - return 0; } #endif diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c index d8328fd..9442d09 100644 --- a/board/compulab/cm_fx6/spl.c +++ b/board/compulab/cm_fx6/spl.c @@ -107,6 +107,8 @@ static struct mx6_ddr_sysinfo cm_fx6_sysinfo_s = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static struct mx6_ddr3_cfg cm_fx6_ddr3_cfg_s = { @@ -174,6 +176,8 @@ static struct mx6_ddr_sysinfo cm_fx6_sysinfo_q = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static struct mx6_ddr3_cfg cm_fx6_ddr3_cfg_q = { diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c index 3fbd3d2..a4a6029 100644 --- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c +++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c @@ -1037,6 +1037,8 @@ static void spl_dram_init(int width) .bi_on = 1, .sde_to_rst = 0x0d, .rst_to_cke = 0x20, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; if (is_cpu_type(MXC_CPU_MX6Q) && is_2gb()) { diff --git a/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS b/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS index 5a4d4dc..3d7e8e2 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS +++ b/board/congatec/conga-qeval20-qa3-e3845/MAINTAINERS @@ -4,4 +4,5 @@ S: Maintained F: board/congatec/conga-qeval20-qa3-e3845 F: include/configs/conga-qeval20-qa3-e3845.h F: configs/conga-qeval20-qa3-e3845_defconfig +F: configs/conga-qeval20-qa3-e3845-internal-uart_defconfig F: arch/x86/dts/conga-qeval20-qa3-e3845.dts diff --git a/board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c b/board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c index 737e610..7a5b765 100644 --- a/board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c +++ b/board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <i2c.h> #include <winbond_w83627.h> #include <asm/gpio.h> #include <asm/ibmpc.h> @@ -31,3 +32,42 @@ int arch_early_init_r(void) { return 0; } + +int board_late_init(void) +{ + struct udevice *dev; + u8 buf[8]; + int ret; + + /* Configure SMSC USB2513 USB Hub: 7bit address 0x2c */ + ret = i2c_get_chip_for_busnum(0, 0x2c, 1, &dev); + if (ret) { + printf("Cannot find USB2513: %d\n", ret); + return 0; + } + + /* + * The first access to the USB Hub fails sometimes, so lets read + * a dummy byte to be sure here + */ + dm_i2c_read(dev, 0x00, buf, 1); + + /* + * The SMSC hub is not visible on the I2C bus after the first + * configuration at power-up. The following code deliberately + * does not report upon failure of these I2C write calls. + */ + buf[0] = 0x93; + dm_i2c_write(dev, 0x06, buf, 1); + + buf[0] = 0xaa; + dm_i2c_write(dev, 0xf8, buf, 1); + + buf[0] = 0x0f; + dm_i2c_write(dev, 0xfa, buf, 1); + + buf[0] = 0x01; + dm_i2c_write(dev, 0xff, buf, 1); + + return 0; +} diff --git a/board/dfi/Kconfig b/board/dfi/Kconfig new file mode 100644 index 0000000..25d0a11 --- /dev/null +++ b/board/dfi/Kconfig @@ -0,0 +1,29 @@ +# +# Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +if VENDOR_DFI + +choice + prompt "Mainboard model" + optional + +config TARGET_DFI_BT700 + bool "DFI BT700 BayTrail" + help + This is the DFI Q7X-151 baseboard equipped with the + DFI BayTrail Bt700 SoM. It contains an Atom E3845 with + Ethernet (in non-PCIe-x4 configuration), micro-SD, USB 2, + USB 3, SATA, serial console and DisplayPort video out. + It requires some binary blobs - see README.x86 for details. + + Note that PCIE_ECAM_BASE is set up by the FSP so the value used + by U-Boot matches that value. + +endchoice + +source "board/dfi/dfi-bt700/Kconfig" + +endif diff --git a/board/dfi/dfi-bt700/Kconfig b/board/dfi/dfi-bt700/Kconfig new file mode 100644 index 0000000..3f0acb3 --- /dev/null +++ b/board/dfi/dfi-bt700/Kconfig @@ -0,0 +1,28 @@ +if TARGET_DFI_BT700 + +config SYS_BOARD + default "dfi-bt700" + +config SYS_VENDOR + default "dfi" + +config SYS_SOC + default "baytrail" + +config SYS_CONFIG_NAME + default "dfi-bt700" + +config SYS_TEXT_BASE + default 0xfff00000 if !EFI_STUB + default 0x01110000 if EFI_STUB + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + select X86_RESET_VECTOR if !EFI_STUB + select INTEL_BAYTRAIL + select BOARD_ROMSIZE_KB_8192 + +config PCIE_ECAM_BASE + default 0xe0000000 + +endif diff --git a/board/dfi/dfi-bt700/MAINTAINERS b/board/dfi/dfi-bt700/MAINTAINERS new file mode 100644 index 0000000..6639787 --- /dev/null +++ b/board/dfi/dfi-bt700/MAINTAINERS @@ -0,0 +1,10 @@ +congatec DFI-BT700 +M: Stefan Roese <sr@denx.de> +S: Maintained +F: board/dfi/dfi-bt700 +F: include/configs/dfi-bt700.h +F: configs/dfi-bt700-q7x-151_defconfig +F: configs/theadorable-x86-dfi-bt700_defconfig +F: arch/x86/dts/dfi-bt700.dtsi +F: arch/x86/dts/dfi-bt700-q7x-151.dts +F: arch/x86/dts/theadorable-x86-dfi-bt700.dts diff --git a/board/dfi/dfi-bt700/Makefile b/board/dfi/dfi-bt700/Makefile new file mode 100644 index 0000000..8052f5e --- /dev/null +++ b/board/dfi/dfi-bt700/Makefile @@ -0,0 +1,8 @@ +# +# Copyright (C) 2015, Google, Inc +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += dfi-bt700.o start.o +obj-$(CONFIG_GENERATE_ACPI_TABLE) += dsdt.o diff --git a/board/dfi/dfi-bt700/acpi/mainboard.asl b/board/dfi/dfi-bt700/acpi/mainboard.asl new file mode 100644 index 0000000..544a049 --- /dev/null +++ b/board/dfi/dfi-bt700/acpi/mainboard.asl @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/* Power Button */ +Device (PWRB) +{ + Name(_HID, EISAID("PNP0C0C")) +} + +/* TODO: Need add Nuvoton SuperIO chipset NCT6102D ASL codes */ diff --git a/board/dfi/dfi-bt700/dfi-bt700.c b/board/dfi/dfi-bt700/dfi-bt700.c new file mode 100644 index 0000000..8645bdc --- /dev/null +++ b/board/dfi/dfi-bt700/dfi-bt700.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2016 Stefan Roese <sr@denx.de> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <nuvoton_nct6102d.h> +#include <asm/gpio.h> +#include <asm/ibmpc.h> +#include <asm/pnp_def.h> + +int board_early_init_f(void) +{ +#ifdef CONFIG_INTERNAL_UART + /* Disable the legacy UART which is enabled per default */ + nct6102d_uarta_disable(); +#else + /* + * The FSP enables the BayTrail internal legacy UART (again). + * Disable it again, so that the Nuvoton one can be used. + */ + setup_internal_uart(0); +#endif + + /* Disable the watchdog which is enabled per default */ + nct6102d_wdt_disable(); + + return 0; +} diff --git a/board/dfi/dfi-bt700/dsdt.asl b/board/dfi/dfi-bt700/dsdt.asl new file mode 100644 index 0000000..6042011 --- /dev/null +++ b/board/dfi/dfi-bt700/dsdt.asl @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +DefinitionBlock("dsdt.aml", "DSDT", 2, "U-BOOT", "U-BOOTBL", 0x00010000) +{ + /* platform specific */ + #include <asm/arch/acpi/platform.asl> + + /* board specific */ + #include "acpi/mainboard.asl" +} diff --git a/board/dfi/dfi-bt700/start.S b/board/dfi/dfi-bt700/start.S new file mode 100644 index 0000000..2c941a4 --- /dev/null +++ b/board/dfi/dfi-bt700/start.S @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2015, Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +.globl early_board_init +early_board_init: + jmp early_board_init_ret diff --git a/board/el/el6x/el6x.c b/board/el/el6x/el6x.c index 3b0fb32..7856b84 100644 --- a/board/el/el6x/el6x.c +++ b/board/el/el6x/el6x.c @@ -604,6 +604,8 @@ static void spl_dram_init(void) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; mx6dq_dram_iocfg(64, &mx6_ddr_ioregs, &mx6_grp_ioregs); diff --git a/board/emulation/qemu-x86/MAINTAINERS b/board/emulation/qemu-x86/MAINTAINERS index ea4dd19..54dc2c5 100644 --- a/board/emulation/qemu-x86/MAINTAINERS +++ b/board/emulation/qemu-x86/MAINTAINERS @@ -4,3 +4,5 @@ S: Maintained F: board/emulation/qemu-x86/ F: include/configs/qemu-x86.h F: configs/qemu-x86_defconfig +F: configs/qemu-x86_efi_payload32_defconfig +F: configs/qemu-x86_efi_payload64_defconfig diff --git a/board/freescale/common/arm_sleep.c b/board/freescale/common/arm_sleep.c index 71ed15e..16fd445 100644 --- a/board/freescale/common/arm_sleep.c +++ b/board/freescale/common/arm_sleep.c @@ -66,6 +66,36 @@ static void dp_ddr_restore(void) *dst++ = *src++; } +#if defined(CONFIG_ARMV7_PSCI) && defined(CONFIG_LS102XA) +void ls1_psci_resume_fixup(void) +{ + u32 tmp; + struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; + +#ifdef QIXIS_BASE + void *qixis_base = (void *)QIXIS_BASE; + + /* Pull on PCIe RST# */ + out_8(qixis_base + QIXIS_RST_FORCE_3, 0); + + /* disable deep sleep signals in FPGA */ + tmp = in_8(qixis_base + QIXIS_PWR_CTL2); + tmp &= ~QIXIS_PWR_CTL2_PCTL; + out_8(qixis_base + QIXIS_PWR_CTL2, tmp); +#endif + + /* Disable wakeup interrupt during deep sleep */ + out_be32(&scfg->pmcintecr, 0); + /* Clear PMC interrupt status */ + out_be32(&scfg->pmcintsr, 0xffffffff); + + /* Disable Warm Device Reset */ + tmp = in_be32(&scfg->dpslpcr); + tmp &= ~SCFG_DPSLPCR_WDRR_EN; + out_be32(&scfg->dpslpcr, tmp); +} +#endif + static void dp_resume_prepare(void) { dp_ddr_restore(); @@ -74,6 +104,9 @@ static void dp_resume_prepare(void) #ifdef CONFIG_U_QE u_qe_resume(); #endif +#if defined(CONFIG_ARMV7_PSCI) && defined(CONFIG_LS102XA) + ls1_psci_resume_fixup(); +#endif } int fsl_dp_resume(void) @@ -88,7 +121,7 @@ int fsl_dp_resume(void) dp_resume_prepare(); /* Get the entry address and jump to kernel */ - start_addr = in_le32(&scfg->sparecr[1]); + start_addr = in_le32(&scfg->sparecr[3]); debug("Entry address is 0x%08x\n", start_addr); kernel_resume = (void (*)(void))start_addr; secure_ram_addr(_do_nonsec_entry)(kernel_resume, 0, 0, 0); diff --git a/board/freescale/common/ns_access.c b/board/freescale/common/ns_access.c index d8d16c5..81c9211 100644 --- a/board/freescale/common/ns_access.c +++ b/board/freescale/common/ns_access.c @@ -8,29 +8,63 @@ #include <asm/io.h> #include <fsl_csu.h> #include <asm/arch/ns_access.h> +#include <asm/arch/fsl_serdes.h> -static void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num) +void set_devices_ns_access(struct csu_ns_dev *ns_dev, u16 val) { u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR; u32 *reg; - uint32_t val; - int i; + uint32_t tmp; - for (i = 0; i < num; i++) { - reg = base + ns_dev[i].ind / 2; - val = in_be32(reg); - if (ns_dev[i].ind % 2 == 0) { - val &= 0x0000ffff; - val |= ns_dev[i].val << 16; - } else { - val &= 0xffff0000; - val |= ns_dev[i].val; - } - out_be32(reg, val); + reg = base + ns_dev->ind / 2; + tmp = in_be32(reg); + if (ns_dev->ind % 2 == 0) { + tmp &= 0x0000ffff; + tmp |= val << 16; + } else { + tmp &= 0xffff0000; + tmp |= val; } + + out_be32(reg, tmp); +} + +static void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num) +{ + int i; + + for (i = 0; i < num; i++) + set_devices_ns_access(ns_dev + i, ns_dev[i].val); } void enable_layerscape_ns_access(void) { enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev)); } + +void set_pcie_ns_access(int pcie, u16 val) +{ + switch (pcie) { +#ifdef CONFIG_PCIE1 + case PCIE1: + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE1], val); + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE1_IO], val); + return; +#endif +#ifdef CONFIG_PCIE2 + case PCIE2: + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE2], val); + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE2_IO], val); + return; +#endif +#ifdef CONFIG_PCIE3 + case PCIE3: + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE3], val); + set_devices_ns_access(&ns_dev[CSU_CSLX_PCIE3_IO], val); + return; +#endif + default: + debug("The PCIE%d doesn't exist!\n", pcie); + return; + } +} diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c index 2f29795..1a50304 100644 --- a/board/freescale/common/vid.c +++ b/board/freescale/common/vid.c @@ -8,7 +8,7 @@ #include <command.h> #include <i2c.h> #include <asm/io.h> -#ifdef CONFIG_LS1043A +#ifdef CONFIG_FSL_LSCH2 #include <asm/arch/immap_lsch2.h> #elif defined(CONFIG_FSL_LSCH3) #include <asm/arch/immap_lsch3.h> @@ -247,7 +247,7 @@ static int set_voltage_to_IR(int i2caddress, int vdd) * SoC before converting into an IR VID value */ vdd += board_vdd_drop_compensation(); -#ifdef CONFIG_LS1043A +#ifdef CONFIG_FSL_LSCH2 vid = DIV_ROUND_UP(vdd - 265, 5); #else vid = DIV_ROUND_UP(vdd - 245, 5); @@ -287,7 +287,7 @@ static int set_voltage(int i2caddress, int vdd) int adjust_vdd(ulong vdd_override) { int re_enable = disable_interrupts(); -#if defined(CONFIG_LS1043A) || defined(CONFIG_FSL_LSCH3) +#if defined(CONFIG_FSL_LSCH2) || defined(CONFIG_FSL_LSCH3) struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); #else ccsr_gur_t __iomem *gur = @@ -386,7 +386,7 @@ int adjust_vdd(ulong vdd_override) * | T | | | | | * ------------------------------------------------------ */ -#ifdef CONFIG_LS1043A +#ifdef CONFIG_FSL_LSCH2 vid = (fusesr >> FSL_CHASSIS2_DCFG_FUSESR_ALTVID_SHIFT) & FSL_CHASSIS2_DCFG_FUSESR_ALTVID_MASK; if ((vid == 0) || (vid == FSL_CHASSIS2_DCFG_FUSESR_ALTVID_MASK)) { diff --git a/board/freescale/ls1012afrdm/ls1012afrdm.c b/board/freescale/ls1012afrdm/ls1012afrdm.c index a94a458..d644e94 100644 --- a/board/freescale/ls1012afrdm/ls1012afrdm.c +++ b/board/freescale/ls1012afrdm/ls1012afrdm.c @@ -11,27 +11,12 @@ #include <asm/arch/fsl_serdes.h> #include <asm/arch/soc.h> #include <hwconfig.h> -#include <fsl_csu.h> #include <environment.h> #include <fsl_mmdc.h> #include <netdev.h> DECLARE_GLOBAL_DATA_PTR; -static void set_wait_for_bits_clear(void *ptr, u32 value, u32 bits) -{ - int timeout = 1000; - - out_be32(ptr, value); - - while (in_be32(ptr) & bits) { - udelay(100); - timeout--; - } - if (timeout <= 0) - puts("Error: wait for clear timeout.\n"); -} - int checkboard(void) { puts("Board: LS1012AFRDM "); @@ -39,108 +24,6 @@ int checkboard(void) return 0; } -void mmdc_init(void) -{ - struct mmdc_p_regs *mmdc = - (struct mmdc_p_regs *)CONFIG_SYS_FSL_DDR_ADDR; - - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - /* configure timing parms */ - out_be32(&mmdc->mdotc, CONFIG_SYS_MMDC_CORE_ODT_TIMING); - out_be32(&mmdc->mdcfg0, CONFIG_SYS_MMDC_CORE_TIMING_CFG_0); - out_be32(&mmdc->mdcfg1, CONFIG_SYS_MMDC_CORE_TIMING_CFG_1); - out_be32(&mmdc->mdcfg2, CONFIG_SYS_MMDC_CORE_TIMING_CFG_2); - - /* other parms */ - out_be32(&mmdc->mdmisc, CONFIG_SYS_MMDC_CORE_MISC); - out_be32(&mmdc->mpmur0, CONFIG_SYS_MMDC_PHY_MEASURE_UNIT); - out_be32(&mmdc->mdrwd, CONFIG_SYS_MMDC_CORE_RDWR_CMD_DELAY); - out_be32(&mmdc->mpodtctrl, CONFIG_SYS_MMDC_PHY_ODT_CTRL); - - /* out of reset delays */ - out_be32(&mmdc->mdor, CONFIG_SYS_MMDC_CORE_OUT_OF_RESET_DELAY); - - /* physical parms */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_1); - out_be32(&mmdc->mdasp, CONFIG_SYS_MMDC_CORE_ADDR_PARTITION); - - /* Enable MMDC */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_2); - - /* dram init sequence: update MRs */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x8) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_2)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x19) | - CMD_ADDR_LSB_MR_ADDR(0x30) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_0)); - - /* dram init sequence: ZQCL */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_ZQ_CALIBRATION | CMD_BANK_ADDR_0)); - set_wait_for_bits_clear(&mmdc->mpzqhwctrl, - CONFIG_SYS_MMDC_PHY_ZQ_HW_CTRL, - FORCE_ZQ_AUTO_CALIBRATION); - - /* Calibrations now: wr lvl */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x84) | - CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | WL_EN | CMD_NORMAL)); - set_wait_for_bits_clear(&mmdc->mpwlgcr, WR_LVL_HW_EN, WR_LVL_HW_EN); - - mdelay(1); - - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - mdelay(1); - - /* Calibrations now: Read DQS gating calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - out_be32(&mmdc->mprddlctl, CONFIG_SYS_MMDC_PHY_RD_DLY_LINES_CFG); - set_wait_for_bits_clear(&mmdc->mpdgctrl0, - AUTO_RD_DQS_GATING_CALIBRATION_EN, - AUTO_RD_DQS_GATING_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* Calibrations now: Read calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - set_wait_for_bits_clear(&mmdc->mprddlhwctl, - AUTO_RD_CALIBRATION_EN, - AUTO_RD_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* PD, SR */ - out_be32(&mmdc->mdpdc, CONFIG_SYS_MMDC_CORE_PWR_DOWN_CTRL); - out_be32(&mmdc->mapsr, CONFIG_SYS_MMDC_CORE_PWR_SAV_CTRL_STAT); - - /* refresh scheme */ - set_wait_for_bits_clear(&mmdc->mdref, - CONFIG_SYS_MMDC_CORE_REFRESH_CTL, - START_REFRESH); - - /* disable CON_REQ */ - out_be32(&mmdc->mdscr, DISABLE_CFG_REQ); -} - int dram_init(void) { mmdc_init(); @@ -175,10 +58,6 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0]; #endif -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - return 0; } diff --git a/board/freescale/ls1012aqds/ls1012aqds.c b/board/freescale/ls1012aqds/ls1012aqds.c index 71eea82..188b6bc 100644 --- a/board/freescale/ls1012aqds/ls1012aqds.c +++ b/board/freescale/ls1012aqds/ls1012aqds.c @@ -17,7 +17,6 @@ #include <mmc.h> #include <scsi.h> #include <fm_eth.h> -#include <fsl_csu.h> #include <fsl_esdhc.h> #include <fsl_mmdc.h> #include <spl.h> @@ -28,20 +27,6 @@ DECLARE_GLOBAL_DATA_PTR; -static void set_wait_for_bits_clear(void *ptr, u32 value, u32 bits) -{ - int timeout = 1000; - - out_be32(ptr, value); - - while (in_be32(ptr) & bits) { - udelay(100); - timeout--; - } - if (timeout <= 0) - puts("Error: wait for clear timeout.\n"); -} - int checkboard(void) { char buf[64]; @@ -67,108 +52,6 @@ int checkboard(void) return 0; } -void mmdc_init(void) -{ - struct mmdc_p_regs *mmdc = - (struct mmdc_p_regs *)CONFIG_SYS_FSL_DDR_ADDR; - - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - /* configure timing parms */ - out_be32(&mmdc->mdotc, CONFIG_SYS_MMDC_CORE_ODT_TIMING); - out_be32(&mmdc->mdcfg0, CONFIG_SYS_MMDC_CORE_TIMING_CFG_0); - out_be32(&mmdc->mdcfg1, CONFIG_SYS_MMDC_CORE_TIMING_CFG_1); - out_be32(&mmdc->mdcfg2, CONFIG_SYS_MMDC_CORE_TIMING_CFG_2); - - /* other parms */ - out_be32(&mmdc->mdmisc, CONFIG_SYS_MMDC_CORE_MISC); - out_be32(&mmdc->mpmur0, CONFIG_SYS_MMDC_PHY_MEASURE_UNIT); - out_be32(&mmdc->mdrwd, CONFIG_SYS_MMDC_CORE_RDWR_CMD_DELAY); - out_be32(&mmdc->mpodtctrl, CONFIG_SYS_MMDC_PHY_ODT_CTRL); - - /* out of reset delays */ - out_be32(&mmdc->mdor, CONFIG_SYS_MMDC_CORE_OUT_OF_RESET_DELAY); - - /* physical parms */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_1); - out_be32(&mmdc->mdasp, CONFIG_SYS_MMDC_CORE_ADDR_PARTITION); - - /* Enable MMDC */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_2); - - /* dram init sequence: update MRs */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x8) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_2)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x19) | - CMD_ADDR_LSB_MR_ADDR(0x30) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_0)); - - /* dram init sequence: ZQCL */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_ZQ_CALIBRATION | CMD_BANK_ADDR_0)); - set_wait_for_bits_clear(&mmdc->mpzqhwctrl, - CONFIG_SYS_MMDC_PHY_ZQ_HW_CTRL, - FORCE_ZQ_AUTO_CALIBRATION); - - /* Calibrations now: wr lvl */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x84) | - CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | WL_EN | CMD_NORMAL)); - set_wait_for_bits_clear(&mmdc->mpwlgcr, WR_LVL_HW_EN, WR_LVL_HW_EN); - - mdelay(1); - - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - mdelay(1); - - /* Calibrations now: Read DQS gating calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - out_be32(&mmdc->mprddlctl, CONFIG_SYS_MMDC_PHY_RD_DLY_LINES_CFG); - set_wait_for_bits_clear(&mmdc->mpdgctrl0, - AUTO_RD_DQS_GATING_CALIBRATION_EN, - AUTO_RD_DQS_GATING_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* Calibrations now: Read calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - set_wait_for_bits_clear(&mmdc->mprddlhwctl, - AUTO_RD_CALIBRATION_EN, - AUTO_RD_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* PD, SR */ - out_be32(&mmdc->mdpdc, CONFIG_SYS_MMDC_CORE_PWR_DOWN_CTRL); - out_be32(&mmdc->mapsr, CONFIG_SYS_MMDC_CORE_PWR_SAV_CTRL_STAT); - - /* refresh scheme */ - set_wait_for_bits_clear(&mmdc->mdref, - CONFIG_SYS_MMDC_CORE_REFRESH_CTL, - START_REFRESH); - - /* disable CON_REQ */ - out_be32(&mmdc->mdscr, DISABLE_CFG_REQ); -} - int dram_init(void) { mmdc_init(); @@ -207,8 +90,8 @@ int board_init(void) out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER); -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); #endif #ifdef CONFIG_ENV_IS_NOWHERE diff --git a/board/freescale/ls1012ardb/ls1012ardb.c b/board/freescale/ls1012ardb/ls1012ardb.c index f69768d..50f9187 100644 --- a/board/freescale/ls1012ardb/ls1012ardb.c +++ b/board/freescale/ls1012ardb/ls1012ardb.c @@ -14,7 +14,6 @@ #include <ahci.h> #include <mmc.h> #include <scsi.h> -#include <fsl_csu.h> #include <fsl_esdhc.h> #include <environment.h> #include <fsl_mmdc.h> @@ -22,20 +21,6 @@ DECLARE_GLOBAL_DATA_PTR; -static void set_wait_for_bits_clear(void *ptr, u32 value, u32 bits) -{ - int timeout = 1000; - - out_be32(ptr, value); - - while (in_be32(ptr) & bits) { - udelay(100); - timeout--; - } - if (timeout <= 0) - puts("Error: wait for clear timeout.\n"); -} - int checkboard(void) { u8 in1; @@ -71,108 +56,6 @@ int checkboard(void) return 0; } -void mmdc_init(void) -{ - struct mmdc_p_regs *mmdc = - (struct mmdc_p_regs *)CONFIG_SYS_FSL_DDR_ADDR; - - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - /* configure timing parms */ - out_be32(&mmdc->mdotc, CONFIG_SYS_MMDC_CORE_ODT_TIMING); - out_be32(&mmdc->mdcfg0, CONFIG_SYS_MMDC_CORE_TIMING_CFG_0); - out_be32(&mmdc->mdcfg1, CONFIG_SYS_MMDC_CORE_TIMING_CFG_1); - out_be32(&mmdc->mdcfg2, CONFIG_SYS_MMDC_CORE_TIMING_CFG_2); - - /* other parms */ - out_be32(&mmdc->mdmisc, CONFIG_SYS_MMDC_CORE_MISC); - out_be32(&mmdc->mpmur0, CONFIG_SYS_MMDC_PHY_MEASURE_UNIT); - out_be32(&mmdc->mdrwd, CONFIG_SYS_MMDC_CORE_RDWR_CMD_DELAY); - out_be32(&mmdc->mpodtctrl, CONFIG_SYS_MMDC_PHY_ODT_CTRL); - - /* out of reset delays */ - out_be32(&mmdc->mdor, CONFIG_SYS_MMDC_CORE_OUT_OF_RESET_DELAY); - - /* physical parms */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_1); - out_be32(&mmdc->mdasp, CONFIG_SYS_MMDC_CORE_ADDR_PARTITION); - - /* Enable MMDC */ - out_be32(&mmdc->mdctl, CONFIG_SYS_MMDC_CORE_CONTROL_2); - - /* dram init sequence: update MRs */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x8) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_2)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x19) | - CMD_ADDR_LSB_MR_ADDR(0x30) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_0)); - - /* dram init sequence: ZQCL */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_ZQ_CALIBRATION | CMD_BANK_ADDR_0)); - set_wait_for_bits_clear(&mmdc->mpzqhwctrl, - CONFIG_SYS_MMDC_PHY_ZQ_HW_CTRL, - FORCE_ZQ_AUTO_CALIBRATION); - - /* Calibrations now: wr lvl */ - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x84) | - CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | WL_EN | CMD_NORMAL)); - set_wait_for_bits_clear(&mmdc->mpwlgcr, WR_LVL_HW_EN, WR_LVL_HW_EN); - - mdelay(1); - - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_1)); - out_be32(&mmdc->mdscr, CONFIGURATION_REQ); - - mdelay(1); - - /* Calibrations now: Read DQS gating calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - out_be32(&mmdc->mprddlctl, CONFIG_SYS_MMDC_PHY_RD_DLY_LINES_CFG); - set_wait_for_bits_clear(&mmdc->mpdgctrl0, - AUTO_RD_DQS_GATING_CALIBRATION_EN, - AUTO_RD_DQS_GATING_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* Calibrations now: Read calibration */ - out_be32(&mmdc->mdscr, (CMD_ADDR_MSB_MR_OP(0x4) | CONFIGURATION_REQ | - CMD_PRECHARGE_BANK_OPEN | CMD_BANK_ADDR_0)); - out_be32(&mmdc->mdscr, (CMD_ADDR_LSB_MR_ADDR(0x4) | CONFIGURATION_REQ | - CMD_LOAD_MODE_REG | CMD_BANK_ADDR_3)); - out_be32(&mmdc->mppdcmpr2, MPR_COMPARE_EN); - set_wait_for_bits_clear(&mmdc->mprddlhwctl, - AUTO_RD_CALIBRATION_EN, - AUTO_RD_CALIBRATION_EN); - - out_be32(&mmdc->mdscr, (CONFIGURATION_REQ | CMD_LOAD_MODE_REG | - CMD_BANK_ADDR_3)); - - /* PD, SR */ - out_be32(&mmdc->mdpdc, CONFIG_SYS_MMDC_CORE_PWR_DOWN_CTRL); - out_be32(&mmdc->mapsr, CONFIG_SYS_MMDC_CORE_PWR_SAV_CTRL_STAT); - - /* refresh scheme */ - set_wait_for_bits_clear(&mmdc->mdref, - CONFIG_SYS_MMDC_CORE_REFRESH_CTL, - START_REFRESH); - - /* disable CON_REQ */ - out_be32(&mmdc->mdscr, DISABLE_CFG_REQ); -} - int dram_init(void) { mmdc_init(); @@ -203,12 +86,12 @@ int board_init(void) */ out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER); -#ifdef CONFIG_ENV_IS_NOWHERE - gd->env_addr = (ulong)&default_environment[0]; +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); #endif -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); +#ifdef CONFIG_ENV_IS_NOWHERE + gd->env_addr = (ulong)&default_environment[0]; #endif return 0; diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index dbea0bf..4eb38a7 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -430,6 +430,10 @@ int board_init(void) struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; unsigned int major; +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); +#endif + major = get_soc_major_rev(); if (major == SOC_MAJOR_VER_1_0) { /* Set CCI-400 control override register to @@ -446,10 +450,6 @@ int board_init(void) ls102xa_smmu_stream_id_init(); -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - #ifdef CONFIG_U_QE u_qe_init(); #endif diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index 77482a9..d96fd77 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -142,7 +142,7 @@ int checkboard(void) void ddrmc_init(void) { struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR; - u32 temp_sdram_cfg; + u32 temp_sdram_cfg, tmp; out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG); @@ -189,6 +189,11 @@ void ddrmc_init(void) out_be32(&ddr->ddr_zq_cntl, DDR_DDR_ZQ_CNTL); out_be32(&ddr->cs0_config_2, DDR_CS0_CONFIG_2); + + /* DDR erratum A-009942 */ + tmp = in_be32(&ddr->debug[28]); + out_be32(&ddr->debug[28], tmp | 0x0070006f); + udelay(1); #ifdef CONFIG_DEEP_SLEEP @@ -480,6 +485,10 @@ void ls1twr_program_regulator(void) int board_init(void) { +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); +#endif + #ifndef CONFIG_SYS_FSL_NO_SERDES fsl_serdes_init(); #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) @@ -489,10 +498,6 @@ int board_init(void) ls102xa_smmu_stream_id_init(); -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif - #ifdef CONFIG_U_QE u_qe_init(); #endif diff --git a/board/freescale/ls1043aqds/ls1043aqds.c b/board/freescale/ls1043aqds/ls1043aqds.c index 941dfbc..8835a49 100644 --- a/board/freescale/ls1043aqds/ls1043aqds.c +++ b/board/freescale/ls1043aqds/ls1043aqds.c @@ -17,7 +17,6 @@ #include <mmc.h> #include <scsi.h> #include <fm_eth.h> -#include <fsl_csu.h> #include <fsl_esdhc.h> #include <fsl_ifc.h> #include <spl.h> @@ -309,6 +308,10 @@ int misc_init_r(void) int board_init(void) { +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); +#endif + select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); board_retimer_init(); @@ -316,9 +319,6 @@ int board_init(void) config_serdes_mux(); #endif -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); -#endif return 0; } diff --git a/board/freescale/ls1043ardb/ls1043ardb.c b/board/freescale/ls1043ardb/ls1043ardb.c index d3e37b4..e213128 100644 --- a/board/freescale/ls1043ardb/ls1043ardb.c +++ b/board/freescale/ls1043ardb/ls1043ardb.c @@ -16,7 +16,6 @@ #include <mmc.h> #include <scsi.h> #include <fm_eth.h> -#include <fsl_csu.h> #include <fsl_esdhc.h> #include <fsl_ifc.h> #include <fsl_sec.h> @@ -86,12 +85,29 @@ int board_init(void) { struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 + erratum_a010315(); +#endif + #ifdef CONFIG_FSL_IFC init_final_memctl_regs(); #endif -#ifdef CONFIG_LAYERSCAPE_NS_ACCESS - enable_layerscape_ns_access(); +#ifdef CONFIG_SECURE_BOOT + /* In case of Secure Boot, the IBR configures the SMMU + * to allow only Secure transactions. + * SMMU must be reset in bypass mode. + * Set the ClientPD bit and Clear the USFCFG Bit + */ + u32 val; + val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK); + out_le32(SMMU_SCR0, val); + val = (in_le32(SMMU_NSCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK); + out_le32(SMMU_NSCR0, val); +#endif + +#ifdef CONFIG_FSL_CAAM + sec_init(); #endif #ifdef CONFIG_FSL_LS_PPA @@ -137,21 +153,6 @@ int config_board_mux(void) int misc_init_r(void) { config_board_mux(); -#ifdef CONFIG_SECURE_BOOT - /* In case of Secure Boot, the IBR configures the SMMU - * to allow only Secure transactions. - * SMMU must be reset in bypass mode. - * Set the ClientPD bit and Clear the USFCFG Bit - */ - u32 val; - val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK); - out_le32(SMMU_SCR0, val); - val = (in_le32(SMMU_NSCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK); - out_le32(SMMU_NSCR0, val); -#endif -#ifdef CONFIG_FSL_CAAM - return sec_init(); -#endif return 0; } #endif diff --git a/board/freescale/ls1046aqds/Kconfig b/board/freescale/ls1046aqds/Kconfig new file mode 100644 index 0000000..723f4ba --- /dev/null +++ b/board/freescale/ls1046aqds/Kconfig @@ -0,0 +1,15 @@ +if TARGET_LS1046AQDS + +config SYS_BOARD + default "ls1046aqds" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "fsl-layerscape" + +config SYS_CONFIG_NAME + default "ls1046aqds" + +endif diff --git a/board/freescale/ls1046aqds/MAINTAINERS b/board/freescale/ls1046aqds/MAINTAINERS new file mode 100644 index 0000000..b4549ae --- /dev/null +++ b/board/freescale/ls1046aqds/MAINTAINERS @@ -0,0 +1,10 @@ +LS1046AQDS BOARD +M: Mingkai Hu <Mingkai.Hu@nxp.com> +S: Maintained +F: board/freescale/ls1046aqds/ +F: include/configs/ls1046aqds.h +F: configs/ls1046aqds_defconfig +F: configs/ls1046aqds_nand_defconfig +F: configs/ls1046aqds_sdcard_ifc_defconfig +F: configs/ls1046aqds_sdcard_qspi_defconfig +F: configs/ls1046aqds_qspi_defconfig diff --git a/board/freescale/ls1046aqds/Makefile b/board/freescale/ls1046aqds/Makefile new file mode 100644 index 0000000..df6e546 --- /dev/null +++ b/board/freescale/ls1046aqds/Makefile @@ -0,0 +1,9 @@ +# +# Copyright 2016 Freescale Semiconductor, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += ddr.o +obj-y += eth.o +obj-y += ls1046aqds.o diff --git a/board/freescale/ls1046aqds/README b/board/freescale/ls1046aqds/README new file mode 100644 index 0000000..b8fa326 --- /dev/null +++ b/board/freescale/ls1046aqds/README @@ -0,0 +1,70 @@ +Overview +-------- +The LS1046A Development System (QDS) is a high-performance computing, +evaluation, and development platform that supports the QorIQ LS1046A +LayerScape Architecture processor. The LS1046AQDS provides SW development +platform for the Freescale LS1046A processor series, with a complete +debugging environment. + +LS1046A SoC Overview +-------------------- +Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS1046A +SoC overview. + + LS1046AQDS board Overview + ----------------------- + - SERDES Connections, 8 lanes supporting: + - PCI Express - 3.0 + - SGMII, SGMII 2.5 + - QSGMII + - SATA 3.0 + - XFI + - DDR Controller + - 8GB 64bits DDR4 SDRAM. Support rates of up to 2133MT/s + -IFC/Local Bus + - One in-socket 128 MB NOR flash 16-bit data bus + - One 512 MB NAND flash with ECC support + - PromJet Port + - FPGA connection + - USB 3.0 + - Three high speed USB 3.0 ports + - First USB 3.0 port configured as Host with Type-A connector + - The other two USB 3.0 ports configured as OTG with micro-AB connector + - SDHC port connects directly to an adapter card slot, featuring: + - Optional clock feedback paths, and optional high-speed voltage translation assistance + - SD slots for SD, SDHC (1x, 4x, 8x), and/or MMC + - eMMC memory devices + - DSPI: Onboard support for three SPI flash memory devices + - 4 I2C controllers + - One SATA onboard connectors + - UART + - Two 4-pin serial ports at up to 115.2 Kbit/s + - Two DB9 D-Type connectors supporting one Serial port each + - ARM JTAG support + +Memory map from core's view +---------------------------- +Start Address End Address Description Size +0x00_0000_0000 - 0x00_000F_FFFF Secure Boot ROM 1MB +0x00_0100_0000 - 0x00_0FFF_FFFF CCSRBAR 240MB +0x00_1000_0000 - 0x00_1000_FFFF OCRAM0 64KB +0x00_1001_0000 - 0x00_1001_FFFF OCRAM1 64KB +0x00_2000_0000 - 0x00_20FF_FFFF DCSR 16MB +0x00_6000_0000 - 0x00_67FF_FFFF IFC - NOR Flash 128MB +0x00_7E80_0000 - 0x00_7E80_FFFF IFC - NAND Flash 64KB +0x00_7FB0_0000 - 0x00_7FB0_0FFF IFC - FPGA 4KB +0x00_8000_0000 - 0x00_FFFF_FFFF DRAM1 2GB +0x05_0000_0000 - 0x05_07FF_FFFF QMAN S/W Portal 128M +0x05_0800_0000 - 0x05_0FFF_FFFF BMAN S/W Portal 128M +0x08_8000_0000 - 0x09_FFFF_FFFF DRAM2 6GB +0x40_0000_0000 - 0x47_FFFF_FFFF PCI Express1 32G +0x48_0000_0000 - 0x4F_FFFF_FFFF PCI Express2 32G +0x50_0000_0000 - 0x57_FFFF_FFFF PCI Express3 32G + +Booting Options +--------------- +a) Promjet Boot +b) NOR boot +c) NAND boot +d) SD boot +e) QSPI boot diff --git a/board/freescale/ls1046aqds/ddr.c b/board/freescale/ls1046aqds/ddr.c new file mode 100644 index 0000000..d813965 --- /dev/null +++ b/board/freescale/ls1046aqds/ddr.c @@ -0,0 +1,140 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <fsl_ddr_sdram.h> +#include <fsl_ddr_dimm_params.h> +#ifdef CONFIG_FSL_DEEP_SLEEP +#include <fsl_sleep.h> +#endif +#include "ddr.h" + +DECLARE_GLOBAL_DATA_PTR; + +void fsl_ddr_board_options(memctl_options_t *popts, + dimm_params_t *pdimm, + unsigned int ctrl_num) +{ + const struct board_specific_parameters *pbsp, *pbsp_highest = NULL; + ulong ddr_freq; + + if (ctrl_num > 3) { + printf("Not supported controller number %d\n", ctrl_num); + return; + } + if (!pdimm->n_ranks) + return; + + pbsp = udimms[0]; + + /* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr + * freqency and n_banks specified in board_specific_parameters table. + */ + ddr_freq = get_ddr_freq(0) / 1000000; + while (pbsp->datarate_mhz_high) { + if (pbsp->n_ranks == pdimm->n_ranks) { + if (ddr_freq <= pbsp->datarate_mhz_high) { + popts->clk_adjust = pbsp->clk_adjust; + popts->wrlvl_start = pbsp->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + goto found; + } + pbsp_highest = pbsp; + } + pbsp++; + } + + if (pbsp_highest) { + printf("Error: board specific timing not found for %lu MT/s\n", + ddr_freq); + printf("Trying to use the highest speed (%u) parameters\n", + pbsp_highest->datarate_mhz_high); + popts->clk_adjust = pbsp_highest->clk_adjust; + popts->wrlvl_start = pbsp_highest->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + } else { + panic("DIMM is not supported by this board"); + } +found: + debug("Found timing match: n_ranks %d, data rate %d, rank_gb %d\n", + pbsp->n_ranks, pbsp->datarate_mhz_high, pbsp->rank_gb); + + popts->data_bus_width = 0; /* 64b data bus */ + popts->otf_burst_chop_en = 0; + popts->burst_length = DDR_BL8; + popts->bstopre = 0; /* enable auto precharge */ + + popts->half_strength_driver_enable = 0; + /* + * Write leveling override + */ + popts->wrlvl_override = 1; + popts->wrlvl_sample = 0xf; + + /* + * Rtt and Rtt_WR override + */ + popts->rtt_override = 0; + + /* Enable ZQ calibration */ + popts->zq_en = 1; + + popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_80ohm); + popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_80ohm) | + DDR_CDR2_VREF_TRAIN_EN | DDR_CDR2_VREF_RANGE_2; +} + +phys_size_t initdram(int board_type) +{ + phys_size_t dram_size; + +#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) + return fsl_ddr_sdram_size(); +#else + puts("Initializing DDR....using SPD\n"); + + dram_size = fsl_ddr_sdram(); +#endif + +#ifdef CONFIG_FSL_DEEP_SLEEP + fsl_dp_ddr_restore(); +#endif + + erratum_a008850_post(); + + return dram_size; +} + +void dram_init_banksize(void) +{ + /* + * gd->arch.secure_ram tracks the location of secure memory. + * It was set as if the memory starts from 0. + * The address needs to add the offset of its bank. + */ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) { + gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE; + gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE; + gd->bd->bi_dram[1].size = gd->ram_size - + CONFIG_SYS_DDR_BLOCK1_SIZE; +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + gd->arch.secure_ram = gd->bd->bi_dram[1].start + + gd->arch.secure_ram - + CONFIG_SYS_DDR_BLOCK1_SIZE; + gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED; +#endif + } else { + gd->bd->bi_dram[0].size = gd->ram_size; +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + gd->arch.secure_ram = gd->bd->bi_dram[0].start + + gd->arch.secure_ram; + gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED; +#endif + } +} diff --git a/board/freescale/ls1046aqds/ddr.h b/board/freescale/ls1046aqds/ddr.h new file mode 100644 index 0000000..b594032 --- /dev/null +++ b/board/freescale/ls1046aqds/ddr.h @@ -0,0 +1,44 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __DDR_H__ +#define __DDR_H__ + +void erratum_a008850_post(void); + +struct board_specific_parameters { + u32 n_ranks; + u32 datarate_mhz_high; + u32 rank_gb; + u32 clk_adjust; + u32 wrlvl_start; + u32 wrlvl_ctl_2; + u32 wrlvl_ctl_3; +}; + +/* + * These tables contain all valid speeds we want to override with board + * specific parameters. datarate_mhz_high values need to be in ascending order + * for each n_ranks group. + */ +static const struct board_specific_parameters udimm0[] = { + /* + * memory controller 0 + * num| hi| rank| clk| wrlvl | wrlvl | wrlvl | + * ranks| mhz| GB |adjst| start | ctl2 | ctl3 | + */ + {2, 1350, 0, 8, 6, 0x0708090B, 0x0C0D0E09,}, + {2, 1666, 0, 8, 7, 0x08090A0C, 0x0D0F100B,}, + {2, 1900, 0, 8, 7, 0x09090B0D, 0x0E10120B,}, + {2, 2300, 0, 8, 9, 0x0A0C0D11, 0x1214150E,}, + {} +}; + +static const struct board_specific_parameters *udimms[] = { + udimm0, +}; + +#endif diff --git a/board/freescale/ls1046aqds/eth.c b/board/freescale/ls1046aqds/eth.c new file mode 100644 index 0000000..046db11 --- /dev/null +++ b/board/freescale/ls1046aqds/eth.c @@ -0,0 +1,415 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <asm/io.h> +#include <netdev.h> +#include <fdt_support.h> +#include <fm_eth.h> +#include <fsl_mdio.h> +#include <fsl_dtsec.h> +#include <malloc.h> +#include <asm/arch/fsl_serdes.h> + +#include "../common/qixis.h" +#include "../common/fman.h" +#include "ls1046aqds_qixis.h" + +#define EMI_NONE 0xFF +#define EMI1_RGMII1 0 +#define EMI1_RGMII2 1 +#define EMI1_SLOT1 2 +#define EMI1_SLOT2 3 +#define EMI1_SLOT4 4 + +static int mdio_mux[NUM_FM_PORTS]; + +static const char * const mdio_names[] = { + "LS1046AQDS_MDIO_RGMII1", + "LS1046AQDS_MDIO_RGMII2", + "LS1046AQDS_MDIO_SLOT1", + "LS1046AQDS_MDIO_SLOT2", + "LS1046AQDS_MDIO_SLOT4", + "NULL", +}; + +/* Map SerDes 1 & 2 lanes to default slot. */ +static u8 lane_to_slot[] = {1, 1, 1, 1, 0, 4, 0 , 0}; + +static const char *ls1046aqds_mdio_name_for_muxval(u8 muxval) +{ + return mdio_names[muxval]; +} + +struct mii_dev *mii_dev_for_muxval(u8 muxval) +{ + struct mii_dev *bus; + const char *name; + + if (muxval > EMI1_SLOT4) + return NULL; + + name = ls1046aqds_mdio_name_for_muxval(muxval); + + if (!name) { + printf("No bus for muxval %x\n", muxval); + return NULL; + } + + bus = miiphy_get_dev_by_name(name); + + if (!bus) { + printf("No bus by name %s\n", name); + return NULL; + } + + return bus; +} + +struct ls1046aqds_mdio { + u8 muxval; + struct mii_dev *realbus; +}; + +static void ls1046aqds_mux_mdio(u8 muxval) +{ + u8 brdcfg4; + + if (muxval < 7) { + brdcfg4 = QIXIS_READ(brdcfg[4]); + brdcfg4 &= ~BRDCFG4_EMISEL_MASK; + brdcfg4 |= (muxval << BRDCFG4_EMISEL_SHIFT); + QIXIS_WRITE(brdcfg[4], brdcfg4); + } +} + +static int ls1046aqds_mdio_read(struct mii_dev *bus, int addr, int devad, + int regnum) +{ + struct ls1046aqds_mdio *priv = bus->priv; + + ls1046aqds_mux_mdio(priv->muxval); + + return priv->realbus->read(priv->realbus, addr, devad, regnum); +} + +static int ls1046aqds_mdio_write(struct mii_dev *bus, int addr, int devad, + int regnum, u16 value) +{ + struct ls1046aqds_mdio *priv = bus->priv; + + ls1046aqds_mux_mdio(priv->muxval); + + return priv->realbus->write(priv->realbus, addr, devad, + regnum, value); +} + +static int ls1046aqds_mdio_reset(struct mii_dev *bus) +{ + struct ls1046aqds_mdio *priv = bus->priv; + + return priv->realbus->reset(priv->realbus); +} + +static int ls1046aqds_mdio_init(char *realbusname, u8 muxval) +{ + struct ls1046aqds_mdio *pmdio; + struct mii_dev *bus = mdio_alloc(); + + if (!bus) { + printf("Failed to allocate ls1046aqds MDIO bus\n"); + return -1; + } + + pmdio = malloc(sizeof(*pmdio)); + if (!pmdio) { + printf("Failed to allocate ls1046aqds private data\n"); + free(bus); + return -1; + } + + bus->read = ls1046aqds_mdio_read; + bus->write = ls1046aqds_mdio_write; + bus->reset = ls1046aqds_mdio_reset; + sprintf(bus->name, ls1046aqds_mdio_name_for_muxval(muxval)); + + pmdio->realbus = miiphy_get_dev_by_name(realbusname); + + if (!pmdio->realbus) { + printf("No bus with name %s\n", realbusname); + free(bus); + free(pmdio); + return -1; + } + + pmdio->muxval = muxval; + bus->priv = pmdio; + return mdio_register(bus); +} + +void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr, + enum fm_port port, int offset) +{ + struct fixed_link f_link; + + if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII) { + switch (port) { + case FM1_DTSEC9: + fdt_set_phy_handle(fdt, compat, addr, "sgmii_s1_p1"); + break; + case FM1_DTSEC10: + fdt_set_phy_handle(fdt, compat, addr, "sgmii_s1_p2"); + break; + case FM1_DTSEC5: + fdt_set_phy_handle(fdt, compat, addr, "sgmii_s1_p3"); + break; + case FM1_DTSEC6: + fdt_set_phy_handle(fdt, compat, addr, "sgmii_s1_p4"); + break; + case FM1_DTSEC2: + fdt_set_phy_handle(fdt, compat, addr, "sgmii_s4_p1"); + break; + default: + break; + } + } else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII_2500) { + /* 2.5G SGMII interface */ + f_link.phy_id = cpu_to_fdt32(port); + f_link.duplex = cpu_to_fdt32(1); + f_link.link_speed = cpu_to_fdt32(1000); + f_link.pause = 0; + f_link.asym_pause = 0; + /* no PHY for 2.5G SGMII on QDS */ + fdt_delprop(fdt, offset, "phy-handle"); + fdt_setprop(fdt, offset, "fixed-link", &f_link, sizeof(f_link)); + fdt_setprop_string(fdt, offset, "phy-connection-type", + "sgmii-2500"); + } else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_QSGMII) { + switch (port) { + case FM1_DTSEC1: + fdt_set_phy_handle(fdt, compat, addr, "qsgmii_s2_p4"); + break; + case FM1_DTSEC5: + fdt_set_phy_handle(fdt, compat, addr, "qsgmii_s2_p2"); + break; + case FM1_DTSEC6: + fdt_set_phy_handle(fdt, compat, addr, "qsgmii_s2_p1"); + break; + case FM1_DTSEC10: + fdt_set_phy_handle(fdt, compat, addr, "qsgmii_s2_p3"); + break; + default: + break; + } + fdt_delprop(fdt, offset, "phy-connection-type"); + fdt_setprop_string(fdt, offset, "phy-connection-type", + "qsgmii"); + } else if (fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_XGMII && + (port == FM1_10GEC1 || port == FM1_10GEC2)) { + /* XFI interface */ + f_link.phy_id = cpu_to_fdt32(port); + f_link.duplex = cpu_to_fdt32(1); + f_link.link_speed = cpu_to_fdt32(10000); + f_link.pause = 0; + f_link.asym_pause = 0; + /* no PHY for XFI */ + fdt_delprop(fdt, offset, "phy-handle"); + fdt_setprop(fdt, offset, "fixed-link", &f_link, sizeof(f_link)); + fdt_setprop_string(fdt, offset, "phy-connection-type", "xgmii"); + } +} + +void fdt_fixup_board_enet(void *fdt) +{ + int i; + + for (i = FM1_DTSEC1; i < NUM_FM_PORTS; i++) { + switch (fm_info_get_enet_if(i)) { + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_QSGMII: + switch (mdio_mux[i]) { + case EMI1_SLOT1: + fdt_status_okay_by_alias(fdt, "emi1_slot1"); + break; + case EMI1_SLOT2: + fdt_status_okay_by_alias(fdt, "emi1_slot2"); + break; + case EMI1_SLOT4: + fdt_status_okay_by_alias(fdt, "emi1_slot4"); + break; + default: + break; + } + break; + default: + break; + } + } +} + +int board_eth_init(bd_t *bis) +{ +#ifdef CONFIG_FMAN_ENET + int i, idx, lane, slot, interface; + struct memac_mdio_info dtsec_mdio_info; + struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + u32 srds_s1, srds_s2; + u8 brdcfg12; + + srds_s1 = in_be32(&gur->rcwsr[4]) & + FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK; + srds_s1 >>= FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT; + + srds_s2 = in_be32(&gur->rcwsr[4]) & + FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_MASK; + srds_s2 >>= FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_SHIFT; + + /* Initialize the mdio_mux array so we can recognize empty elements */ + for (i = 0; i < NUM_FM_PORTS; i++) + mdio_mux[i] = EMI_NONE; + + dtsec_mdio_info.regs = + (struct memac_mdio_controller *)CONFIG_SYS_FM1_DTSEC_MDIO_ADDR; + + dtsec_mdio_info.name = DEFAULT_FM_MDIO_NAME; + + /* Register the 1G MDIO bus */ + fm_memac_mdio_init(bis, &dtsec_mdio_info); + + /* Register the muxing front-ends to the MDIO buses */ + ls1046aqds_mdio_init(DEFAULT_FM_MDIO_NAME, EMI1_RGMII1); + ls1046aqds_mdio_init(DEFAULT_FM_MDIO_NAME, EMI1_RGMII2); + ls1046aqds_mdio_init(DEFAULT_FM_MDIO_NAME, EMI1_SLOT1); + ls1046aqds_mdio_init(DEFAULT_FM_MDIO_NAME, EMI1_SLOT2); + ls1046aqds_mdio_init(DEFAULT_FM_MDIO_NAME, EMI1_SLOT4); + + /* Set the two on-board RGMII PHY address */ + fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY1_ADDR); + fm_info_set_phy_address(FM1_DTSEC4, RGMII_PHY2_ADDR); + + switch (srds_s1) { + case 0x3333: + /* SGMII on slot 1, MAC 9 */ + fm_info_set_phy_address(FM1_DTSEC9, SGMII_CARD_PORT1_PHY_ADDR); + case 0x1333: + case 0x2333: + /* SGMII on slot 1, MAC 10 */ + fm_info_set_phy_address(FM1_DTSEC10, SGMII_CARD_PORT2_PHY_ADDR); + case 0x1133: + case 0x2233: + /* SGMII on slot 1, MAC 5/6 */ + fm_info_set_phy_address(FM1_DTSEC5, SGMII_CARD_PORT3_PHY_ADDR); + fm_info_set_phy_address(FM1_DTSEC6, SGMII_CARD_PORT4_PHY_ADDR); + break; + case 0x1040: + case 0x2040: + /* QSGMII on lane B, MAC 6/5/10/1 */ + fm_info_set_phy_address(FM1_DTSEC6, + QSGMII_CARD_PORT1_PHY_ADDR_S2); + fm_info_set_phy_address(FM1_DTSEC5, + QSGMII_CARD_PORT2_PHY_ADDR_S2); + fm_info_set_phy_address(FM1_DTSEC10, + QSGMII_CARD_PORT3_PHY_ADDR_S2); + fm_info_set_phy_address(FM1_DTSEC1, + QSGMII_CARD_PORT4_PHY_ADDR_S2); + break; + case 0x3363: + /* SGMII on slot 1, MAC 9/10 */ + fm_info_set_phy_address(FM1_DTSEC9, SGMII_CARD_PORT1_PHY_ADDR); + fm_info_set_phy_address(FM1_DTSEC10, SGMII_CARD_PORT2_PHY_ADDR); + case 0x1163: + case 0x2263: + case 0x2223: + /* SGMII on slot 1, MAC 6 */ + fm_info_set_phy_address(FM1_DTSEC6, SGMII_CARD_PORT4_PHY_ADDR); + break; + default: + printf("Invalid SerDes protocol 0x%x for LS1046AQDS\n", + srds_s1); + break; + } + + if (srds_s2 == 0x5a59 || srds_s2 == 0x5a06) + /* SGMII on slot 4, MAC 2 */ + fm_info_set_phy_address(FM1_DTSEC2, SGMII_CARD_PORT1_PHY_ADDR); + + for (i = FM1_DTSEC1; i < FM1_DTSEC1 + CONFIG_SYS_NUM_FM1_DTSEC; i++) { + idx = i - FM1_DTSEC1; + interface = fm_info_get_enet_if(i); + switch (interface) { + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_QSGMII: + if (interface == PHY_INTERFACE_MODE_SGMII) { + if (i == FM1_DTSEC5) { + /* route lane 2 to slot1 so to have + * one sgmii riser card supports + * MAC5 and MAC6. + */ + brdcfg12 = QIXIS_READ(brdcfg[12]); + QIXIS_WRITE(brdcfg[12], + brdcfg12 | 0x80); + } + lane = serdes_get_first_lane(FSL_SRDS_1, + SGMII_FM1_DTSEC1 + idx); + } else { + /* clear the bit 7 to route lane B on slot2. */ + brdcfg12 = QIXIS_READ(brdcfg[12]); + QIXIS_WRITE(brdcfg[12], brdcfg12 & 0x7f); + + lane = serdes_get_first_lane(FSL_SRDS_1, + QSGMII_FM1_A); + lane_to_slot[lane] = 2; + } + + if (i == FM1_DTSEC2) + lane = 5; + + if (lane < 0) + break; + + slot = lane_to_slot[lane]; + debug("FM1@DTSEC%u expects SGMII in slot %u\n", + idx + 1, slot); + if (QIXIS_READ(present2) & (1 << (slot - 1))) + fm_disable_port(i); + + switch (slot) { + case 1: + mdio_mux[i] = EMI1_SLOT1; + fm_info_set_mdio(i, mii_dev_for_muxval( + mdio_mux[i])); + break; + case 2: + mdio_mux[i] = EMI1_SLOT2; + fm_info_set_mdio(i, mii_dev_for_muxval( + mdio_mux[i])); + break; + case 4: + mdio_mux[i] = EMI1_SLOT4; + fm_info_set_mdio(i, mii_dev_for_muxval( + mdio_mux[i])); + break; + default: + break; + } + break; + case PHY_INTERFACE_MODE_RGMII: + if (i == FM1_DTSEC3) + mdio_mux[i] = EMI1_RGMII1; + else if (i == FM1_DTSEC4) + mdio_mux[i] = EMI1_RGMII2; + fm_info_set_mdio(i, mii_dev_for_muxval(mdio_mux[i])); + break; + default: + break; + } + } + + cpu_eth_init(bis); +#endif /* CONFIG_FMAN_ENET */ + + return pci_eth_init(bis); +} diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c new file mode 100644 index 0000000..8c18538 --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds.c @@ -0,0 +1,298 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <i2c.h> +#include <fdt_support.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/fsl_serdes.h> +#include <asm/arch/fdt.h> +#include <asm/arch/soc.h> +#include <ahci.h> +#include <hwconfig.h> +#include <mmc.h> +#include <scsi.h> +#include <fm_eth.h> +#include <fsl_csu.h> +#include <fsl_esdhc.h> +#include <fsl_ifc.h> +#include <spl.h> + +#include "../common/vid.h" +#include "../common/qixis.h" +#include "ls1046aqds_qixis.h" + +DECLARE_GLOBAL_DATA_PTR; + +enum { + MUX_TYPE_GPIO, +}; + +int checkboard(void) +{ + char buf[64]; +#ifndef CONFIG_SD_BOOT + u8 sw; +#endif + + puts("Board: LS1046AQDS, boot from "); + +#ifdef CONFIG_SD_BOOT + puts("SD\n"); +#else + sw = QIXIS_READ(brdcfg[0]); + sw = (sw & QIXIS_LBMAP_MASK) >> QIXIS_LBMAP_SHIFT; + + if (sw < 0x8) + printf("vBank: %d\n", sw); + else if (sw == 0x8) + puts("PromJet\n"); + else if (sw == 0x9) + puts("NAND\n"); + else if (sw == 0xF) + printf("QSPI\n"); + else + printf("invalid setting of SW%u\n", QIXIS_LBMAP_SWITCH); +#endif + + printf("Sys ID: 0x%02x, Sys Ver: 0x%02x\n", + QIXIS_READ(id), QIXIS_READ(arch)); + + printf("FPGA: v%d (%s), build %d\n", + (int)QIXIS_READ(scver), qixis_read_tag(buf), + (int)qixis_read_minor()); + + return 0; +} + +bool if_board_diff_clk(void) +{ + u8 diff_conf = QIXIS_READ(brdcfg[11]); + + return diff_conf & 0x40; +} + +unsigned long get_board_sys_clk(void) +{ + u8 sysclk_conf = QIXIS_READ(brdcfg[1]); + + switch (sysclk_conf & 0x0f) { + case QIXIS_SYSCLK_64: + return 64000000; + case QIXIS_SYSCLK_83: + return 83333333; + case QIXIS_SYSCLK_100: + return 100000000; + case QIXIS_SYSCLK_125: + return 125000000; + case QIXIS_SYSCLK_133: + return 133333333; + case QIXIS_SYSCLK_150: + return 150000000; + case QIXIS_SYSCLK_160: + return 160000000; + case QIXIS_SYSCLK_166: + return 166666666; + } + + return 66666666; +} + +unsigned long get_board_ddr_clk(void) +{ + u8 ddrclk_conf = QIXIS_READ(brdcfg[1]); + + if (if_board_diff_clk()) + return get_board_sys_clk(); + switch ((ddrclk_conf & 0x30) >> 4) { + case QIXIS_DDRCLK_100: + return 100000000; + case QIXIS_DDRCLK_125: + return 125000000; + case QIXIS_DDRCLK_133: + return 133333333; + } + + return 66666666; +} + +int select_i2c_ch_pca9547(u8 ch) +{ + int ret; + + ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1); + if (ret) { + puts("PCA: failed to select proper channel\n"); + return ret; + } + + return 0; +} + +int dram_init(void) +{ + /* + * When resuming from deep sleep, the I2C channel may not be + * in the default channel. So, switch to the default channel + * before accessing DDR SPD. + */ + select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); + gd->ram_size = initdram(0); + + return 0; +} + +int i2c_multiplexer_select_vid_channel(u8 channel) +{ + return select_i2c_ch_pca9547(channel); +} + +int board_early_init_f(void) +{ +#ifdef CONFIG_HAS_FSL_XHCI_USB + struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; + u32 usb_pwrfault; +#endif + +#ifdef CONFIG_SYS_I2C_EARLY_INIT + i2c_early_init_f(); +#endif + fsl_lsch2_early_init_f(); + +#ifdef CONFIG_HAS_FSL_XHCI_USB + out_be32(&scfg->rcwpmuxcr0, 0x3333); + out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1); + usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED << + SCFG_USBPWRFAULT_USB3_SHIFT) | + (SCFG_USBPWRFAULT_DEDICATED << + SCFG_USBPWRFAULT_USB2_SHIFT) | + (SCFG_USBPWRFAULT_SHARED << + SCFG_USBPWRFAULT_USB1_SHIFT); + out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault); +#endif + + return 0; +} + +#ifdef CONFIG_FSL_DEEP_SLEEP +/* determine if it is a warm boot */ +bool is_warm_boot(void) +{ +#define DCFG_CCSR_CRSTSR_WDRFR (1 << 3) + struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR; + + if (in_be32(&gur->crstsr) & DCFG_CCSR_CRSTSR_WDRFR) + return 1; + + return 0; +} +#endif + +int config_board_mux(int ctrl_type) +{ + u8 reg14; + + reg14 = QIXIS_READ(brdcfg[14]); + + switch (ctrl_type) { + case MUX_TYPE_GPIO: + reg14 = (reg14 & (~0x6)) | 0x2; + break; + default: + puts("Unsupported mux interface type\n"); + return -1; + } + + QIXIS_WRITE(brdcfg[14], reg14); + + return 0; +} + +int config_serdes_mux(void) +{ + return 0; +} + +#ifdef CONFIG_MISC_INIT_R +int misc_init_r(void) +{ + if (hwconfig("gpio")) + config_board_mux(MUX_TYPE_GPIO); + + return 0; +} +#endif + +int board_init(void) +{ + select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); + +#ifdef CONFIG_SYS_FSL_SERDES + config_serdes_mux(); +#endif + +#ifdef CONFIG_LAYERSCAPE_NS_ACCESS + enable_layerscape_ns_access(); +#endif + + if (adjust_vdd(0)) + printf("Warning: Adjusting core voltage failed.\n"); + + return 0; +} + +#ifdef CONFIG_OF_BOARD_SETUP +int ft_board_setup(void *blob, bd_t *bd) +{ + u64 base[CONFIG_NR_DRAM_BANKS]; + u64 size[CONFIG_NR_DRAM_BANKS]; + u8 reg; + + /* fixup DT for the two DDR banks */ + base[0] = gd->bd->bi_dram[0].start; + size[0] = gd->bd->bi_dram[0].size; + base[1] = gd->bd->bi_dram[1].start; + size[1] = gd->bd->bi_dram[1].size; + + fdt_fixup_memory_banks(blob, base, size, 2); + ft_cpu_setup(blob, bd); + +#ifdef CONFIG_SYS_DPAA_FMAN + fdt_fixup_fman_ethernet(blob); + fdt_fixup_board_enet(blob); +#endif + + reg = QIXIS_READ(brdcfg[0]); + reg = (reg & QIXIS_LBMAP_MASK) >> QIXIS_LBMAP_SHIFT; + + /* Disable IFC if QSPI is enabled */ + if (reg == 0xF) + do_fixup_by_compat(blob, "fsl,ifc", + "status", "disabled", 8 + 1, 1); + + return 0; +} +#endif + +u8 flash_read8(void *addr) +{ + return __raw_readb(addr + 1); +} + +void flash_write16(u16 val, void *addr) +{ + u16 shftval = (((val >> 8) & 0xff) | ((val << 8) & 0xff00)); + + __raw_writew(shftval, addr); +} + +u16 flash_read16(void *addr) +{ + u16 val = __raw_readw(addr); + + return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00); +} diff --git a/board/freescale/ls1046aqds/ls1046aqds_pbi.cfg b/board/freescale/ls1046aqds/ls1046aqds_pbi.cfg new file mode 100644 index 0000000..5a6b7b8 --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds_pbi.cfg @@ -0,0 +1,17 @@ +#Configure Scratch register +09570600 00000000 +09570604 10000000 +#Alt base register +09570158 00001000 +#Disable CCI barrier tranaction +09570178 0000e010 +09180000 00000008 +#USB PHY frequency sel +09570418 0000009e +0957041c 0000009e +09570420 0000009e +#Serdes SATA +09eb1300 80104e20 +09eb08dc 00502880 +#flush PBI data +096100c0 000fffff diff --git a/board/freescale/ls1046aqds/ls1046aqds_qixis.h b/board/freescale/ls1046aqds/ls1046aqds_qixis.h new file mode 100644 index 0000000..58ab132 --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds_qixis.h @@ -0,0 +1,39 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __LS1046AQDS_QIXIS_H__ +#define __LS1046AQDS_QIXIS_H__ + +/* Definitions of QIXIS Registers for LS1046AQDS */ + +/* BRDCFG4[4:7] select EC1 and EC2 as a pair */ +#define BRDCFG4_EMISEL_MASK 0xe0 +#define BRDCFG4_EMISEL_SHIFT 5 + +/* SYSCLK */ +#define QIXIS_SYSCLK_66 0x0 +#define QIXIS_SYSCLK_83 0x1 +#define QIXIS_SYSCLK_100 0x2 +#define QIXIS_SYSCLK_125 0x3 +#define QIXIS_SYSCLK_133 0x4 +#define QIXIS_SYSCLK_150 0x5 +#define QIXIS_SYSCLK_160 0x6 +#define QIXIS_SYSCLK_166 0x7 +#define QIXIS_SYSCLK_64 0x8 + +/* DDRCLK */ +#define QIXIS_DDRCLK_66 0x0 +#define QIXIS_DDRCLK_100 0x1 +#define QIXIS_DDRCLK_125 0x2 +#define QIXIS_DDRCLK_133 0x3 + +/* BRDCFG2 - SD clock*/ +#define QIXIS_SDCLK1_100 0x0 +#define QIXIS_SDCLK1_125 0x1 +#define QIXIS_SDCLK1_165 0x2 +#define QIXIS_SDCLK1_100_SP 0x3 + +#endif diff --git a/board/freescale/ls1046aqds/ls1046aqds_rcw_nand.cfg b/board/freescale/ls1046aqds/ls1046aqds_rcw_nand.cfg new file mode 100644 index 0000000..b5fc08c --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds_rcw_nand.cfg @@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# serdes protocol +0c150010 0e000000 00000000 00000000 +11335559 40005012 e0116000 c1000000 +00000000 00000000 00000000 00038800 +00000000 01001101 00000096 00000001 diff --git a/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_ifc.cfg b/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_ifc.cfg new file mode 100644 index 0000000..59d24d6 --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_ifc.cfg @@ -0,0 +1,8 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +# Enable IFC; disable QSPI +0c150010 0e000000 00000000 00000000 +11335559 40005012 60040000 c1000000 +00000000 00000000 00000000 00038800 +00000000 01001101 00000096 00000001 diff --git a/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_qspi.cfg b/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_qspi.cfg new file mode 100644 index 0000000..9401a6f --- /dev/null +++ b/board/freescale/ls1046aqds/ls1046aqds_rcw_sd_qspi.cfg @@ -0,0 +1,8 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +# Enable QSPI; disable IFC +0c150010 0e000000 00000000 00000000 +11335559 40005012 60040000 c1000000 +00000000 00000000 00000000 00038800 +20124000 01001101 00000096 00000001 diff --git a/board/freescale/ls1046ardb/Kconfig b/board/freescale/ls1046ardb/Kconfig new file mode 100644 index 0000000..a62255c --- /dev/null +++ b/board/freescale/ls1046ardb/Kconfig @@ -0,0 +1,16 @@ + +if TARGET_LS1046ARDB + +config SYS_BOARD + default "ls1046ardb" + +config SYS_VENDOR + default "freescale" + +config SYS_SOC + default "fsl-layerscape" + +config SYS_CONFIG_NAME + default "ls1046ardb" + +endif diff --git a/board/freescale/ls1046ardb/MAINTAINERS b/board/freescale/ls1046ardb/MAINTAINERS new file mode 100644 index 0000000..ff42bef --- /dev/null +++ b/board/freescale/ls1046ardb/MAINTAINERS @@ -0,0 +1,9 @@ +LS1046A BOARD +M: Mingkai Hu <mingkai.hu@nxp.com> +S: Maintained +F: board/freescale/ls1046ardb/ +F: board/freescale/ls1046ardb/ls1046ardb.c +F: include/configs/ls1046ardb.h +F: configs/ls1046ardb_qspi_defconfig +F: configs/ls1046ardb_sdcard_defconfig +F: configs/ls1046ardb_emmc_defconfig diff --git a/board/freescale/ls1046ardb/Makefile b/board/freescale/ls1046ardb/Makefile new file mode 100644 index 0000000..348eb76 --- /dev/null +++ b/board/freescale/ls1046ardb/Makefile @@ -0,0 +1,10 @@ +# +# Copyright 2016 Freescale Semiconductor +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += cpld.o +obj-y += ddr.o +obj-y += ls1046ardb.o +obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o diff --git a/board/freescale/ls1046ardb/README b/board/freescale/ls1046ardb/README new file mode 100644 index 0000000..1ef7d47 --- /dev/null +++ b/board/freescale/ls1046ardb/README @@ -0,0 +1,76 @@ +Overview +-------- +The LS1046A Reference Design Board (RDB) is a high-performance computing, +evaluation, and development platform that supports the QorIQ LS1046A +LayerScape Architecture processor. The LS1046ARDB provides SW development +platform for the Freescale LS1046A processor series, with a complete +debugging environment. The LS1046A RDB is lead-free and RoHS-compliant. + +LS1046A SoC Overview +-------------------- +Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS1046A +SoC overview. + + LS1046ARDB board Overview + ----------------------- + - SERDES1 Connections, 4 lanes supporting: + - Lane0: XFI with x1 RJ45 connector + - Lane1: XFI Cage + - Lane2: SGMII.5 + - Lane3: SGMII.6 + - SERDES2 Connections, 4 lanes supporting: + - Lane0: PCIe1 with miniPCIe slot + - Lane1: PCIe2 with PCIe x2 slot + - Lane2: PCIe3 with PCIe x4 slot + - Lane3: SATA + - DDR Controller + - 8GB 64bits DDR4 SDRAM. Support rates of up to 2133MT/s + -IFC/Local Bus + - One 512 MB NAND flash with ECC support + - CPLD connection + - USB 3.0 + - one Type A port, one Micro-AB port + - SDHC: connects directly to a full SD/MMC slot + - DSPI: 64 MB high-speed flash Memory for boot code and storage (up to 108MHz) + - 4 I2C controllers + - UART + - Two 4-pin serial ports at up to 115.2 Kbit/s + - Two DB9 D-Type connectors supporting one Serial port each + - ARM JTAG support + +Memory map from core's view +---------------------------- +Start Address End Address Description Size +0x00_0000_0000 - 0x00_000F_FFFF Secure Boot ROM 1MB +0x00_0100_0000 - 0x00_0FFF_FFFF CCSRBAR 240MB +0x00_1000_0000 - 0x00_1000_FFFF OCRAM0 64KB +0x00_1001_0000 - 0x00_1001_FFFF OCRAM1 64KB +0x00_2000_0000 - 0x00_20FF_FFFF DCSR 16MB +0x00_7E80_0000 - 0x00_7E80_FFFF IFC - NAND Flash 64KB +0x00_7FB0_0000 - 0x00_7FB0_0FFF IFC - CPLD 4KB +0x00_8000_0000 - 0x00_FFFF_FFFF DRAM1 2GB +0x05_0000_0000 - 0x05_07FF_FFFF QMAN S/W Portal 128M +0x05_0800_0000 - 0x05_0FFF_FFFF BMAN S/W Portal 128M +0x08_8000_0000 - 0x09_FFFF_FFFF DRAM2 6GB +0x40_0000_0000 - 0x47_FFFF_FFFF PCI Express1 32G +0x48_0000_0000 - 0x4F_FFFF_FFFF PCI Express2 32G +0x50_0000_0000 - 0x57_FFFF_FFFF PCI Express3 32G + +QSPI flash map: +Start Address End Address Description Size +0x00_4000_0000 - 0x00_400F_FFFF RCW + PBI 1MB +0x00_4010_0000 - 0x00_401F_FFFF U-Boot 1MB +0x00_4020_0000 - 0x00_402F_FFFF U-Boot Env 1MB +0x00_4030_0000 - 0x00_403F_FFFF FMan ucode 1MB +0x00_4040_0000 - 0x00_404F_FFFF UEFI 1MB +0x00_4050_0000 - 0x00_406F_FFFF PPA 2MB +0x00_4070_0000 - 0x00_408F_FFFF Secure boot header + + bootscript 2MB +0x00_4090_0000 - 0x00_40FF_FFFF Reserved 7MB +0x00_4100_0000 - 0x00_43FF_FFFF FIT Image 48MB + +Booting Options +--------------- +a) QSPI boot +b) SD boot +c) eMMC boot diff --git a/board/freescale/ls1046ardb/cpld.c b/board/freescale/ls1046ardb/cpld.c new file mode 100644 index 0000000..81a646e --- /dev/null +++ b/board/freescale/ls1046ardb/cpld.c @@ -0,0 +1,158 @@ +/* + * Copyright 2016 Freescale Semiconductor + * + * SPDX-License-Identifier: GPL-2.0+ + * + * Freescale LS1046ARDB board-specific CPLD controlling supports. + */ + +#include <common.h> +#include <command.h> +#include <asm/io.h> +#include "cpld.h" + +u8 cpld_read(unsigned int reg) +{ + void *p = (void *)CONFIG_SYS_CPLD_BASE; + + return in_8(p + reg); +} + +void cpld_write(unsigned int reg, u8 value) +{ + void *p = (void *)CONFIG_SYS_CPLD_BASE; + + out_8(p + reg, value); +} + +/* Set the boot bank to the alternate bank */ +void cpld_set_altbank(void) +{ + u16 reg = CPLD_CFG_RCW_SRC_QSPI; + u8 reg4 = CPLD_READ(soft_mux_on); + u8 reg5 = (u8)(reg >> 1); + u8 reg6 = (u8)(reg & 1); + u8 reg7 = CPLD_READ(vbank); + + cpld_rev_bit(®5); + + CPLD_WRITE(soft_mux_on, reg4 | CPLD_SW_MUX_BANK_SEL | 1); + + CPLD_WRITE(cfg_rcw_src1, reg5); + CPLD_WRITE(cfg_rcw_src2, reg6); + + reg7 = (reg7 & ~CPLD_BANK_SEL_MASK) | CPLD_BANK_SEL_ALTBANK; + CPLD_WRITE(vbank, reg7); + + CPLD_WRITE(system_rst, 1); +} + +/* Set the boot bank to the default bank */ +void cpld_set_defbank(void) +{ + u16 reg = CPLD_CFG_RCW_SRC_QSPI; + u8 reg4 = CPLD_READ(soft_mux_on); + u8 reg5 = (u8)(reg >> 1); + u8 reg6 = (u8)(reg & 1); + + cpld_rev_bit(®5); + + CPLD_WRITE(soft_mux_on, reg4 | CPLD_SW_MUX_BANK_SEL | 1); + + CPLD_WRITE(cfg_rcw_src1, reg5); + CPLD_WRITE(cfg_rcw_src2, reg6); + + CPLD_WRITE(vbank, 0); + + CPLD_WRITE(system_rst, 1); +} + +void cpld_set_sd(void) +{ + u16 reg = CPLD_CFG_RCW_SRC_SD; + u8 reg5 = (u8)(reg >> 1); + u8 reg6 = (u8)(reg & 1); + + cpld_rev_bit(®5); + + CPLD_WRITE(soft_mux_on, 1); + + CPLD_WRITE(cfg_rcw_src1, reg5); + CPLD_WRITE(cfg_rcw_src2, reg6); + + CPLD_WRITE(system_rst, 1); +} +#ifdef DEBUG +static void cpld_dump_regs(void) +{ + printf("cpld_ver = %x\n", CPLD_READ(cpld_ver)); + printf("cpld_ver_sub = %x\n", CPLD_READ(cpld_ver_sub)); + printf("pcba_ver = %x\n", CPLD_READ(pcba_ver)); + printf("soft_mux_on = %x\n", CPLD_READ(soft_mux_on)); + printf("cfg_rcw_src1 = %x\n", CPLD_READ(cfg_rcw_src1)); + printf("cfg_rcw_src2 = %x\n", CPLD_READ(cfg_rcw_src2)); + printf("vbank = %x\n", CPLD_READ(vbank)); + printf("sysclk_sel = %x\n", CPLD_READ(sysclk_sel)); + printf("uart_sel = %x\n", CPLD_READ(uart_sel)); + printf("sd1refclk_sel = %x\n", CPLD_READ(sd1refclk_sel)); + printf("rgmii_1588_sel = %x\n", CPLD_READ(rgmii_1588_sel)); + printf("1588_clk_sel = %x\n", CPLD_READ(reg_1588_clk_sel)); + printf("status_led = %x\n", CPLD_READ(status_led)); + printf("sd_emmc = %x\n", CPLD_READ(sd_emmc)); + printf("vdd_en = %x\n", CPLD_READ(vdd_en)); + printf("vdd_sel = %x\n", CPLD_READ(vdd_sel)); + putc('\n'); +} +#endif + +void cpld_rev_bit(unsigned char *value) +{ + u8 rev_val, val; + int i; + + val = *value; + rev_val = val & 1; + for (i = 1; i <= 7; i++) { + val >>= 1; + rev_val <<= 1; + rev_val |= val & 1; + } + + *value = rev_val; +} + +int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + int rc = 0; + + if (argc <= 1) + return cmd_usage(cmdtp); + + if (strcmp(argv[1], "reset") == 0) { + if (strcmp(argv[2], "altbank") == 0) + cpld_set_altbank(); + else if (strcmp(argv[2], "sd") == 0) + cpld_set_sd(); + else + cpld_set_defbank(); +#ifdef DEBUG + } else if (strcmp(argv[1], "dump") == 0) { + cpld_dump_regs(); +#endif + } else { + rc = cmd_usage(cmdtp); + } + + return rc; +} + +U_BOOT_CMD( + cpld, CONFIG_SYS_MAXARGS, 1, do_cpld, + "Reset the board or alternate bank", + "reset: reset to default bank\n" + "cpld reset altbank: reset to alternate bank\n" + "cpld reset sd: reset to boot from SD card\n" +#ifdef DEBUG + "cpld dump - display the CPLD registers\n" +#endif +); diff --git a/board/freescale/ls1046ardb/cpld.h b/board/freescale/ls1046ardb/cpld.h new file mode 100644 index 0000000..458da7e --- /dev/null +++ b/board/freescale/ls1046ardb/cpld.h @@ -0,0 +1,49 @@ +/* + * Copyright 2016 Freescale Semiconductor + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __CPLD_H__ +#define __CPLD_H__ + +/* + * CPLD register set of LS1046ARDB board-specific. + * CPLD Revision: V2.1 + */ +struct cpld_data { + u8 cpld_ver; /* 0x0 - CPLD Major Revision Register */ + u8 cpld_ver_sub; /* 0x1 - CPLD Minor Revision Register */ + u8 pcba_ver; /* 0x2 - PCBA Revision Register */ + u8 system_rst; /* 0x3 - system reset register */ + u8 soft_mux_on; /* 0x4 - Switch Control Enable Register */ + u8 cfg_rcw_src1; /* 0x5 - RCW Source Location POR Regsiter 1 */ + u8 cfg_rcw_src2; /* 0x6 - RCW Source Location POR Regsiter 2 */ + u8 vbank; /* 0x7 - QSPI Flash Bank Setting Register */ + u8 sysclk_sel; /* 0x8 - System clock POR Register */ + u8 uart_sel; /* 0x9 - UART1 Connection Control Register */ + u8 sd1refclk_sel; /* 0xA - */ + u8 rgmii_1588_sel; /* 0xB - */ + u8 reg_1588_clk_sel; /* 0xC - */ + u8 status_led; /* 0xD - */ + u8 global_rst; /* 0xE - */ + u8 sd_emmc; /* 0xF - SD/EMMC Interface Control Regsiter */ + u8 vdd_en; /* 0x10 - VDD Voltage Control Enable Register */ + u8 vdd_sel; /* 0x11 - VDD Voltage Control Register */ +}; + +u8 cpld_read(unsigned int reg); +void cpld_write(unsigned int reg, u8 value); +void cpld_rev_bit(unsigned char *value); + +#define CPLD_READ(reg) cpld_read(offsetof(struct cpld_data, reg)) +#define CPLD_WRITE(reg, value) \ + cpld_write(offsetof(struct cpld_data, reg), value) + +/* CPLD on IFC */ +#define CPLD_SW_MUX_BANK_SEL 0x40 +#define CPLD_BANK_SEL_MASK 0x07 +#define CPLD_BANK_SEL_ALTBANK 0x04 +#define CPLD_CFG_RCW_SRC_QSPI 0x044 +#define CPLD_CFG_RCW_SRC_SD 0x040 +#endif diff --git a/board/freescale/ls1046ardb/ddr.c b/board/freescale/ls1046ardb/ddr.c new file mode 100644 index 0000000..a9b7dbd --- /dev/null +++ b/board/freescale/ls1046ardb/ddr.c @@ -0,0 +1,140 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <fsl_ddr_sdram.h> +#include <fsl_ddr_dimm_params.h> +#include "ddr.h" +#ifdef CONFIG_FSL_DEEP_SLEEP +#include <fsl_sleep.h> +#endif + +DECLARE_GLOBAL_DATA_PTR; + +void fsl_ddr_board_options(memctl_options_t *popts, + dimm_params_t *pdimm, + unsigned int ctrl_num) +{ + const struct board_specific_parameters *pbsp, *pbsp_highest = NULL; + ulong ddr_freq; + + if (ctrl_num > 1) { + printf("Not supported controller number %d\n", ctrl_num); + return; + } + if (!pdimm->n_ranks) + return; + + pbsp = udimms[0]; + + /* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr + * freqency and n_banks specified in board_specific_parameters table. + */ + ddr_freq = get_ddr_freq(0) / 1000000; + while (pbsp->datarate_mhz_high) { + if (pbsp->n_ranks == pdimm->n_ranks) { + if (ddr_freq <= pbsp->datarate_mhz_high) { + popts->clk_adjust = pbsp->clk_adjust; + popts->wrlvl_start = pbsp->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + goto found; + } + pbsp_highest = pbsp; + } + pbsp++; + } + + if (pbsp_highest) { + printf("Error: board specific timing not found for %lu MT/s\n", + ddr_freq); + printf("Trying to use the highest speed (%u) parameters\n", + pbsp_highest->datarate_mhz_high); + popts->clk_adjust = pbsp_highest->clk_adjust; + popts->wrlvl_start = pbsp_highest->wrlvl_start; + popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2; + popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3; + } else { + panic("DIMM is not supported by this board"); + } +found: + debug("Found timing match: n_ranks %d, data rate %d, rank_gb %d\n", + pbsp->n_ranks, pbsp->datarate_mhz_high, pbsp->rank_gb); + + popts->data_bus_width = 0; /* 64-bit data bus */ + popts->otf_burst_chop_en = 0; + popts->burst_length = DDR_BL8; + popts->bstopre = 0; /* enable auto precharge */ + + /* + * Factors to consider for half-strength driver enable: + * - number of DIMMs installed + */ + popts->half_strength_driver_enable = 0; + /* + * Write leveling override + */ + popts->wrlvl_override = 1; + popts->wrlvl_sample = 0xf; + + /* + * Rtt and Rtt_WR override + */ + popts->rtt_override = 0; + + /* Enable ZQ calibration */ + popts->zq_en = 1; + + popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_80ohm); + popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_80ohm) | + DDR_CDR2_VREF_TRAIN_EN | DDR_CDR2_VREF_RANGE_2; +} + +phys_size_t initdram(int board_type) +{ + phys_size_t dram_size; + +#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) + return fsl_ddr_sdram_size(); +#else + puts("Initializing DDR....using SPD\n"); + + dram_size = fsl_ddr_sdram(); +#endif + + erratum_a008850_post(); + + return dram_size; +} + +void dram_init_banksize(void) +{ + /* + * gd->arch.secure_ram tracks the location of secure memory. + * It was set as if the memory starts from 0. + * The address needs to add the offset of its bank. + */ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) { + gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE; + gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE; + gd->bd->bi_dram[1].size = gd->ram_size - + CONFIG_SYS_DDR_BLOCK1_SIZE; +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + gd->arch.secure_ram = gd->bd->bi_dram[1].start + + gd->arch.secure_ram - + CONFIG_SYS_DDR_BLOCK1_SIZE; + gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED; +#endif + } else { + gd->bd->bi_dram[0].size = gd->ram_size; +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE + gd->arch.secure_ram = gd->bd->bi_dram[0].start + + gd->arch.secure_ram; + gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED; +#endif + } +} diff --git a/board/freescale/ls1046ardb/ddr.h b/board/freescale/ls1046ardb/ddr.h new file mode 100644 index 0000000..9e440f6 --- /dev/null +++ b/board/freescale/ls1046ardb/ddr.h @@ -0,0 +1,44 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __DDR_H__ +#define __DDR_H__ + +void erratum_a008850_post(void); + +struct board_specific_parameters { + u32 n_ranks; + u32 datarate_mhz_high; + u32 rank_gb; + u32 clk_adjust; + u32 wrlvl_start; + u32 wrlvl_ctl_2; + u32 wrlvl_ctl_3; +}; + +/* + * These tables contain all valid speeds we want to override with board + * specific parameters. datarate_mhz_high values need to be in ascending order + * for each n_ranks group. + */ +static const struct board_specific_parameters udimm0[] = { + /* + * memory controller 0 + * num| hi| rank| clk| wrlvl | wrlvl | wrlvl + * ranks| mhz| GB |adjst| start | ctl2 | ctl3 + */ + {2, 1350, 0, 8, 6, 0x0708090B, 0x0C0D0E09,}, + {2, 1666, 0, 8, 7, 0x08090A0C, 0x0D0F100B,}, + {2, 1900, 0, 8, 7, 0x09090B0D, 0x0E10120B,}, + {2, 2300, 0, 8, 9, 0x0A0B0C10, 0x1213140E,}, + {} +}; + +static const struct board_specific_parameters *udimms[] = { + udimm0, +}; + +#endif diff --git a/board/freescale/ls1046ardb/eth.c b/board/freescale/ls1046ardb/eth.c new file mode 100644 index 0000000..ac8bbec --- /dev/null +++ b/board/freescale/ls1046ardb/eth.c @@ -0,0 +1,77 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#include <common.h> +#include <asm/io.h> +#include <netdev.h> +#include <fm_eth.h> +#include <fsl_dtsec.h> +#include <fsl_mdio.h> +#include <malloc.h> + +#include "../common/fman.h" + +int board_eth_init(bd_t *bis) +{ +#ifdef CONFIG_FMAN_ENET + int i; + struct memac_mdio_info dtsec_mdio_info; + struct memac_mdio_info tgec_mdio_info; + struct mii_dev *dev; + u32 srds_s1; + struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); + + srds_s1 = in_be32(&gur->rcwsr[4]) & + FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK; + srds_s1 >>= FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT; + + dtsec_mdio_info.regs = + (struct memac_mdio_controller *)CONFIG_SYS_FM1_DTSEC_MDIO_ADDR; + + dtsec_mdio_info.name = DEFAULT_FM_MDIO_NAME; + + /* Register the 1G MDIO bus */ + fm_memac_mdio_init(bis, &dtsec_mdio_info); + + tgec_mdio_info.regs = + (struct memac_mdio_controller *)CONFIG_SYS_FM1_TGEC_MDIO_ADDR; + tgec_mdio_info.name = DEFAULT_FM_TGEC_MDIO_NAME; + + /* Register the 10G MDIO bus */ + fm_memac_mdio_init(bis, &tgec_mdio_info); + + /* Set the two on-board RGMII PHY address */ + fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY1_ADDR); + fm_info_set_phy_address(FM1_DTSEC4, RGMII_PHY2_ADDR); + + /* Set the two on-board SGMII PHY address */ + fm_info_set_phy_address(FM1_DTSEC5, SGMII_PHY1_ADDR); + fm_info_set_phy_address(FM1_DTSEC6, SGMII_PHY2_ADDR); + + /* Set the on-board AQ PHY address */ + fm_info_set_phy_address(FM1_10GEC1, FM1_10GEC1_PHY_ADDR); + + switch (srds_s1) { + case 0x1133: + break; + default: + printf("Invalid SerDes protocol 0x%x for LS1046ARDB\n", + srds_s1); + break; + } + + dev = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME); + for (i = FM1_DTSEC1; i < FM1_DTSEC1 + CONFIG_SYS_NUM_FM1_DTSEC; i++) + fm_info_set_mdio(i, dev); + + /* XFI on lane A, MAC 9 */ + dev = miiphy_get_dev_by_name(DEFAULT_FM_TGEC_MDIO_NAME); + fm_info_set_mdio(FM1_10GEC1, dev); + + cpu_eth_init(bis); +#endif + + return pci_eth_init(bis); +} diff --git a/board/freescale/ls1046ardb/ls1046ardb.c b/board/freescale/ls1046ardb/ls1046ardb.c new file mode 100644 index 0000000..585c807 --- /dev/null +++ b/board/freescale/ls1046ardb/ls1046ardb.c @@ -0,0 +1,136 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <i2c.h> +#include <fdt_support.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/fsl_serdes.h> +#include <asm/arch/ppa.h> +#include <asm/arch/soc.h> +#include <hwconfig.h> +#include <ahci.h> +#include <mmc.h> +#include <scsi.h> +#include <fm_eth.h> +#include <fsl_csu.h> +#include <fsl_esdhc.h> +#include "cpld.h" + +DECLARE_GLOBAL_DATA_PTR; + +int checkboard(void) +{ + static const char *freq[2] = {"100.00MHZ", "156.25MHZ"}; + u8 cfg_rcw_src1, cfg_rcw_src2; + u16 cfg_rcw_src; + u8 sd1refclk_sel; + + puts("Board: LS1046ARDB, boot from "); + + cfg_rcw_src1 = CPLD_READ(cfg_rcw_src1); + cfg_rcw_src2 = CPLD_READ(cfg_rcw_src2); + cpld_rev_bit(&cfg_rcw_src1); + cfg_rcw_src = cfg_rcw_src1; + cfg_rcw_src = (cfg_rcw_src << 1) | cfg_rcw_src2; + + if (cfg_rcw_src == 0x44) + printf("QSPI vBank %d\n", CPLD_READ(vbank)); + else if (cfg_rcw_src == 0x40) + puts("SD\n"); + else + puts("Invalid setting of SW5\n"); + + printf("CPLD: V%x.%x\nPCBA: V%x.0\n", CPLD_READ(cpld_ver), + CPLD_READ(cpld_ver_sub), CPLD_READ(pcba_ver)); + + puts("SERDES Reference Clocks:\n"); + sd1refclk_sel = CPLD_READ(sd1refclk_sel); + printf("SD1_CLK1 = %s, SD1_CLK2 = %s\n", freq[sd1refclk_sel], freq[0]); + + return 0; +} + +int dram_init(void) +{ + gd->ram_size = initdram(0); + + return 0; +} + +int board_early_init_f(void) +{ + fsl_lsch2_early_init_f(); + + return 0; +} + +int board_init(void) +{ + struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; + +#ifdef CONFIG_LAYERSCAPE_NS_ACCESS + enable_layerscape_ns_access(); +#endif + +#ifdef CONFIG_FSL_LS_PPA + ppa_init(); +#endif + + /* invert AQR105 IRQ pins polarity */ + out_be32(&scfg->intpcr, AQR105_IRQ_MASK); + + return 0; +} + +void config_board_mux(void) +{ +#ifdef CONFIG_HAS_FSL_XHCI_USB + struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; + u32 usb_pwrfault; + + /* USB3 is not used, configure mux to IIC4_SCL/IIC4_SDA */ + out_be32(&scfg->rcwpmuxcr0, 0x3300); + out_be32(&scfg->usbdrvvbus_selcr, SCFG_USBDRVVBUS_SELCR_USB1); + usb_pwrfault = (SCFG_USBPWRFAULT_DEDICATED << + SCFG_USBPWRFAULT_USB3_SHIFT) | + (SCFG_USBPWRFAULT_DEDICATED << + SCFG_USBPWRFAULT_USB2_SHIFT) | + (SCFG_USBPWRFAULT_SHARED << + SCFG_USBPWRFAULT_USB1_SHIFT); + out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault); +#endif +} + +#ifdef CONFIG_MISC_INIT_R +int misc_init_r(void) +{ + config_board_mux(); + return 0; +} +#endif + +int ft_board_setup(void *blob, bd_t *bd) +{ + u64 base[CONFIG_NR_DRAM_BANKS]; + u64 size[CONFIG_NR_DRAM_BANKS]; + + /* fixup DT for the two DDR banks */ + base[0] = gd->bd->bi_dram[0].start; + size[0] = gd->bd->bi_dram[0].size; + base[1] = gd->bd->bi_dram[1].start; + size[1] = gd->bd->bi_dram[1].size; + + fdt_fixup_memory_banks(blob, base, size, 2); + ft_cpu_setup(blob, bd); + +#ifdef CONFIG_SYS_DPAA_FMAN + fdt_fixup_fman_ethernet(blob); +#endif + + return 0; +} diff --git a/board/freescale/ls1046ardb/ls1046ardb_pbi.cfg b/board/freescale/ls1046ardb/ls1046ardb_pbi.cfg new file mode 100644 index 0000000..5478217 --- /dev/null +++ b/board/freescale/ls1046ardb/ls1046ardb_pbi.cfg @@ -0,0 +1,22 @@ +#Configure Scratch register +09570600 00000000 +09570604 10000000 +#Disable CCI barrier tranaction +09570178 0000e010 +09180000 00000008 +#USB PHY frequency sel +09570418 0000009e +0957041c 0000009e +09570420 0000009e +#Serdes SATA +09eb1300 80104e20 +09eb08dc 00502880 +#PEX gen3 link +09570158 00000300 +89400890 01048000 +89500890 01048000 +89600890 01048000 +#Alt base register +09570158 00001000 +#flush PBI data +096100c0 000fffff diff --git a/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg b/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg new file mode 100644 index 0000000..6a5076e --- /dev/null +++ b/board/freescale/ls1046ardb/ls1046ardb_rcw_emmc.cfg @@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +0c150010 0e000000 00000000 00000000 +11335559 40000012 60040000 c1000000 +00000000 00000000 00000000 00238800 +20124000 00003000 00000096 00000001 diff --git a/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg b/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg new file mode 100644 index 0000000..d5265b8 --- /dev/null +++ b/board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg @@ -0,0 +1,7 @@ +#PBL preamble and RCW header +aa55aa55 01ee0100 +# RCW +0c150010 0e000000 00000000 00000000 +11335559 40005012 60040000 c1000000 +00000000 00000000 00000000 00238800 +20124000 00003101 00000096 00000001 diff --git a/board/freescale/ls2080a/ls2080a.c b/board/freescale/ls2080a/ls2080a.c index 00337d7..d0a88d4 100644 --- a/board/freescale/ls2080a/ls2080a.c +++ b/board/freescale/ls2080a/ls2080a.c @@ -12,7 +12,6 @@ #include <asm/io.h> #include <fdt_support.h> #include <libfdt.h> -#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include <environment.h> #include <asm/arch/soc.h> @@ -60,10 +59,6 @@ int dram_init(void) #if defined(CONFIG_ARCH_MISC_INIT) int arch_misc_init(void) { -#ifdef CONFIG_FSL_DEBUG_SERVER - debug_server_init(); -#endif - return 0; } #endif diff --git a/board/freescale/ls2080aqds/README b/board/freescale/ls2080aqds/README index 5c98866..f288750 100644 --- a/board/freescale/ls2080aqds/README +++ b/board/freescale/ls2080aqds/README @@ -112,7 +112,7 @@ X-QSGMII-16PORT riser card ---------------------------- The X-QSGMII-16PORT is a 4xQSGMII/8xSGMII riser card with eighth SerDes interfaces implemented in PCIe form factor board. -It supports followings +It supports following: - Card can operate with up to 4 QSGMII lane simultaneously - Card can operate with up to 8 SGMII lane simultaneously diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c index 7d95deb..ca4a2e5 100644 --- a/board/freescale/ls2080aqds/ls2080aqds.c +++ b/board/freescale/ls2080aqds/ls2080aqds.c @@ -12,7 +12,6 @@ #include <asm/io.h> #include <fdt_support.h> #include <libfdt.h> -#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include <environment.h> #include <i2c.h> @@ -265,9 +264,6 @@ int dram_init(void) #if defined(CONFIG_ARCH_MISC_INIT) int arch_misc_init(void) { -#ifdef CONFIG_FSL_DEBUG_SERVER - debug_server_init(); -#endif #ifdef CONFIG_FSL_CAAM sec_init(); #endif diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c index a65cd4a..7d8a711 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -13,7 +13,6 @@ #include <hwconfig.h> #include <fdt_support.h> #include <libfdt.h> -#include <fsl_debug_server.h> #include <fsl-mc/fsl_mc.h> #include <environment.h> #include <i2c.h> @@ -229,9 +228,6 @@ int dram_init(void) #if defined(CONFIG_ARCH_MISC_INIT) int arch_misc_init(void) { -#ifdef CONFIG_FSL_DEBUG_SERVER - debug_server_init(); -#endif #ifdef CONFIG_FSL_CAAM sec_init(); #endif diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 0cf6809..f836ecb 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -854,6 +854,8 @@ static void spl_dram_init(void) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; if (is_mx6dqp()) { diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index f978e50..96c0e8c 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -494,6 +494,8 @@ static void spl_dram_init(void) .sde_to_rst = 0, /* LPDDR2 does not need this field */ .rst_to_cke = 0x10, /* JEDEC value for LPDDR2: 200us */ .ddr_type = DDR_TYPE_LPDDR2, + .refsel = 0, /* Refresh cycles at 64KHz */ + .refr = 3, /* 4 refresh commands per refresh cycle */ }; mx6sl_dram_iocfg(32, &mx6_ddr_ioregs, &mx6_grp_ioregs); mx6_dram_cfg(&sysinfo, &mx6_mmcd_calib, &mem_ddr); diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 8d95c51..965e511 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -637,6 +637,8 @@ static void spl_dram_init(void) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; mx6sx_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs); diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index 66d6795..399bad2 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -193,9 +193,7 @@ int power_init_board(void) reg, rev_id); /* disable Low Power Mode during standby mode */ - pmic_reg_read(pfuze, PFUZE3000_LDOGCTL, ®); - reg |= 0x1; - pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, reg); + pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1); /* SW1B step ramp up time from 2us to 4us/25mV */ reg = 0x40; @@ -277,18 +275,16 @@ static iomux_v3_cfg_t const usdhc2_pads[] = { MX6_PAD_NAND_DATA03__USDHC2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; -static iomux_v3_cfg_t const usdhc2_cd_pads[] = { - /* - * The evk board uses DAT3 to detect CD card plugin, - * in u-boot we mux the pin to GPIO when doing board_mmc_getcd. - */ - MX6_PAD_NAND_DATA03__GPIO4_IO05 | MUX_PAD_CTRL(USDHC_DAT3_CD_PAD_CTRL), -}; +/* + * The evk board uses DAT3 to detect CD card plugin, + * in u-boot we mux the pin to GPIO when doing board_mmc_getcd. + */ +static iomux_v3_cfg_t const usdhc2_cd_pad = + MX6_PAD_NAND_DATA03__GPIO4_IO05 | MUX_PAD_CTRL(USDHC_DAT3_CD_PAD_CTRL); -static iomux_v3_cfg_t const usdhc2_dat3_pads[] = { +static iomux_v3_cfg_t const usdhc2_dat3_pad = MX6_PAD_NAND_DATA03__USDHC2_DATA3 | - MUX_PAD_CTRL(USDHC_DAT3_CD_PAD_CTRL), -}; + MUX_PAD_CTRL(USDHC_DAT3_CD_PAD_CTRL); #endif static void setup_iomux_uart(void) @@ -351,8 +347,7 @@ int board_mmc_getcd(struct mmc *mmc) #if defined(CONFIG_MX6UL_14X14_EVK_EMMC_REWORK) ret = 1; #else - imx_iomux_v3_setup_multiple_pads(usdhc2_cd_pads, - ARRAY_SIZE(usdhc2_cd_pads)); + imx_iomux_v3_setup_pad(usdhc2_cd_pad); gpio_direction_input(USDHC2_CD_GPIO); /* @@ -361,8 +356,7 @@ int board_mmc_getcd(struct mmc *mmc) */ ret = gpio_get_value(USDHC2_CD_GPIO); - imx_iomux_v3_setup_multiple_pads(usdhc2_dat3_pads, - ARRAY_SIZE(usdhc2_dat3_pads)); + imx_iomux_v3_setup_pad(usdhc2_dat3_pad); #endif break; } @@ -770,6 +764,8 @@ struct mx6_ddr_sysinfo ddr_sysinfo = { .sde_to_rst = 0, /* LPDDR2 does not need this field */ .rst_to_cke = 0x10, /* JEDEC value for LPDDR2: 200us */ .ddr_type = DDR_TYPE_LPDDR2, + .refsel = 0, /* Refresh cycles at 64KHz */ + .refr = 3, /* 4 refresh commands per refresh cycle */ }; #else @@ -781,17 +777,17 @@ static struct mx6ul_iomux_ddr_regs mx6_ddr_ioregs = { .dram_odt0 = 0x00000030, .dram_odt1 = 0x00000030, .dram_sdba2 = 0x00000000, - .dram_sdclk_0 = 0x00000008, - .dram_sdqs0 = 0x00000038, + .dram_sdclk_0 = 0x00000030, + .dram_sdqs0 = 0x00000030, .dram_sdqs1 = 0x00000030, .dram_reset = 0x00000030, }; static struct mx6_mmdc_calibration mx6_mmcd_calib = { - .p0_mpwldectrl0 = 0x00070007, - .p0_mpdgctrl0 = 0x41490145, - .p0_mprddlctl = 0x40404546, - .p0_mpwrdlctl = 0x4040524D, + .p0_mpwldectrl0 = 0x00000000, + .p0_mpdgctrl0 = 0x41570155, + .p0_mprddlctl = 0x4040474A, + .p0_mpwrdlctl = 0x40405550, }; struct mx6_ddr_sysinfo ddr_sysinfo = { @@ -801,13 +797,15 @@ struct mx6_ddr_sysinfo ddr_sysinfo = { .cs1_mirror = 0, .rtt_wr = 2, .rtt_nom = 1, /* RTT_Nom = RZQ/2 */ - .walat = 1, /* Write additional latency */ + .walat = 0, /* Write additional latency */ .ralat = 5, /* Read additional latency */ .mif3_mode = 3, /* Command prediction working mode */ .bi_on = 1, /* Bank interleaving enabled */ .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 0, /* Refresh cycles at 64KHz */ + .refr = 1, /* 2 refresh commands per refresh cycle */ }; static struct mx6_ddr3_cfg mem_ddr = { @@ -846,11 +844,11 @@ static void spl_dram_init(void) void board_init_f(ulong dummy) { + ccgr_init(); + /* setup AIPS and disable watchdog */ arch_cpu_init(); - ccgr_init(); - /* iomux and setup of i2c */ board_early_init_f(); diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index 1f4fc03..b936544 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -578,9 +578,7 @@ int power_init_board(void) printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id); /* disable Low Power Mode during standby mode */ - pmic_reg_read(p, PFUZE3000_LDOGCTL, ®); - reg |= 0x1; - pmic_reg_write(p, PFUZE3000_LDOGCTL, reg); + pmic_reg_write(p, PFUZE3000_LDOGCTL, 0x1); return 0; } @@ -609,7 +607,14 @@ int board_late_init(void) int checkboard(void) { - puts("Board: i.MX7D SABRESD\n"); + char *mode; + + if (IS_ENABLED(CONFIG_ARMV7_BOOT_SEC_DEFAULT)) + mode = "secure"; + else + mode = "non-secure"; + + printf("Board: i.MX7D SABRESD in %s mode\n", mode); return 0; } diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c index e7f699a..b610e06 100644 --- a/board/gateworks/gw_ventana/gw_ventana_spl.c +++ b/board/gateworks/gw_ventana/gw_ventana_spl.c @@ -394,6 +394,8 @@ static void spl_dram_init(int width, int size_mb, int board_model) .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .pd_fast_exit = 1, /* enable precharge power-down fast exit */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; /* diff --git a/board/gdsys/405ep/io.c b/board/gdsys/405ep/io.c index 03d796c..81b4965 100644 --- a/board/gdsys/405ep/io.c +++ b/board/gdsys/405ep/io.c @@ -172,8 +172,17 @@ int last_stage_init(void) print_fpga_info(); - miiphy_register(CONFIG_SYS_GBIT_MII_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) configure_gbit_phy(k); diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c index 7484624..7db0e29 100644 --- a/board/gdsys/405ep/iocon.c +++ b/board/gdsys/405ep/iocon.c @@ -405,8 +405,17 @@ int last_stage_init(void) } if (!legacy && (feature_carrier_speed == CARRIER_SPEED_1G)) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_rgmii2_present) continue; @@ -437,8 +446,18 @@ int last_stage_init(void) print_fpga_info(k, false); osd_probe(k); if (feature_carrier_speed == CARRIER_SPEED_1G) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1518(bb_miiphy_buses[k].name, 0); } } diff --git a/board/gdsys/405ex/io64.c b/board/gdsys/405ex/io64.c index 3a075c4..848cdde 100644 --- a/board/gdsys/405ex/io64.c +++ b/board/gdsys/405ex/io64.c @@ -246,8 +246,17 @@ int last_stage_init(void) /* setup Gbit PHYs */ puts("TRANS: "); puts(str_phys); - miiphy_register(CONFIG_SYS_GBIT_MII_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) { configure_gbit_phy(CONFIG_SYS_GBIT_MII_BUSNAME, k); @@ -255,8 +264,16 @@ int last_stage_init(void) putc(slash[k % 8]); } - miiphy_register(CONFIG_SYS_GBIT_MII1_BUSNAME, - bb_miiphy_read, bb_miiphy_write); + mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, CONFIG_SYS_GBIT_MII1_BUSNAME, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (k = 0; k < 32; ++k) { configure_gbit_phy(CONFIG_SYS_GBIT_MII1_BUSNAME, k); diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c index 880b638..f55893f 100644 --- a/board/gdsys/mpc8308/hrcon.c +++ b/board/gdsys/mpc8308/hrcon.c @@ -162,8 +162,17 @@ int last_stage_init(void) } if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_rgmii2_present) continue; @@ -199,8 +208,18 @@ int last_stage_init(void) osd_probe(k + 4); #endif if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1514(bb_miiphy_buses[k].name, 0); } } diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c index 121977d..b8dde5f 100644 --- a/board/gdsys/mpc8308/strider.c +++ b/board/gdsys/mpc8308/strider.c @@ -179,8 +179,17 @@ int last_stage_init(void) } if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[0].name, bb_miiphy_read, - bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; for (mux_ch = 0; mux_ch < MAX_MUX_CHANNELS; ++mux_ch) { if ((mux_ch == 1) && !ch0_sgmii2_present) continue; @@ -252,8 +261,18 @@ int last_stage_init(void) dp501_probe(k, false); #endif if (hw_type_cat) { - miiphy_register(bb_miiphy_buses[k].name, - bb_miiphy_read, bb_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, bb_miiphy_buses[k].name, + MDIO_NAME_LEN); + mdiodev->read = bb_miiphy_read; + mdiodev->write = bb_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; setup_88e1514(bb_miiphy_buses[k].name, 0); } } diff --git a/board/intel/bayleybay/acpi/mainboard.asl b/board/intel/bayleybay/acpi/mainboard.asl index 21785ea..8b7ee3f 100644 --- a/board/intel/bayleybay/acpi/mainboard.asl +++ b/board/intel/bayleybay/acpi/mainboard.asl @@ -9,3 +9,41 @@ Device (PWRB) { Name(_HID, EISAID("PNP0C0C")) } + +/* PS/2 keyboard and mouse */ +Scope (\_SB.PCI0.LPCB) +{ + /* 8042 Keyboard */ + Device (PS2K) + { + Name(_HID, EISAID("PNP0303")) + Name(_CRS, ResourceTemplate() + { + IO(Decode16, 0x60, 0x60, 0x00, 0x01) + IO(Decode16, 0x64, 0x64, 0x00, 0x01) + IRQNoFlags() { 1 } + }) + + Method(_STA, 0, Serialized) + { + Return (STA_VISIBLE) + } + } + + /* 8042 Mouse */ + Device (PS2M) + { + Name(_HID, EISAID("PNP0F03")) + Name(_CRS, ResourceTemplate() + { + IO(Decode16, 0x60, 0x60, 0x00, 0x01) + IO(Decode16, 0x64, 0x64, 0x00, 0x01) + IRQNoFlags() { 12 } + }) + + Method(_STA, 0, Serialized) + { + Return (STA_VISIBLE) + } + } +} diff --git a/board/kmc/kzm9g/kzm9g.c b/board/kmc/kzm9g/kzm9g.c index ea36fa4..a284721 100644 --- a/board/kmc/kzm9g/kzm9g.c +++ b/board/kmc/kzm9g/kzm9g.c @@ -349,7 +349,7 @@ int board_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; int dram_init(void) diff --git a/board/kosagi/novena/novena_spl.c b/board/kosagi/novena/novena_spl.c index f779bb4..92c61ae 100644 --- a/board/kosagi/novena/novena_spl.c +++ b/board/kosagi/novena/novena_spl.c @@ -520,6 +520,8 @@ static struct mx6_ddr_sysinfo novena_ddr_info = { .bi_on = 1, /* Bank interleaving enabled */ .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static struct mx6_ddr3_cfg elpida_4gib_1600 = { diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 51d2987..c2bb730 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -144,20 +144,8 @@ static struct musb_hdrc_platform_data musb_plat = { */ int misc_init_r(void) { - t2_t *t2_base = (t2_t *)T2_BASE; - u32 pbias_lite; - /* set up dual-voltage GPIOs to 1.8V */ - pbias_lite = readl(&t2_base->pbias_lite); - pbias_lite &= ~PBIASLITEVMODE1; - pbias_lite |= PBIASLITEPWRDNZ1; - writel(pbias_lite, &t2_base->pbias_lite); - if (get_cpu_family() == CPU_OMAP36XX) - writel(readl(CONTROL_WKUP_CTRL) | GPIO_IO_PWRDNZ, - CONTROL_WKUP_CTRL); twl4030_power_init(); - omap_die_id_display(); - putc('\n'); #ifdef CONFIG_USB_MUSB_OMAP2PLUS musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE); diff --git a/board/nvidia/p2771-0000/p2771-0000.c b/board/nvidia/p2771-0000/p2771-0000.c index 4ba8ebc..529ed9d 100644 --- a/board/nvidia/p2771-0000/p2771-0000.c +++ b/board/nvidia/p2771-0000/p2771-0000.c @@ -5,3 +5,51 @@ */ #include <common.h> +#include <i2c.h> +#include "../p2571/max77620_init.h" + +int tegra_board_init(void) +{ + struct udevice *dev; + uchar val; + int ret; + + /* Turn on MAX77620 LDO3 to 3.3V for SD card power */ + debug("%s: Set LDO3 for VDDIO_SDMMC_AP power to 3.3V\n", __func__); + ret = i2c_get_chip_for_busnum(0, MAX77620_I2C_ADDR_7BIT, 1, &dev); + if (ret) { + printf("%s: Cannot find MAX77620 I2C chip\n", __func__); + return ret; + } + /* 0xF2 for 3.3v, enabled: bit7:6 = 11 = enable, bit5:0 = voltage */ + val = 0xF2; + ret = dm_i2c_write(dev, MAX77620_CNFG1_L3_REG, &val, 1); + if (ret) { + printf("i2c_write 0 0x3c 0x27 failed: %d\n", ret); + return ret; + } + + return 0; +} + +int tegra_pcie_board_init(void) +{ + struct udevice *dev; + uchar val; + int ret; + + /* Turn on MAX77620 LDO7 to 1.05V for PEX power */ + debug("%s: Set LDO7 for PEX power to 1.05V\n", __func__); + ret = i2c_get_chip_for_busnum(0, MAX77620_I2C_ADDR_7BIT, 1, &dev); + if (ret) { + printf("%s: Cannot find MAX77620 I2C chip\n", __func__); + return -1; + } + /* 0xC5 for 1.05v, enabled: bit7:6 = 11 = enable, bit5:0 = voltage */ + val = 0xC5; + ret = dm_i2c_write(dev, MAX77620_CNFG1_L7_REG, &val, 1); + if (ret) + printf("i2c_write 0 0x3c 0x31 failed: %d\n", ret); + + return 0; +} diff --git a/board/nvidia/venice2/as3722_init.c b/board/nvidia/venice2/as3722_init.c index 960fea7..1770ec2 100644 --- a/board/nvidia/venice2/as3722_init.c +++ b/board/nvidia/venice2/as3722_init.c @@ -32,7 +32,18 @@ void pmic_enable_cpu_vdd(void) { debug("%s entry\n", __func__); - /* Don't need to set up VDD_CORE - already done - by OTP */ +#ifdef AS3722_SD1VOLTAGE_DATA + /* Set up VDD_CORE, for boards where OTP is incorrect*/ + debug("%s: Setting VDD_CORE via AS3722 reg 1\n", __func__); + /* Configure VDD_CORE via the AS3722 PMIC on the PWR I2C bus */ + tegra_i2c_ll_write_addr(AS3722_I2C_ADDR, 2); + tegra_i2c_ll_write_data(AS3722_SD1VOLTAGE_DATA, I2C_SEND_2_BYTES); + /* + * Don't write SDCONTROL - it's already 0x7F, i.e. all SDs enabled. + * tegra_i2c_ll_write_data(AS3722_SD1CONTROL_DATA, I2C_SEND_2_BYTES); + */ + udelay(10 * 1000); +#endif debug("%s: Setting VDD_CPU to 1.0V via AS3722 reg 0/4D\n", __func__); /* diff --git a/board/nvidia/venice2/as3722_init.h b/board/nvidia/venice2/as3722_init.h index 992b11f..30fb132 100644 --- a/board/nvidia/venice2/as3722_init.h +++ b/board/nvidia/venice2/as3722_init.h @@ -18,15 +18,17 @@ #define AS3722_LDO6VOLTAGE_REG 0x16 /* VDD_SDMMC */ #define AS3722_LDCONTROL_REG 0x4E -#if defined(CONFIG_TARGET_JETSON_TK1) || defined(CONFIG_TARGET_NYAN_BIG) -#define AS3722_SD0VOLTAGE_DATA (0x3C00 | AS3722_SD0VOLTAGE_REG) -#else +#if defined(CONFIG_TARGET_VENICE2) #define AS3722_SD0VOLTAGE_DATA (0x2800 | AS3722_SD0VOLTAGE_REG) +#else /* TK1 or Nyan-Big */ +#define AS3722_SD0VOLTAGE_DATA (0x3C00 | AS3722_SD0VOLTAGE_REG) #endif #define AS3722_SD0CONTROL_DATA (0x0100 | AS3722_SDCONTROL_REG) -#define AS3722_SD1VOLTAGE_DATA (0x3200 | AS3722_SD1VOLTAGE_REG) +#if defined(CONFIG_TARGET_JETSON_TK1) || defined(CONFIG_TARGET_CEI_TK1_SOM) +#define AS3722_SD1VOLTAGE_DATA (0x2800 | AS3722_SD1VOLTAGE_REG) #define AS3722_SD1CONTROL_DATA (0x0200 | AS3722_SDCONTROL_REG) +#endif #define AS3722_SD6CONTROL_DATA (0x4000 | AS3722_SDCONTROL_REG) #define AS3722_SD6VOLTAGE_DATA (0x2800 | AS3722_SD6VOLTAGE_REG) diff --git a/board/phytec/pcm058/pcm058.c b/board/phytec/pcm058/pcm058.c index 0ba4a2e..4e2122f 100644 --- a/board/phytec/pcm058/pcm058.c +++ b/board/phytec/pcm058/pcm058.c @@ -521,6 +521,8 @@ static void spl_dram_init(void) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; mx6dq_dram_iocfg(64, &mx6_ddr_ioregs, &mx6_grp_ioregs); diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index fbfbf6c..6245b36 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -50,7 +50,7 @@ U_BOOT_DEVICE(bcm2835_serials) = { .platdata = &serial_platdata, }; #else -static const struct bcm283x_mu_serial_platdata serial_platdata = { +static struct bcm283x_mu_serial_platdata serial_platdata = { .base = 0x3f215040, .clock = 250000000, .skip_init = true, @@ -452,6 +452,38 @@ int board_init(void) return power_on_module(BCM2835_MBOX_POWER_DEVID_USB_HCD); } +#ifndef CONFIG_PL01X_SERIAL +static bool rpi_is_serial_active(void) +{ + int serial_gpio = 15; + struct udevice *dev; + + /* + * The RPi3 disables the mini uart by default. The easiest way to find + * out whether it is available is to check if the RX pin is muxed. + */ + + if (uclass_first_device(UCLASS_GPIO, &dev) || !dev) + return true; + + if (bcm2835_gpio_get_func_id(dev, serial_gpio) != BCM2835_GPIO_ALT5) + return false; + + return true; +} +#endif + +int board_early_init_f(void) +{ +#ifndef CONFIG_PL01X_SERIAL + /* Disable mini-UART I/O if it's not pinmuxed to our pins */ + if (!rpi_is_serial_active()) + serial_platdata.disabled = true; +#endif + + return 0; +} + int board_mmc_init(bd_t *bis) { ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_clock_rate, msg_clk, 1); diff --git a/board/renesas/alt/Makefile b/board/renesas/alt/Makefile index 6904e39..22ab1f4 100644 --- a/board/renesas/alt/Makefile +++ b/board/renesas/alt/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := alt.o qos.o ../rcar-gen2-common/common.o +obj-y := alt.o qos.o ../rcar-common/common.o diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c index 3501a17..a1a26a6 100644 --- a/board/renesas/alt/alt.c +++ b/board/renesas/alt/alt.c @@ -217,7 +217,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/alt/qos.c b/board/renesas/alt/qos.c index b6324c8..3323c3a 100644 --- a/board/renesas/alt/qos.c +++ b/board/renesas/alt/qos.c @@ -13,7 +13,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h> -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) /* QoS version 0.311 for ES1 and version 0.321 for ES2 */ enum { @@ -993,8 +993,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/blanche/Kconfig b/board/renesas/blanche/Kconfig new file mode 100644 index 0000000..ac4730a --- /dev/null +++ b/board/renesas/blanche/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BLANCHE + +config SYS_BOARD + default "blanche" + +config SYS_VENDOR + default "renesas" + +config SYS_CONFIG_NAME + default "blanche" + +endif diff --git a/board/renesas/blanche/Makefile b/board/renesas/blanche/Makefile new file mode 100644 index 0000000..bdbfb29 --- /dev/null +++ b/board/renesas/blanche/Makefile @@ -0,0 +1,9 @@ +# +# board/renesas/blanche/Makefile +# +# Copyright (C) 2016 Renesas Electronics Corporation +# +# SPDX-License-Identifier: GPL-2.0 +# + +obj-y := blanche.o qos.o ../rcar-common/common.o diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c new file mode 100644 index 0000000..b2e2e3b --- /dev/null +++ b/board/renesas/blanche/blanche.c @@ -0,0 +1,488 @@ +/* + * board/renesas/blanche/blanche.c + * This file is blanche board support. + * + * Copyright (C) 2016 Renesas Electronics Corporation + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include <common.h> +#include <malloc.h> +#include <netdev.h> +#include <dm.h> +#include <dm/platform_data/serial_sh.h> +#include <asm/processor.h> +#include <asm/mach-types.h> +#include <asm/io.h> +#include <asm/errno.h> +#include <asm/arch/sys_proto.h> +#include <asm/gpio.h> +#include <asm/arch/rmobile.h> +#include <asm/arch/rcar-mstp.h> +#include <asm/arch/mmc.h> +#include <asm/arch/sh_sdhi.h> +#include <miiphy.h> +#include <i2c.h> +#include <mmc.h> +#include "qos.h" + +DECLARE_GLOBAL_DATA_PTR; + +struct pin_db { + u32 addr; /* register address */ + u32 mask; /* mask value */ + u32 val; /* setting value */ +}; + +#define PMMR 0xE6060000 +#define GPSR0 0xE6060004 +#define GPSR1 0xE6060008 +#define GPSR4 0xE6060014 +#define GPSR5 0xE6060018 +#define GPSR6 0xE606001C +#define GPSR7 0xE6060020 +#define GPSR8 0xE6060024 +#define GPSR9 0xE6060028 +#define GPSR10 0xE606002C +#define GPSR11 0xE6060030 +#define IPSR6 0xE6060058 +#define PUPR2 0xE6060108 +#define PUPR3 0xE606010C +#define PUPR4 0xE6060110 +#define PUPR5 0xE6060114 +#define PUPR7 0xE606011C +#define PUPR9 0xE6060124 +#define PUPR10 0xE6060128 +#define PUPR11 0xE606012C + +#define CPG_PLL1CR 0xE6150028 +#define CPG_PLL3CR 0xE61500DC + +#define SetREG(x) \ + writel((readl((x)->addr) & ~((x)->mask)) | ((x)->val), (x)->addr) + +#define SetGuardREG(x) \ +{ \ + u32 val; \ + val = (readl((x)->addr) & ~((x)->mask)) | ((x)->val); \ + writel(~val, PMMR); \ + writel(val, (x)->addr); \ +} + +struct pin_db pin_guard[] = { + { GPSR0, 0xFFFFFFFF, 0x0BFFFFFF }, + { GPSR1, 0xFFFFFFFF, 0x002FFFFF }, + { GPSR4, 0xFFFFFFFF, 0x00000FFF }, + { GPSR5, 0xFFFFFFFF, 0x00010FFF }, + { GPSR6, 0xFFFFFFFF, 0x00010FFF }, + { GPSR7, 0xFFFFFFFF, 0x00010FFF }, + { GPSR8, 0xFFFFFFFF, 0x00010FFF }, + { GPSR9, 0xFFFFFFFF, 0x00010FFF }, + { GPSR10, 0xFFFFFFFF, 0x04006000 }, + { GPSR11, 0xFFFFFFFF, 0x303FEFE0 }, + { IPSR6, 0xFFFFFFFF, 0x0002000E }, +}; + +struct pin_db pin_tbl[] = { + { PUPR2, 0xFFFFFFFF, 0x00000000 }, + { PUPR3, 0xFFFFFFFF, 0x0803FF40 }, + { PUPR4, 0xFFFFFFFF, 0x0000FFFF }, + { PUPR5, 0xFFFFFFFF, 0x00010FFF }, + { PUPR7, 0xFFFFFFFF, 0x0001AFFF }, + { PUPR9, 0xFFFFFFFF, 0x0001CFFF }, + { PUPR10, 0xFFFFFFFF, 0xC0438001 }, + { PUPR11, 0xFFFFFFFF, 0x0FC00007 }, +}; + +void pin_init(void) +{ + struct pin_db *db; + + for (db = pin_guard; db < &pin_guard[sizeof(pin_guard)/sizeof(struct pin_db)]; db++) { + SetGuardREG(db); + } + for (db = pin_tbl; db < &pin_tbl[sizeof(pin_tbl) /sizeof(struct pin_db)]; db++) { + SetREG(db); + } +} + +#define s_init_wait(cnt) \ + ({ \ + volatile u32 i = 0x10000 * cnt; \ + while (i > 0) \ + i--; \ + }) + +void s_init(void) +{ + struct rcar_rwdt *rwdt = (struct rcar_rwdt *)RWDT_BASE; + struct rcar_swdt *swdt = (struct rcar_swdt *)SWDT_BASE; + u32 cpu_type; + + cpu_type = rmobile_get_cpu_type(); + if (cpu_type == 0x4A) { + writel(0x4D000000, CPG_PLL1CR); + writel(0x4F000000, CPG_PLL3CR); + } + + /* Watchdog init */ + writel(0xA5A5A500, &rwdt->rwtcsra); + writel(0xA5A5A500, &swdt->swtcsra); + + /* QoS(Quality-of-Service) Init */ + qos_init(); + + /* SCIF Init */ + pin_init(); + +#if !defined(CONFIG_SYS_NO_FLASH) + struct rcar_lbsc *lbsc = (struct rcar_lbsc *)LBSC_BASE; + struct rcar_dbsc3 *dbsc3_0 = (struct rcar_dbsc3 *)DBSC3_0_BASE; + + /* LBSC */ + writel(0x00000020, &lbsc->cs0ctrl); + writel(0x00000020, &lbsc->cs1ctrl); + writel(0x00002020, &lbsc->ecs0ctrl); + writel(0x00002020, &lbsc->ecs1ctrl); + + writel(0x2A103320, &lbsc->cswcr0); + writel(0x2A103320, &lbsc->cswcr1); + writel(0x19102110, &lbsc->ecswcr0); + writel(0x19102110, &lbsc->ecswcr1); + + /* DBSC3 */ + s_init_wait(10); + + writel(0x0000A55A, &dbsc3_0->dbpdlck); + + writel(0x21000000, &dbsc3_0->dbcmd); /* opc=RstH (RESET => H) */ + writel(0x11000000, &dbsc3_0->dbcmd); /* opc=PDXt(CKE=H) */ + writel(0x10000000, &dbsc3_0->dbcmd); /* opc=PDEn(CKE=L) */ + + /* Stop Auto-Calibration */ + writel(0x00000001, &dbsc3_0->dbpdrga); + writel(0x80000000, &dbsc3_0->dbpdrgd); + + writel(0x00000004, &dbsc3_0->dbpdrga); + while ((readl(&dbsc3_0->dbpdrgd) & 0x00000001) != 0x00000001); + + /* PLLCR: PLL Control Register */ + writel(0x00000006, &dbsc3_0->dbpdrga); + writel(0x0001C000, &dbsc3_0->dbpdrgd); // > DDR1440 + + /* DXCCR: DATX8 Common Configuration Register */ + writel(0x0000000F, &dbsc3_0->dbpdrga); + writel(0x00181EE4, &dbsc3_0->dbpdrgd); + + /* DSGCR :DDR System General Configuration Register */ + writel(0x00000010, &dbsc3_0->dbpdrga); + writel(0xF00464DB, &dbsc3_0->dbpdrgd); + + writel(0x00000061, &dbsc3_0->dbpdrga); + writel(0x0000008D, &dbsc3_0->dbpdrgd); + + /* Re-Execute ZQ calibration */ + writel(0x00000001, &dbsc3_0->dbpdrga); + writel(0x00000073, &dbsc3_0->dbpdrgd); + + writel(0x00000007, &dbsc3_0->dbkind); + writel(0x0F030A02, &dbsc3_0->dbconf0); + writel(0x00000001, &dbsc3_0->dbphytype); + writel(0x00000000, &dbsc3_0->dbbl); + + writel(0x0000000B, &dbsc3_0->dbtr0); // tCL=11 + writel(0x00000008, &dbsc3_0->dbtr1); // tCWL=8 + writel(0x00000000, &dbsc3_0->dbtr2); // tAL=0 + writel(0x0000000B, &dbsc3_0->dbtr3); // tRCD=11 + writel(0x000C000B, &dbsc3_0->dbtr4); // tRPA=12,tRP=11 + writel(0x00000027, &dbsc3_0->dbtr5); // tRC = 39 + writel(0x0000001C, &dbsc3_0->dbtr6); // tRAS = 28 + writel(0x00000006, &dbsc3_0->dbtr7); // tRRD = 6 + writel(0x00000020, &dbsc3_0->dbtr8); // tRFAW = 32 + writel(0x00000008, &dbsc3_0->dbtr9); // tRDPR = 8 + writel(0x0000000C, &dbsc3_0->dbtr10); // tWR = 12 + writel(0x00000009, &dbsc3_0->dbtr11); // tRDWR = 9 + writel(0x00000012, &dbsc3_0->dbtr12); // tWRRD = 18 + writel(0x000000D0, &dbsc3_0->dbtr13); // tRFC = 208 + writel(0x00140005, &dbsc3_0->dbtr14); + writel(0x00050004, &dbsc3_0->dbtr15); + writel(0x70233005, &dbsc3_0->dbtr16); /* DQL = 35, WDQL = 5 */ + writel(0x000C0000, &dbsc3_0->dbtr17); + writel(0x00000300, &dbsc3_0->dbtr18); + writel(0x00000040, &dbsc3_0->dbtr19); + writel(0x00000001, &dbsc3_0->dbrnk0); + writel(0x00020001, &dbsc3_0->dbadj0); + writel(0x20082004, &dbsc3_0->dbadj2); /* blanche QoS rev0.1 */ + writel(0x00020002, &dbsc3_0->dbwt0cnf0); /* 1600 */ + writel(0x0000001F, &dbsc3_0->dbwt0cnf4); + + while ((readl(&dbsc3_0->dbdfistat) & 0x00000001) != 0x00000001); + writel(0x00000011, &dbsc3_0->dbdficnt); + + /* PGCR1 :PHY General Configuration Register 1 */ + writel(0x00000003, &dbsc3_0->dbpdrga); + writel(0x0300C4E1, &dbsc3_0->dbpdrgd); /* DDR3 */ + + /* PGCR2: PHY General Configuration Registers 2 */ + writel(0x00000023, &dbsc3_0->dbpdrga); + writel(0x00FCDB60, &dbsc3_0->dbpdrgd); + + writel(0x00000011, &dbsc3_0->dbpdrga); + writel(0x1000040B, &dbsc3_0->dbpdrgd); + + /* DTPR0 :DRAM Timing Parameters Register 0 */ + writel(0x00000012, &dbsc3_0->dbpdrga); + writel(0x9D9CBB66, &dbsc3_0->dbpdrgd); + + /* DTPR1 :DRAM Timing Parameters Register 1 */ + writel(0x00000013, &dbsc3_0->dbpdrga); + writel(0x1A868400, &dbsc3_0->dbpdrgd); + + /* DTPR2 ::DRAM Timing Parameters Register 2 */ + writel(0x00000014, &dbsc3_0->dbpdrga); + writel(0x300214D8, &dbsc3_0->dbpdrgd); + + /* MR0 :Mode Register 0 */ + writel(0x00000015, &dbsc3_0->dbpdrga); + writel(0x00000D70, &dbsc3_0->dbpdrgd); + + /* MR1 :Mode Register 1 */ + writel(0x00000016, &dbsc3_0->dbpdrga); + writel(0x00000004, &dbsc3_0->dbpdrgd); /* DRAM Drv 40ohm */ + + /* MR2 :Mode Register 2 */ + writel(0x00000017, &dbsc3_0->dbpdrga); + writel(0x00000018, &dbsc3_0->dbpdrgd); /* CWL=8 */ + + /* VREF(ZQCAL) */ + writel(0x0000001A, &dbsc3_0->dbpdrga); + writel(0x910035C7, &dbsc3_0->dbpdrgd); + + /* PGSR0 :PHY General Status Registers 0 */ + writel(0x00000004, &dbsc3_0->dbpdrga); + while ((readl(&dbsc3_0->dbpdrgd) & 0x00000001) != 0x00000001); + + /* DRAM Init (set MRx etc) */ + writel(0x00000001, &dbsc3_0->dbpdrga); + writel(0x00000181, &dbsc3_0->dbpdrgd); + + /* CKE = H */ + writel(0x11000000, &dbsc3_0->dbcmd); /* opc=PDXt(CKE=H) */ + + /* PGSR0 :PHY General Status Registers 0 */ + writel(0x00000004, &dbsc3_0->dbpdrga); + while ((readl(&dbsc3_0->dbpdrgd) & 0x00000001) != 0x00000001); + + /* RAM ACC Training */ + writel(0x00000001, &dbsc3_0->dbpdrga); + writel(0x0000FE01, &dbsc3_0->dbpdrgd); + + /* Bus control 0 */ + writel(0x00000000, &dbsc3_0->dbbs0cnt1); + /* DDR3 Calibration set */ + writel(0x01004C20, &dbsc3_0->dbcalcnf); + /* DDR3 Calibration timing */ + writel(0x014000AA, &dbsc3_0->dbcaltr); + /* Refresh */ + writel(0x00000140, &dbsc3_0->dbrfcnf0); + writel(0x00081860, &dbsc3_0->dbrfcnf1); + writel(0x00010000, &dbsc3_0->dbrfcnf2); + + /* PGSR0 :PHY General Status Registers 0 */ + writel(0x00000004, &dbsc3_0->dbpdrga); + while ((readl(&dbsc3_0->dbpdrgd) & 0x00000001) != 0x00000001); + + /* Enable Auto-Refresh */ + writel(0x00000001, &dbsc3_0->dbrfen); + /* Permit DDR-Access */ + writel(0x00000001, &dbsc3_0->dbacen); + + /* This locks the access to the PHY unit registers */ + writel(0x00000000, &dbsc3_0->dbpdlck); +#endif /* CONFIG_SYS_NO_FLASH */ + +} + +#define TMU0_MSTP125 (1 << 25) +#define SCIF0_MSTP721 (1 << 21) +#define SDHI0_MSTP314 (1 << 14) +#define QSPI_MSTP917 (1 << 17) + +int board_early_init_f(void) +{ + /* TMU0 */ + mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125); + /* SCIF0 */ + mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP721); + /* SDHI0 */ + mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SDHI0_MSTP314); + /* QSPI */ + mstp_clrbits_le32(MSTPSR9, SMSTPCR9, QSPI_MSTP917); + + return 0; +} + +DECLARE_GLOBAL_DATA_PTR; +int board_init(void) +{ + /* adress of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + /* Init PFC controller */ + r8a7792_pinmux_init(); + + gpio_request(GPIO_FN_D0, NULL); + gpio_request(GPIO_FN_D1, NULL); + gpio_request(GPIO_FN_D2, NULL); + gpio_request(GPIO_FN_D3, NULL); + gpio_request(GPIO_FN_D4, NULL); + gpio_request(GPIO_FN_D5, NULL); + gpio_request(GPIO_FN_D6, NULL); + gpio_request(GPIO_FN_D7, NULL); + gpio_request(GPIO_FN_D8, NULL); + gpio_request(GPIO_FN_D9, NULL); + gpio_request(GPIO_FN_D10, NULL); + gpio_request(GPIO_FN_D11, NULL); + gpio_request(GPIO_FN_D12, NULL); + gpio_request(GPIO_FN_D13, NULL); + gpio_request(GPIO_FN_D14, NULL); + gpio_request(GPIO_FN_D15, NULL); + gpio_request(GPIO_FN_A0, NULL); + gpio_request(GPIO_FN_A1, NULL); + gpio_request(GPIO_FN_A2, NULL); + gpio_request(GPIO_FN_A3, NULL); + gpio_request(GPIO_FN_A4, NULL); + gpio_request(GPIO_FN_A5, NULL); + gpio_request(GPIO_FN_A6, NULL); + gpio_request(GPIO_FN_A7, NULL); + gpio_request(GPIO_FN_A8, NULL); + gpio_request(GPIO_FN_A9, NULL); + gpio_request(GPIO_FN_A10, NULL); + gpio_request(GPIO_FN_A11, NULL); + gpio_request(GPIO_FN_A12, NULL); + gpio_request(GPIO_FN_A13, NULL); + gpio_request(GPIO_FN_A14, NULL); + gpio_request(GPIO_FN_A15, NULL); + gpio_request(GPIO_FN_A16, NULL); + gpio_request(GPIO_FN_A17, NULL); + gpio_request(GPIO_FN_A18, NULL); + gpio_request(GPIO_FN_A19, NULL); +#if defined(CONFIG_SYS_NO_FLASH) + gpio_request(GPIO_FN_MOSI_IO0, NULL); + gpio_request(GPIO_FN_MISO_IO1, NULL); + gpio_request(GPIO_FN_IO2, NULL); + gpio_request(GPIO_FN_IO3, NULL); + gpio_request(GPIO_FN_SPCLK, NULL); + gpio_request(GPIO_FN_SSL, NULL); +#else /* CONFIG_SYS_NO_FLASH */ + gpio_request(GPIO_FN_A20, NULL); + gpio_request(GPIO_FN_A21, NULL); + gpio_request(GPIO_FN_A22, NULL); + gpio_request(GPIO_FN_A23, NULL); + gpio_request(GPIO_FN_A24, NULL); + gpio_request(GPIO_FN_A25, NULL); +#endif /* CONFIG_SYS_NO_FLASH */ + + gpio_request(GPIO_FN_CS1_A26, NULL); + gpio_request(GPIO_FN_EX_CS0, NULL); + gpio_request(GPIO_FN_EX_CS1, NULL); + gpio_request(GPIO_FN_BS, NULL); + gpio_request(GPIO_FN_RD, NULL); + gpio_request(GPIO_FN_WE0, NULL); + gpio_request(GPIO_FN_WE1, NULL); + gpio_request(GPIO_FN_EX_WAIT0, NULL); + gpio_request(GPIO_FN_IRQ0, NULL); + gpio_request(GPIO_FN_IRQ2, NULL); + gpio_request(GPIO_FN_IRQ3, NULL); + gpio_request(GPIO_FN_CS0, NULL); + + /* Init timer */ + timer_init(); + + return 0; +} + +/* + Added for BLANCHE(R-CarV2H board) +*/ +int board_eth_init(bd_t *bis) +{ + int rc = 0; + +#ifdef CONFIG_SMC911X +#define STR_ENV_ETHADDR "ethaddr" + + struct eth_device *dev; + uchar eth_addr[6]; + + rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); + + if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + dev = eth_get_dev_by_index(0); + if (dev) { + eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + } else { + printf("blanche: Couldn't get eth device\n"); + rc = -1; + } + } + +#endif + + return rc; +} + +int board_mmc_init(bd_t *bis) +{ + int ret = -ENODEV; + +#ifdef CONFIG_SH_SDHI + gpio_request(GPIO_FN_SD0_DAT0, NULL); + gpio_request(GPIO_FN_SD0_DAT1, NULL); + gpio_request(GPIO_FN_SD0_DAT2, NULL); + gpio_request(GPIO_FN_SD0_DAT3, NULL); + gpio_request(GPIO_FN_SD0_CLK, NULL); + gpio_request(GPIO_FN_SD0_CMD, NULL); + gpio_request(GPIO_FN_SD0_CD, NULL); + + gpio_request(GPIO_GP_11_12, NULL); + gpio_direction_output(GPIO_GP_11_12, 1); /* power on */ + + + ret = sh_sdhi_init(CONFIG_SYS_SH_SDHI0_BASE, 0, + SH_SDHI_QUIRK_16BIT_BUF); + + if (ret) + return ret; +#endif + return ret; +} + +int dram_init(void) +{ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + + return 0; +} + +const struct rmobile_sysinfo sysinfo = { + CONFIG_RMOBILE_BOARD_STRING +}; + +void reset_cpu(ulong addr) +{ +} + +static const struct sh_serial_platdata serial_platdata = { + .base = SCIF0_BASE, + .type = PORT_SCIF, + .clk = 14745600, + .clk_mode = EXT_CLK, +}; + +U_BOOT_DEVICE(blanche_serials) = { + .name = "serial_sh", + .platdata = &serial_platdata, +}; diff --git a/board/renesas/blanche/qos.c b/board/renesas/blanche/qos.c new file mode 100644 index 0000000..f1327f6 --- /dev/null +++ b/board/renesas/blanche/qos.c @@ -0,0 +1,1366 @@ +/* + * board/renesas/blanche/qos.c + * + * Copyright (C) 2016 Renesas Electronics Corporation + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include <common.h> +#include <asm/processor.h> +#include <asm/mach-types.h> +#include <asm/io.h> +#include <asm/arch/rmobile.h> + +#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +enum { + DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, + DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, + DBSC3_10, DBSC3_11, DBSC3_12, DBSC3_13, DBSC3_14, + DBSC3_15, + DBSC3_NR, +}; + +static u32 dbsc3_0_r_qos_addr[DBSC3_NR] = { + [DBSC3_00] = DBSC3_0_QOS_R0_BASE, + [DBSC3_01] = DBSC3_0_QOS_R1_BASE, + [DBSC3_02] = DBSC3_0_QOS_R2_BASE, + [DBSC3_03] = DBSC3_0_QOS_R3_BASE, + [DBSC3_04] = DBSC3_0_QOS_R4_BASE, + [DBSC3_05] = DBSC3_0_QOS_R5_BASE, + [DBSC3_06] = DBSC3_0_QOS_R6_BASE, + [DBSC3_07] = DBSC3_0_QOS_R7_BASE, + [DBSC3_08] = DBSC3_0_QOS_R8_BASE, + [DBSC3_09] = DBSC3_0_QOS_R9_BASE, + [DBSC3_10] = DBSC3_0_QOS_R10_BASE, + [DBSC3_11] = DBSC3_0_QOS_R11_BASE, + [DBSC3_12] = DBSC3_0_QOS_R12_BASE, + [DBSC3_13] = DBSC3_0_QOS_R13_BASE, + [DBSC3_14] = DBSC3_0_QOS_R14_BASE, + [DBSC3_15] = DBSC3_0_QOS_R15_BASE, +}; + +static u32 dbsc3_0_w_qos_addr[DBSC3_NR] = { + [DBSC3_00] = DBSC3_0_QOS_W0_BASE, + [DBSC3_01] = DBSC3_0_QOS_W1_BASE, + [DBSC3_02] = DBSC3_0_QOS_W2_BASE, + [DBSC3_03] = DBSC3_0_QOS_W3_BASE, + [DBSC3_04] = DBSC3_0_QOS_W4_BASE, + [DBSC3_05] = DBSC3_0_QOS_W5_BASE, + [DBSC3_06] = DBSC3_0_QOS_W6_BASE, + [DBSC3_07] = DBSC3_0_QOS_W7_BASE, + [DBSC3_08] = DBSC3_0_QOS_W8_BASE, + [DBSC3_09] = DBSC3_0_QOS_W9_BASE, + [DBSC3_10] = DBSC3_0_QOS_W10_BASE, + [DBSC3_11] = DBSC3_0_QOS_W11_BASE, + [DBSC3_12] = DBSC3_0_QOS_W12_BASE, + [DBSC3_13] = DBSC3_0_QOS_W13_BASE, + [DBSC3_14] = DBSC3_0_QOS_W14_BASE, + [DBSC3_15] = DBSC3_0_QOS_W15_BASE, +}; + +void qos_init(void) +{ + int i; + struct rcar_s3c *s3c; + struct rcar_s3c_qos *s3c_qos; + struct rcar_dbsc3_qos *qos_addr; + struct rcar_mxi *mxi; + struct rcar_mxi_qos *mxi_qos; + struct rcar_axi_qos *axi_qos; + + /* DBSC DBADJ2 */ + writel(0x20082004, DBSC3_0_DBADJ2); + + /* S3C -QoS */ + s3c = (struct rcar_s3c *)S3C_BASE; + // writel(0x00000000, &s3c->s3cadsplcr); + writel(0x1F0D0C0C, &s3c->s3crorr); + writel(0x1F1F0C0C, &s3c->s3cworr); + + /* QoS Control Registers */ + s3c_qos = (struct rcar_s3c_qos *)S3C_QOS_CCI0_BASE; + writel(0x00890089, &s3c_qos->s3cqos0); + writel(0x20960010, &s3c_qos->s3cqos1); + writel(0x20302030, &s3c_qos->s3cqos2); + writel(0x20AA2200, &s3c_qos->s3cqos3); + writel(0x00002032, &s3c_qos->s3cqos4); + writel(0x20960010, &s3c_qos->s3cqos5); + writel(0x20302030, &s3c_qos->s3cqos6); + writel(0x20AA2200, &s3c_qos->s3cqos7); + writel(0x00002032, &s3c_qos->s3cqos8); + + s3c_qos = (struct rcar_s3c_qos *)S3C_QOS_CCI1_BASE; + writel(0x00890089, &s3c_qos->s3cqos0); + writel(0x20960010, &s3c_qos->s3cqos1); + writel(0x20302030, &s3c_qos->s3cqos2); + writel(0x20AA2200, &s3c_qos->s3cqos3); + writel(0x00002032, &s3c_qos->s3cqos4); + writel(0x20960010, &s3c_qos->s3cqos5); + writel(0x20302030, &s3c_qos->s3cqos6); + writel(0x20AA2200, &s3c_qos->s3cqos7); + writel(0x00002032, &s3c_qos->s3cqos8); + + s3c_qos = (struct rcar_s3c_qos *)S3C_QOS_MXI_BASE; + writel(0x00820082, &s3c_qos->s3cqos0); + writel(0x20960020, &s3c_qos->s3cqos1); + writel(0x20302030, &s3c_qos->s3cqos2); + writel(0x20AA20DC, &s3c_qos->s3cqos3); + writel(0x00002032, &s3c_qos->s3cqos4); + writel(0x20960020, &s3c_qos->s3cqos5); + writel(0x20302030, &s3c_qos->s3cqos6); + writel(0x20AA20DC, &s3c_qos->s3cqos7); + writel(0x00002032, &s3c_qos->s3cqos8); + + s3c_qos = (struct rcar_s3c_qos *)S3C_QOS_AXI_BASE; + writel(0x80918099, &s3c_qos->s3cqos0); + writel(0x20410010, &s3c_qos->s3cqos1); + writel(0x200A2023, &s3c_qos->s3cqos2); + writel(0x20502001, &s3c_qos->s3cqos3); + writel(0x00002032, &s3c_qos->s3cqos4); + writel(0x20410FFF, &s3c_qos->s3cqos5); + writel(0x200A2023, &s3c_qos->s3cqos6); + writel(0x20502001, &s3c_qos->s3cqos7); + writel(0x20142032, &s3c_qos->s3cqos8); + + /* DBSC -QoS */ + /* DBSC0 - Read */ + for (i = DBSC3_00; i < DBSC3_NR; i++) { + qos_addr = (struct rcar_dbsc3_qos *)dbsc3_0_r_qos_addr[i]; + writel(0x00000002, &qos_addr->dblgcnt); + writel(0x00002096, &qos_addr->dbtmval0); + writel(0x00002064, &qos_addr->dbtmval1); + writel(0x00002032, &qos_addr->dbtmval2); + writel(0x00001FB0, &qos_addr->dbtmval3); + writel(0x00000001, &qos_addr->dbrqctr); + writel(0x0000204B, &qos_addr->dbthres0); + writel(0x0000204B, &qos_addr->dbthres1); + writel(0x00001FC4, &qos_addr->dbthres2); + writel(0x00000001, &qos_addr->dblgqon); + } + + /* DBSC0 - Write */ + for (i = DBSC3_00; i < DBSC3_NR; i++) { + qos_addr = (struct rcar_dbsc3_qos *)dbsc3_0_w_qos_addr[i]; + writel(0x00000002, &qos_addr->dblgcnt); + writel(0x00002096, &qos_addr->dbtmval0); + writel(0x0000206E, &qos_addr->dbtmval1); + writel(0x00002050, &qos_addr->dbtmval2); + writel(0x0000203A, &qos_addr->dbtmval3); + writel(0x00000001, &qos_addr->dbrqctr); + writel(0x0000205A, &qos_addr->dbthres0); + writel(0x0000205A, &qos_addr->dbthres1); + writel(0x0000203C, &qos_addr->dbthres2); + writel(0x00000001, &qos_addr->dblgqon); + } + + /* MXI -QoS */ + /* Transaction Control (MXI) */ + mxi = (struct rcar_mxi *)MXI_BASE; + writel(0x00000100, &mxi->mxaxirtcr); + writel(0xFF530100, &mxi->mxaxiwtcr); + writel(0x00000100, &mxi->mxs3crtcr); + writel(0xFF530100, &mxi->mxs3cwtcr); + writel(0x004000C0, &mxi->mxsaar0); + writel(0x02000800, &mxi->mxsaar1); + + /* QoS Control (MXI) */ + mxi_qos = (struct rcar_mxi_qos *)MXI_QOS_BASE; + writel(0x0000000C, &mxi_qos->du0); + + /* AXI -QoS */ + /* Transaction Control (MXI) */ + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SYX64TO128_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_AVB_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CC50_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002029, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CCI_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CS_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_G2D_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x000020A6, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMP1_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x000020A6, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMUX0_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMUX1_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_LBS_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_MMUDS_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_MMUM_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_MMUS0_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_MMUS1_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_RTX_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDM0_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDM1_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDS0_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDS1_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_TRAB_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x000020A6, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_ADM_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_ADS_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SYX_BASE; + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_AXI64TO128W_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_AVBW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CC50W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002029, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CCIW_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_CCSW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_G2DW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x000020A6, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMUX0W_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMUX1W_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_IMUX2W_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_LBSW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_RTXBW_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDM0W_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDM1W_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDS0W_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SDS1W_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_TRABW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x000020A6, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_ADMW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_ADSW_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000214C, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI_SYXW_BASE; + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + + /* QoS Register (SYS-AXI256) */ + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_AXI128TO256_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_AXI_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_MXI_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_IMP0_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000211B, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_SY2_BASE; + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256W_AXI128TO256_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_AXMW_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_MXIW_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_IMP0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002029, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00000001, &axi_qos->qosqon); + writel(0x00000005, &axi_qos->qosin); + + axi_qos = (struct rcar_axi_qos *)SYS_AXI256_SY2W_BASE; + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + + /* QoS Register (RT-AXI) */ + axi_qos = (struct rcar_axi_qos *)RT_AXI_SHX_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002055, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_DBG_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002055, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_RTX64TO128_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002001, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_RT_BASE; + writel(0x00002001, &axi_qos->qosctset1); + writel(0x00002001, &axi_qos->qosctset2); + writel(0x00002001, &axi_qos->qosctset3); + writel(0x00000000, &axi_qos->qosthres0); + writel(0x00000000, &axi_qos->qosthres1); + writel(0x00000000, &axi_qos->qosthres2); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_SHXW_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002055, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_DBGW_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002055, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_RTX64TO128W_BASE; + writel(0x00000000, &axi_qos->qosconf); + writel(0x00002001, &axi_qos->qosctset0); + writel(0x00000000, &axi_qos->qosreqctr); + writel(0x00000000, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)RT_AXI_RTW_BASE; + writel(0x00002001, &axi_qos->qosctset1); + writel(0x00002001, &axi_qos->qosctset2); + writel(0x00002001, &axi_qos->qosctset3); + writel(0x00000000, &axi_qos->qosthres0); + writel(0x00000000, &axi_qos->qosthres1); + writel(0x00000000, &axi_qos->qosthres2); + + /* QoS Register (CCI-AXI) */ + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUS0_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_SYX2_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUR_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000000A, &axi_qos->qosctset3); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002018, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUDS_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUM_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MXI_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x0000205F, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUS1_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)CCI_AXI_MMUMP_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002008, &axi_qos->qosctset0); + writel(0x00002041, &axi_qos->qosctset1); + writel(0x00002023, &axi_qos->qosctset2); + writel(0x0000200A, &axi_qos->qosctset3); + writel(0x00000010, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + /* QoS Register (Media-AXI) */ + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_MXR_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x000020DC, &axi_qos->qosctset0); + writel(0x00002096, &axi_qos->qosctset1); + writel(0x00002030, &axi_qos->qosctset2); + writel(0x00002030, &axi_qos->qosctset3); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x000020AA, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00000001, &axi_qos->qosthres2); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_MXW_BASE; + writel(0x00000102, &axi_qos->qosconf); + writel(0x000020DC, &axi_qos->qosctset0); + writel(0x00002096, &axi_qos->qosctset1); + writel(0x00002030, &axi_qos->qosctset2); + writel(0x00002030, &axi_qos->qosctset3); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x000020AA, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00000001, &axi_qos->qosthres2); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_JPR_BASE; + writel(0x00000001, &axi_qos->qosconf); + writel(0x00002018, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00002006, &axi_qos->qosthres0); + writel(0x00002001, &axi_qos->qosthres1); + writel(0x00000001, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_JPW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002259, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VCTU0R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VCTU0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VDCTU0R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VDCTU0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VDCTU1R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VDCTU1W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002053, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VIN0W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002046, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VIN1W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002046, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_RDRW_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x000020D0, &axi_qos->qosctset0); + writel(0x00000020, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS01R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002034, &axi_qos->qosctset0); + writel(0x0000000C, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS01W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000200D, &axi_qos->qosctset0); + writel(0x000000C0, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS23R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002034, &axi_qos->qosctset0); + writel(0x0000000C, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS23W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000200D, &axi_qos->qosctset0); + writel(0x000000C0, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS45R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002034, &axi_qos->qosctset0); + writel(0x0000000C, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMS45W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000200D, &axi_qos->qosctset0); + writel(0x000000C0, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMRR_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002069, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_IMRW_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002069, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE4R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000204C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE4W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002200, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC4R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC4W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSPD0R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002034, &axi_qos->qosctset0); + writel(0x00000008, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSPD0W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x000020D3, &axi_qos->qosctset0); + writel(0x00000008, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSPD1R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002034, &axi_qos->qosctset0); + writel(0x00000008, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSPD1W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x000020D3, &axi_qos->qosctset0); + writel(0x00000008, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_DU0R_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x0000201A, &axi_qos->qosctset0); + writel(0x00000018, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_DU0W_BASE; + writel(0x00000101, &axi_qos->qosconf); + writel(0x00002006, &axi_qos->qosctset0); + writel(0x00000018, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSP0R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000201A, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_VSP0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002042, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE0R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000204C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002200, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC0R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC0W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE1R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000204C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE1W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002200, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC1R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC1W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE2R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000204C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE2W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002200, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC2R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC2W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE3R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x0000204C, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTCE3W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002200, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC3R_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + axi_qos = (struct rcar_axi_qos *)MEDIA_AXI_ROTVLC3W_BASE; + writel(0x00000100, &axi_qos->qosconf); + writel(0x00002455, &axi_qos->qosctset0); + writel(0x00000001, &axi_qos->qosreqctr); + writel(0x00002050, &axi_qos->qosthres0); + writel(0x00002032, &axi_qos->qosthres1); + writel(0x00002014, &axi_qos->qosthres2); + writel(0x00000001, &axi_qos->qosqon); + + /* DMS Register(SYS-AXI) */ + writel(0x00000000, SYS_AXI_AVBDMSCR); + writel(0x00000000, SYS_AXI_AX2MDMSCR); + writel(0x00000000, SYS_AXI_CC50DMSCR); + writel(0x00000000, SYS_AXI_CCIDMSCR); + writel(0x00000000, SYS_AXI_CSDMSCR); + writel(0x00000000, SYS_AXI_G2DDMSCR); + writel(0x00000000, SYS_AXI_IMP1DMSCR); + writel(0x00000000, SYS_AXI_LBSMDMSCR); + writel(0x00000000, SYS_AXI_MMUDSDMSCR); + writel(0x00000000, SYS_AXI_MMUMXDMSCR); + writel(0x00000000, SYS_AXI_MMUS0DMSCR); + writel(0x00000000, SYS_AXI_MMUS1DMSCR); + writel(0x00000000, SYS_AXI_RTMXDMSCR); + writel(0x00000000, SYS_AXI_SDM0DMSCR); + writel(0x00000000, SYS_AXI_SDM1DMSCR); + writel(0x00000000, SYS_AXI_SDS0DMSCR); + writel(0x00000000, SYS_AXI_SDS1DMSCR); + writel(0x00000000, SYS_AXI_TRABDMSCR); + writel(0x00000000, SYS_AXI_X128TO64SLVDMSCR); + writel(0x00000000, SYS_AXI_X64TO128SLVDMSCR); + writel(0x00000000, SYS_AXI_AVBSLVDMSCR); + writel(0x00000000, SYS_AXI_AX2SLVDMSCR); + writel(0x00000000, SYS_AXI_GICSLVDMSCR); + writel(0x00000000, SYS_AXI_IMPSLVDMSCR); + writel(0x00000000, SYS_AXI_IMPSLVDMSCR); + writel(0x00000000, SYS_AXI_IMX0SLVDMSCR); + writel(0x00000000, SYS_AXI_IMX1SLVDMSCR); + writel(0x00000000, SYS_AXI_IMX2SLVDMSCR); + writel(0x00000000, SYS_AXI_LBSSLVDMSCR); + writel(0x00000000, SYS_AXI_MXTSLVDMSCR); + writel(0x00000000, SYS_AXI_SYAPBSLVDMSCR); + writel(0x00000000, SYS_AXI_QSAPBSLVDMSCR); + writel(0x00000000, SYS_AXI_RTXSLVDMSCR); + writel(0x00000000, SYS_AXI_SAPC1SLVDMSCR); + writel(0x00000000, SYS_AXI_SAPC2SLVDMSCR); + writel(0x00000000, SYS_AXI_SAPC3SLVDMSCR); + writel(0x00000000, SYS_AXI_SAPC65SLVDMSCR); + writel(0x00000000, SYS_AXI_SAPC8SLVDMSCR); + writel(0x00000000, SYS_AXI_SDAP0SLVDMSCR); + writel(0x00000000, SYS_AXI_SGXSLV1SLVDMSCR); + writel(0x00000000, SYS_AXI_STBSLVDMSCR); + writel(0x00000000, SYS_AXI_STMSLVDMSCR); + writel(0x00000000, SYS_AXI_SYXXDEFAULTSLAVESLVDMSCR); + writel(0x00000000, SYS_AXI_TSPL0SLVDMSCR); + writel(0x00000000, SYS_AXI_TSPL1SLVDMSCR); + writel(0x00000000, SYS_AXI_TSPL2SLVDMSCR); + writel(0x00000000, SYS_AXI_UTLBDSSLVDMSCR); + writel(0x00000000, SYS_AXI_UTLBS0SLVDMSCR); + writel(0x00000000, SYS_AXI_UTLBS1SLVDMSCR); + writel(0x00000000, SYS_AXI_ROT0DMSCR); + writel(0x00000000, SYS_AXI_ROT1DMSCR); + writel(0x00000000, SYS_AXI_ROT2DMSCR); + writel(0x00000000, SYS_AXI_ROT3DMSCR); + writel(0x00000000, SYS_AXI_ROT4DMSCR); + writel(0x00000000, SYS_AXI_IMUX3SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR0SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR0PSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR0XSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR1SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR1PSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR1XSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR2SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR2PSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR2XSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR3SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR3PSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR3XSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR4SLVDMSCR); + writel(0x00000000, SYS_AXI_STBR4PSLVDMSCR); + writel(0x00000000, SYS_AXI_STBR4XSLVDMSCR); + writel(0x00000000, SYS_AXI_ADM_DMSCR); + writel(0x00000000, SYS_AXI_ADS_DMSCR); + + /* DMS Register(RT-AXI) */ + writel(0x00000000, DM_AXI_DMAXICONF); + writel(0x00000019, DM_AXI_DMAPBCONF); + writel(0x00000000, DM_AXI_DMADMCONF); + writel(0x00000000, DM_AXI_DMSDM0CONF); + writel(0x00000000, DM_AXI_DMSDM1CONF); + writel(0x00000004, DM_AXI_DMQSPAPSLVCONF); + writel(0x00000004, DM_AXI_RAPD4SLVCONF); + writel(0x00000004, DM_AXI_SAPD4SLVCONF); + writel(0x00000004, DM_AXI_SAPD5SLVCONF); + writel(0x00000004, DM_AXI_SAPD6SLVCONF); + writel(0x00000004, DM_AXI_SAPD65DSLVCONF); + writel(0x00000004, DM_AXI_SDAP0SLVCONF); + writel(0x00000004, DM_AXI_MAPD2SLVCONF); + writel(0x00000004, DM_AXI_MAPD3SLVCONF); + writel(0x00000000, DM_AXI_DMXXDEFAULTSLAVESLVCONF); + writel(0x00000100, DM_AXI_DMADMRQOSCONF); + writel(0x0000214C, DM_AXI_DMADMRQOSCTSET0); + writel(0x00000001, DM_AXI_DMADMRQOSREQCTR); + writel(0x00000001, DM_AXI_DMADMRQOSQON); + writel(0x00000005, DM_AXI_DMADMRQOSIN); + writel(0x00000000, DM_AXI_DMADMRQOSSTAT); + writel(0x00000000, DM_AXI_DMSDM0RQOSCONF); + writel(0x0000214C, DM_AXI_DMSDM0RQOSCTSET0); + writel(0x00000001, DM_AXI_DMSDM0RQOSREQCTR); + writel(0x00000001, DM_AXI_DMSDM0RQOSQON); + writel(0x00000005, DM_AXI_DMSDM0RQOSIN); + writel(0x00000000, DM_AXI_DMSDM0RQOSSTAT); + writel(0x00000000, DM_AXI_DMSDM1RQOSCONF); + writel(0x0000214C, DM_AXI_DMSDM1RQOSCTSET0); + writel(0x00000001, DM_AXI_DMSDM1RQOSREQCTR); + writel(0x00000001, DM_AXI_DMSDM1RQOSQON); + writel(0x00000005, DM_AXI_DMSDM1RQOSIN); + writel(0x00000000, DM_AXI_DMSDM1RQOSSTAT); + writel(0x00002041, DM_AXI_DMRQOSCTSET1); + writel(0x00002023, DM_AXI_DMRQOSCTSET2); + writel(0x0000200A, DM_AXI_DMRQOSCTSET3); + writel(0x00002050, DM_AXI_DMRQOSTHRES0); + writel(0x00002032, DM_AXI_DMRQOSTHRES1); + writel(0x00002014, DM_AXI_DMRQOSTHRES2); + writel(0x00000100, DM_AXI_DMADMWQOSCONF); + writel(0x0000214C, DM_AXI_DMADMWQOSCTSET0); + writel(0x00000001, DM_AXI_DMADMWQOSREQCTR); + writel(0x00000001, DM_AXI_DMADMWQOSQON); + writel(0x00000005, DM_AXI_DMADMWQOSIN); + writel(0x00000000, DM_AXI_DMADMWQOSSTAT); + writel(0x00000000, DM_AXI_DMSDM0WQOSCONF); + writel(0x0000214C, DM_AXI_DMSDM0WQOSCTSET0); + writel(0x00000001, DM_AXI_DMSDM0WQOSREQCTR); + writel(0x00000001, DM_AXI_DMSDM0WQOSQON); + writel(0x00000005, DM_AXI_DMSDM0WQOSIN); + writel(0x00000000, DM_AXI_DMSDM0WQOSSTAT); + writel(0x00000000, DM_AXI_DMSDM1WQOSCONF); + writel(0x0000214C, DM_AXI_DMSDM1WQOSCTSET0); + writel(0x00000001, DM_AXI_DMSDM1WQOSREQCTR); + writel(0x00000001, DM_AXI_DMSDM1WQOSQON); + writel(0x00000005, DM_AXI_DMSDM1WQOSIN); + writel(0x00000000, DM_AXI_DMSDM1WQOSSTAT); + writel(0x00002041, DM_AXI_DMWQOSCTSET1); + writel(0x00002023, DM_AXI_DMWQOSCTSET2); + writel(0x0000200A, DM_AXI_DMWQOSCTSET3); + writel(0x00002050, DM_AXI_DMWQOSTHRES0); + writel(0x00002032, DM_AXI_DMWQOSTHRES1); + writel(0x00002014, DM_AXI_DMWQOSTHRES2); + writel(0x00000000, DM_AXI_RDMDMSCR); + writel(0x00000000, DM_AXI_SDM0DMSCR); + writel(0x00000000, DM_AXI_SDM1DMSCR); + writel(0x00000000, DM_AXI_DMQSPAPSLVDMSCR); + writel(0x00000000, DM_AXI_RAPD4SLVDMSCR); + writel(0x00000000, DM_AXI_SAPD4SLVDMSCR); + writel(0x00000000, DM_AXI_SAPD5SLVDMSCR); + writel(0x00000000, DM_AXI_SAPD6SLVDMSCR); + writel(0x00000000, DM_AXI_SAPD65DSLVDMSCR); + writel(0x00000000, DM_AXI_SDAP0SLVDMSCR); + writel(0x00000000, DM_AXI_MAPD2SLVDMSCR); + writel(0x00000000, DM_AXI_MAPD3SLVDMSCR); + writel(0x00000000, DM_AXI_DMXXDEFAULTSLAVESLVDMSCR); + writel(0x00000001, DM_AXI_DMXREGDMSENN); + + /* DMS Register(SYS-AXI256) */ + writel(0x00000000, SYS_AXI256_SYXDMSCR); + writel(0x00000000, SYS_AXI256_MXIDMSCR); + writel(0x00000000, SYS_AXI256_X128TO256SLVDMSCR); + writel(0x00000000, SYS_AXI256_X256TO128SLVDMSCR); + writel(0x00000000, SYS_AXI256_SYXSLVDMSCR); + writel(0x00000000, SYS_AXI256_CCXSLVDMSCR); + writel(0x00000000, SYS_AXI256_S3CSLVDMSCR); + + /* DMS Register(MXT) */ + writel(0x00000000, MXT_SYXDMSCR); + writel(0x00000000, MXT_IMRSLVDMSCR); + writel(0x00000000, MXT_VINSLVDMSCR); + writel(0x00000000, MXT_VPC1SLVDMSCR); + writel(0x00000000, MXT_VSPD0SLVDMSCR); + writel(0x00000000, MXT_VSPD1SLVDMSCR); + writel(0x00000000, MXT_MAP1SLVDMSCR); + writel(0x00000000, MXT_MAP2SLVDMSCR); + writel(0x00000000, MXT_MAP2BSLVDMSCR); + + /* DMS Register(MXI) */ + writel(0x00000002, MXI_JPURDMSCR); + writel(0x00000002, MXI_JPUWDMSCR); + writel(0x00000002, MXI_VCTU0RDMSCR); + writel(0x00000002, MXI_VCTU0WDMSCR); + writel(0x00000002, MXI_VDCTU0RDMSCR); + writel(0x00000002, MXI_VDCTU0WDMSCR); + writel(0x00000002, MXI_VDCTU1RDMSCR); + writel(0x00000002, MXI_VDCTU1WDMSCR); + writel(0x00000002, MXI_VIN0WDMSCR); + writel(0x00000002, MXI_VIN1WDMSCR); + writel(0x00000002, MXI_RDRWDMSCR); + writel(0x00000002, MXI_IMS01RDMSCR); + writel(0x00000002, MXI_IMS01WDMSCR); + writel(0x00000002, MXI_IMS23RDMSCR); + writel(0x00000002, MXI_IMS23WDMSCR); + writel(0x00000002, MXI_IMS45RDMSCR); + writel(0x00000002, MXI_IMS45WDMSCR); + writel(0x00000002, MXI_IMRRDMSCR); + writel(0x00000002, MXI_IMRWDMSCR); + writel(0x00000002, MXI_ROTCE4RDMSCR); + writel(0x00000002, MXI_ROTCE4WDMSCR); + writel(0x00000002, MXI_ROTVLC4RDMSCR); + writel(0x00000002, MXI_ROTVLC4WDMSCR); + writel(0x00000002, MXI_VSPD0RDMSCR); + writel(0x00000002, MXI_VSPD0WDMSCR); + writel(0x00000002, MXI_VSPD1RDMSCR); + writel(0x00000002, MXI_VSPD1WDMSCR); + writel(0x00000002, MXI_DU0RDMSCR); + writel(0x00000002, MXI_DU0WDMSCR); + writel(0x00000002, MXI_VSP0RDMSCR); + writel(0x00000002, MXI_VSP0WDMSCR); + writel(0x00000002, MXI_ROTCE0RDMSCR); + writel(0x00000002, MXI_ROTCE0WDMSCR); + writel(0x00000002, MXI_ROTVLC0RDMSCR); + writel(0x00000002, MXI_ROTVLC0WDMSCR); + writel(0x00000002, MXI_ROTCE1RDMSCR); + writel(0x00000002, MXI_ROTCE1WDMSCR); + writel(0x00000002, MXI_ROTVLC1RDMSCR); + writel(0x00000002, MXI_ROTVLC1WDMSCR); + writel(0x00000002, MXI_ROTCE2RDMSCR); + writel(0x00000002, MXI_ROTCE2WDMSCR); + writel(0x00000002, MXI_ROTVLC2RDMSCR); + writel(0x00000002, MXI_ROTVLC2WDMSCR); + writel(0x00000002, MXI_ROTCE3RDMSCR); + writel(0x00000002, MXI_ROTCE3WDMSCR); + writel(0x00000002, MXI_ROTVLC3RDMSCR); + writel(0x00000002, MXI_ROTVLC3WDMSCR); + + /* DMS Register(CCI-AXI) */ + writel(0x00000000, CCI_AXI_MMUS0DMSCR); + writel(0x00000000, CCI_AXI_SYX2DMSCR); + writel(0x00000000, CCI_AXI_MMURDMSCR); + writel(0x00000000, CCI_AXI_MMUDSDMSCR); + writel(0x00000000, CCI_AXI_MMUMDMSCR); + writel(0x00000000, CCI_AXI_MXIDMSCR); + writel(0x00000000, CCI_AXI_MMUS1DMSCR); + writel(0x00000000, CCI_AXI_MMUMPDMSCR); + writel(0x00000000, CCI_AXI_DVMDMSCR); + writel(0x00000000, CCI_AXI_CCISLVDMSCR); + + /* CC-AXI Function Register */ + writel(0x00000011, CCI_AXI_IPMMUIDVMCR); + writel(0x00000011, CCI_AXI_IPMMURDVMCR); + writel(0x00000011, CCI_AXI_IPMMUS0DVMCR); + writel(0x00000011, CCI_AXI_IPMMUS1DVMCR); + writel(0x00000011, CCI_AXI_IPMMUMPDVMCR); + writel(0x00000011, CCI_AXI_IPMMUDSDVMCR); + writel(0x0000F700, CCI_AXI_AX2ADDRMASK); + +} +#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +void qos_init(void) +{ +} +#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/blanche/qos.h b/board/renesas/blanche/qos.h new file mode 100644 index 0000000..e3ecddf --- /dev/null +++ b/board/renesas/blanche/qos.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2016 Renesas Electronics Corporation + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#ifndef __QOS_H__ +#define __QOS_H__ + +void qos_init(void); + +#endif diff --git a/board/renesas/gose/Makefile b/board/renesas/gose/Makefile index 2dac748..e09ae1e 100644 --- a/board/renesas/gose/Makefile +++ b/board/renesas/gose/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := gose.o qos.o ../rcar-gen2-common/common.o +obj-y := gose.o qos.o ../rcar-common/common.o diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c index bace439..3a8bf86 100644 --- a/board/renesas/gose/gose.c +++ b/board/renesas/gose/gose.c @@ -201,7 +201,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/gose/qos.c b/board/renesas/gose/qos.c index 413ad11..0317ea2 100644 --- a/board/renesas/gose/qos.c +++ b/board/renesas/gose/qos.c @@ -13,7 +13,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h> -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) /* QoS version 0.311 */ enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, @@ -1196,8 +1196,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/koelsch/Makefile b/board/renesas/koelsch/Makefile index c10bba5..15f111c 100644 --- a/board/renesas/koelsch/Makefile +++ b/board/renesas/koelsch/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := koelsch.o qos.o ../rcar-gen2-common/common.o +obj-y := koelsch.o qos.o ../rcar-common/common.o diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c index 51e70e2..b741e2e 100644 --- a/board/renesas/koelsch/koelsch.c +++ b/board/renesas/koelsch/koelsch.c @@ -222,7 +222,7 @@ int board_phy_config(struct phy_device *phydev) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/koelsch/qos.c b/board/renesas/koelsch/qos.c index 8cb2b48..16118d7 100644 --- a/board/renesas/koelsch/qos.c +++ b/board/renesas/koelsch/qos.c @@ -14,7 +14,7 @@ #include <asm/arch/rmobile.h> /* QoS version 0.240 for ES1 and version 0.411 for ES2 */ -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -1384,8 +1384,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/lager/Makefile b/board/renesas/lager/Makefile index 8d03461..0e44c69 100644 --- a/board/renesas/lager/Makefile +++ b/board/renesas/lager/Makefile @@ -6,4 +6,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := lager.o qos.o ../rcar-gen2-common/common.o +obj-y := lager.o qos.o ../rcar-common/common.o diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 83260a1..6fed2f9 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -235,7 +235,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/lager/qos.c b/board/renesas/lager/qos.c index ae15551..25b8d09 100644 --- a/board/renesas/lager/qos.c +++ b/board/renesas/lager/qos.c @@ -13,7 +13,7 @@ #include <asm/arch/rmobile.h> /* QoS version 0.955 for ES1 and version 0.973 for ES2 */ -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -2426,8 +2426,8 @@ void qos_init(void) else qos_init_es1(); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/porter/Makefile b/board/renesas/porter/Makefile index dbf32e9..09c07ef 100644 --- a/board/renesas/porter/Makefile +++ b/board/renesas/porter/Makefile @@ -7,4 +7,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := porter.o qos.o ../rcar-gen2-common/common.o +obj-y := porter.o qos.o ../rcar-common/common.o diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c index b5378de..f6467ee 100644 --- a/board/renesas/porter/porter.c +++ b/board/renesas/porter/porter.c @@ -203,7 +203,7 @@ int board_phy_config(struct phy_device *phydev) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/porter/qos.c b/board/renesas/porter/qos.c index 491d1ba..6b19c5e 100644 --- a/board/renesas/porter/qos.c +++ b/board/renesas/porter/qos.c @@ -15,7 +15,7 @@ #include <asm/arch/rmobile.h> /* QoS version 0.240 for ES1 and version 0.334 for ES2 */ -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -1305,8 +1305,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/rcar-gen2-common/common.c b/board/renesas/rcar-common/common.c index 0103f42..33c1726 100644 --- a/board/renesas/rcar-gen2-common/common.c +++ b/board/renesas/rcar-common/common.c @@ -1,8 +1,9 @@ /* - * board/renesas/rcar-gen2-common/common.c + * board/renesas/rcar-common/common.c * * Copyright (C) 2013 Renesas Electronics Corporation * Copyright (C) 2013 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * Copyright (C) 2015 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> * * SPDX-License-Identifier: GPL-2.0 */ @@ -29,7 +30,10 @@ static struct mstp_ctl mstptbl[] = { RMSTPCR4, MSTP4_BITS, CONFIG_RMSTP4_ENA }, { SMSTPCR5, MSTP5_BITS, CONFIG_SMSTP5_ENA, RMSTPCR5, MSTP5_BITS, CONFIG_RMSTP5_ENA }, - /* No MSTP6 */ +#ifdef CONFIG_RCAR_GEN3 + { SMSTPCR6, MSTP6_BITS, CONFIG_SMSTP6_ENA, + RMSTPCR6, MSTP6_BITS, CONFIG_RMSTP6_ENA }, +#endif { SMSTPCR7, MSTP7_BITS, CONFIG_SMSTP7_ENA, RMSTPCR7, MSTP7_BITS, CONFIG_RMSTP7_ENA }, { SMSTPCR8, MSTP8_BITS, CONFIG_SMSTP8_ENA, @@ -51,9 +55,11 @@ void arch_preboot_os(void) /* Stop module clock */ for (i = 0; i < ARRAY_SIZE(mstptbl); i++) { - mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_dis, + mstp_setclrbits_le32((uintptr_t)mstptbl[i].s_addr, + mstptbl[i].s_dis, mstptbl[i].s_ena); - mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_dis, + mstp_setclrbits_le32((uintptr_t)mstptbl[i].r_addr, + mstptbl[i].r_dis, mstptbl[i].r_ena); } } diff --git a/board/renesas/salvator-x/Kconfig b/board/renesas/salvator-x/Kconfig new file mode 100644 index 0000000..ed4c479 --- /dev/null +++ b/board/renesas/salvator-x/Kconfig @@ -0,0 +1,15 @@ +if TARGET_SALVATOR_X + +config SYS_SOC + default "rmobile" + +config SYS_BOARD + default "salvator-x" + +config SYS_VENDOR + default "renesas" + +config SYS_CONFIG_NAME + default "salvator-x" + +endif diff --git a/board/renesas/salvator-x/MAINTAINERS b/board/renesas/salvator-x/MAINTAINERS new file mode 100644 index 0000000..abd05c8 --- /dev/null +++ b/board/renesas/salvator-x/MAINTAINERS @@ -0,0 +1,6 @@ +SALVATOR_X BOARD +M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> +S: Maintained +F: board/renesas/salvator-x/ +F: include/configs/salvator-x.h +F: configs/salvator-x_defconfig diff --git a/board/renesas/salvator-x/Makefile b/board/renesas/salvator-x/Makefile new file mode 100644 index 0000000..61b0d06 --- /dev/null +++ b/board/renesas/salvator-x/Makefile @@ -0,0 +1,9 @@ +# +# board/renesas/salvator-x/Makefile +# +# Copyright (C) 2015 Renesas Electronics Corporation +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := salvator-x.o ../rcar-common/common.o diff --git a/board/renesas/salvator-x/salvator-x.c b/board/renesas/salvator-x/salvator-x.c new file mode 100644 index 0000000..47242c6 --- /dev/null +++ b/board/renesas/salvator-x/salvator-x.c @@ -0,0 +1,120 @@ +/* + * board/renesas/salvator-x/salvator-x.c + * This file is Salvator-X board support. + * + * Copyright (C) 2015 Renesas Electronics Corporation + * Copyright (C) 2015 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <malloc.h> +#include <netdev.h> +#include <dm.h> +#include <dm/platform_data/serial_sh.h> +#include <asm/processor.h> +#include <asm/mach-types.h> +#include <asm/io.h> +#include <asm/errno.h> +#include <asm/arch/sys_proto.h> +#include <asm/gpio.h> +#include <asm/arch/gpio.h> +#include <asm/arch/rmobile.h> +#include <asm/arch/rcar-mstp.h> +#include <i2c.h> +#include <mmc.h> + +DECLARE_GLOBAL_DATA_PTR; + +#define CPGWPCR 0xE6150904 +#define CPGWPR 0xE615090C + +#define CLK2MHZ(clk) (clk / 1000 / 1000) +void s_init(void) +{ + struct rcar_rwdt *rwdt = (struct rcar_rwdt *)RWDT_BASE; + struct rcar_swdt *swdt = (struct rcar_swdt *)SWDT_BASE; + + /* Watchdog init */ + writel(0xA5A5A500, &rwdt->rwtcsra); + writel(0xA5A5A500, &swdt->swtcsra); + + writel(0xA5A50000, CPGWPCR); + writel(0xFFFFFFFF, CPGWPR); +} + +#define GSX_MSTP112 (1 << 12) /* 3DG */ +#define TMU0_MSTP125 (1 << 25) /* secure */ +#define TMU1_MSTP124 (1 << 24) /* non-secure */ +#define SCIF2_MSTP310 (1 << 10) /* SCIF2 */ + +int board_early_init_f(void) +{ + /* TMU0,1 */ /* which use ? */ + mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125 | TMU1_MSTP124); + /* SCIF2 */ + mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SCIF2_MSTP310); + + return 0; +} + +/* SYSC */ +/* R/- 32 Power status register 2(3DG) */ +#define SYSC_PWRSR2 0xE6180100 +/* -/W 32 Power resume control register 2 (3DG) */ +#define SYSC_PWRONCR2 0xE618010C + +DECLARE_GLOBAL_DATA_PTR; +int board_init(void) +{ + /* adress of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_TEXT_BASE + 0x50000; + + /* Init PFC controller */ + r8a7795_pinmux_init(); + + /* GSX: force power and clock supply */ + writel(0x0000001F, SYSC_PWRONCR2); + while (readl(SYSC_PWRSR2) != 0x000003E0) + mdelay(20); + + mstp_clrbits_le32(MSTPSR1, SMSTPCR1, GSX_MSTP112); + + return 0; +} + +int dram_init(void) +{ + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; + + return 0; +} + +const struct rmobile_sysinfo sysinfo = { + CONFIG_RCAR_BOARD_STRING +}; + +#define RST_BASE 0xE6160000 +#define RST_CA57RESCNT (RST_BASE + 0x40) +#define RST_CA53RESCNT (RST_BASE + 0x44) +#define RST_RSTOUTCR (RST_BASE + 0x58) +#define RST_CODE 0xA5A5000F + +void reset_cpu(ulong addr) +{ + /* only CA57 ? */ + writel(RST_CODE, RST_CA57RESCNT); +} + +static const struct sh_serial_platdata serial_platdata = { + .base = SCIF2_BASE, + .type = PORT_SCIF, + .clk = 14745600, /* 0xE10000 */ + .clk_mode = EXT_CLK, +}; + +U_BOOT_DEVICE(salvator_x_scif2) = { + .name = "serial_sh", + .platdata = &serial_platdata, +}; diff --git a/board/renesas/silk/Makefile b/board/renesas/silk/Makefile index e6eea61..8916a8d 100644 --- a/board/renesas/silk/Makefile +++ b/board/renesas/silk/Makefile @@ -7,4 +7,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := silk.o qos.o ../rcar-gen2-common/common.o +obj-y := silk.o qos.o ../rcar-common/common.o diff --git a/board/renesas/silk/qos.c b/board/renesas/silk/qos.c index 4f6e46c..f86fd01 100644 --- a/board/renesas/silk/qos.c +++ b/board/renesas/silk/qos.c @@ -14,7 +14,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h> -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) /* QoS version 0.11 */ enum { @@ -944,8 +944,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/silk/silk.c b/board/renesas/silk/silk.c index 021baab..4ec3f92 100644 --- a/board/renesas/silk/silk.c +++ b/board/renesas/silk/silk.c @@ -192,7 +192,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; void reset_cpu(ulong addr) diff --git a/board/renesas/stout/Makefile b/board/renesas/stout/Makefile index e78f80c..cb7c61d 100644 --- a/board/renesas/stout/Makefile +++ b/board/renesas/stout/Makefile @@ -8,4 +8,4 @@ # SPDX-License-Identifier: GPL-2.0 # -obj-y := stout.o cpld.o qos.o ../rcar-gen2-common/common.o +obj-y := stout.o cpld.o qos.o ../rcar-common/common.o diff --git a/board/renesas/stout/qos.c b/board/renesas/stout/qos.c index d49a0ab..f29c5c9 100644 --- a/board/renesas/stout/qos.c +++ b/board/renesas/stout/qos.c @@ -15,7 +15,7 @@ #include <asm/arch/rmobile.h> /* QoS version 0.955 for ES1 and version 0.973 for ES2 */ -#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -2428,8 +2428,8 @@ void qos_init(void) else qos_init_es1(); } -#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#else /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ void qos_init(void) { } -#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ +#endif /* CONFIG_ARCH_RMOBILE_EXTRAM_BOOT */ diff --git a/board/renesas/stout/stout.c b/board/renesas/stout/stout.c index 7df7394..672a730 100644 --- a/board/renesas/stout/stout.c +++ b/board/renesas/stout/stout.c @@ -217,7 +217,7 @@ int dram_init(void) } const struct rmobile_sysinfo sysinfo = { - CONFIG_RMOBILE_BOARD_STRING + CONFIG_ARCH_RMOBILE_BOARD_STRING }; static const struct sh_serial_platdata serial_platdata = { diff --git a/board/rockchip/evb_rk3036/evb_rk3036.c b/board/rockchip/evb_rk3036/evb_rk3036.c index f5758b1..e5582b4 100644 --- a/board/rockchip/evb_rk3036/evb_rk3036.c +++ b/board/rockchip/evb_rk3036/evb_rk3036.c @@ -47,3 +47,49 @@ void enable_caches(void) dcache_enable(); } #endif + +#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG) +#include <usb.h> +#include <usb/dwc2_udc.h> + +static struct dwc2_plat_otg_data rk3036_otg_data = { + .rx_fifo_sz = 512, + .np_tx_fifo_sz = 16, + .tx_fifo_sz = 128, +}; + +int board_usb_init(int index, enum usb_init_type init) +{ + int node; + const char *mode; + bool matched = false; + const void *blob = gd->fdt_blob; + + /* find the usb_otg node */ + node = fdt_node_offset_by_compatible(blob, -1, + "rockchip,rk3288-usb"); + + while (node > 0) { + mode = fdt_getprop(blob, node, "dr_mode", NULL); + if (mode && strcmp(mode, "otg") == 0) { + matched = true; + break; + } + + node = fdt_node_offset_by_compatible(blob, node, + "rockchip,rk3288-usb"); + } + if (!matched) { + debug("Not found usb_otg device\n"); + return -ENODEV; + } + rk3036_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg"); + + return dwc2_udc_probe(&rk3036_otg_data); +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + return 0; +} +#endif diff --git a/board/rockchip/evb_rk3399/MAINTAINERS b/board/rockchip/evb_rk3399/MAINTAINERS index e69de29..c825d5e 100644 --- a/board/rockchip/evb_rk3399/MAINTAINERS +++ b/board/rockchip/evb_rk3399/MAINTAINERS @@ -0,0 +1,6 @@ +EVB-RK3399 +M: Kever Yang <kever.yang@rock-chips.com> +S: Maintained +F: board/rockchip/evb_rk3399 +F: include/configs/evb_rk3399.h +F: configs/evb-rk3399_defconfig diff --git a/board/rockchip/kylin_rk3036/kylin_rk3036.c b/board/rockchip/kylin_rk3036/kylin_rk3036.c index 2a25871..5ade695 100644 --- a/board/rockchip/kylin_rk3036/kylin_rk3036.c +++ b/board/rockchip/kylin_rk3036/kylin_rk3036.c @@ -79,3 +79,49 @@ void enable_caches(void) dcache_enable(); } #endif + +#if defined(CONFIG_USB_GADGET) && defined(CONFIG_USB_GADGET_DWC2_OTG) +#include <usb.h> +#include <usb/dwc2_udc.h> + +static struct dwc2_plat_otg_data rk3036_otg_data = { + .rx_fifo_sz = 512, + .np_tx_fifo_sz = 16, + .tx_fifo_sz = 128, +}; + +int board_usb_init(int index, enum usb_init_type init) +{ + int node; + const char *mode; + bool matched = false; + const void *blob = gd->fdt_blob; + + /* find the usb_otg node */ + node = fdt_node_offset_by_compatible(blob, -1, + "rockchip,rk3288-usb"); + + while (node > 0) { + mode = fdt_getprop(blob, node, "dr_mode", NULL); + if (mode && strcmp(mode, "otg") == 0) { + matched = true; + break; + } + + node = fdt_node_offset_by_compatible(blob, node, + "rockchip,rk3288-usb"); + } + if (!matched) { + debug("Not found usb_otg device\n"); + return -ENODEV; + } + rk3036_otg_data.regs_otg = fdtdec_get_addr(blob, node, "reg"); + + return dwc2_udc_probe(&rk3036_otg_data); +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + return 0; +} +#endif diff --git a/board/rockchip/miniarm_rk3288/Kconfig b/board/rockchip/miniarm_rk3288/Kconfig new file mode 100644 index 0000000..529c09f --- /dev/null +++ b/board/rockchip/miniarm_rk3288/Kconfig @@ -0,0 +1,15 @@ +if TARGET_MINIARM_RK3288 + +config SYS_BOARD + default "miniarm_rk3288" + +config SYS_VENDOR + default "rockchip" + +config SYS_CONFIG_NAME + default "miniarm_rk3288" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif diff --git a/board/rockchip/miniarm_rk3288/MAINTAINERS b/board/rockchip/miniarm_rk3288/MAINTAINERS new file mode 100644 index 0000000..7537b8f --- /dev/null +++ b/board/rockchip/miniarm_rk3288/MAINTAINERS @@ -0,0 +1,6 @@ +MINIARM-RK3288 +M: Lin Huang <hl@rock-chips.com> +S: Maintained +F: board/rockchip/miniarm_rk3288 +F: include/configs/miniarm_rk3288.h +F: configs/miniarm-rk3288_defconfig diff --git a/board/rockchip/miniarm_rk3288/Makefile b/board/rockchip/miniarm_rk3288/Makefile new file mode 100644 index 0000000..9419b91 --- /dev/null +++ b/board/rockchip/miniarm_rk3288/Makefile @@ -0,0 +1,7 @@ +# +# (C) Copyright 2016 Rockchip Electronics Co., Ltd +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += miniarm-rk3288.o diff --git a/board/rockchip/miniarm_rk3288/miniarm-rk3288.c b/board/rockchip/miniarm_rk3288/miniarm-rk3288.c new file mode 100644 index 0000000..aad74ef --- /dev/null +++ b/board/rockchip/miniarm_rk3288/miniarm-rk3288.c @@ -0,0 +1,15 @@ +/* + * (C) Copyright 2016 Rockchip Electronics Co., Ltd + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <spl.h> + +void board_boot_order(u32 *spl_boot_list) +{ + /* eMMC prior to sdcard */ + spl_boot_list[0] = BOOT_DEVICE_MMC2; + spl_boot_list[1] = BOOT_DEVICE_MMC1; +} diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index cafa348..3a1ce24 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -605,6 +605,8 @@ static void spl_dram_init(int width) .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */ .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */ .ddr_type = DDR_TYPE_DDR3, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; if (is_mx6dq()) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 323e972..68443c9 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -37,6 +37,7 @@ config MACH_SUN6I select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT @@ -46,6 +47,7 @@ config MACH_SUN7I select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN4I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT @@ -55,6 +57,7 @@ config MACH_SUN8I_A23 select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT @@ -64,6 +67,7 @@ config MACH_SUN8I_A33 select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT @@ -79,6 +83,7 @@ config MACH_SUN8I_H3 select CPU_V7 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT + select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT @@ -249,7 +254,7 @@ config UART0_PORT_F Only enable this if you really know what you are doing. config OLD_SUNXI_KERNEL_COMPAT - boolean "Enable workarounds for booting old kernels" + bool "Enable workarounds for booting old kernels" default n ---help--- Set this to enable various workarounds for old kernels, this results in @@ -419,14 +424,14 @@ config I2C4_ENABLE endif config AXP_GPIO - boolean "Enable support for gpio-s on axp PMICs" + bool "Enable support for gpio-s on axp PMICs" default n ---help--- Say Y here to enable support for the gpio pins of the axp PMIC ICs. config VIDEO - boolean "Enable graphical uboot console on HDMI, LCD or VGA" - depends on !MACH_SUN8I_A83T && !MACH_SUN8I_H3 && !MACH_SUN9I && !MACH_SUN50I_A64 + bool "Enable graphical uboot console on HDMI, LCD or VGA" + depends on !MACH_SUN8I_A83T && !MACH_SUN8I_H3 && !MACH_SUN9I && !MACH_SUN50I default y ---help--- Say Y here to add support for using a cfb console on the HDMI, LCD @@ -434,21 +439,21 @@ config VIDEO info on how to select the video output and mode. config VIDEO_HDMI - boolean "HDMI output support" + bool "HDMI output support" depends on VIDEO && !MACH_SUN8I default y ---help--- Say Y here to add support for outputting video over HDMI. config VIDEO_VGA - boolean "VGA output support" + bool "VGA output support" depends on VIDEO && (MACH_SUN4I || MACH_SUN7I) default n ---help--- Say Y here to add support for outputting video over VGA. config VIDEO_VGA_VIA_LCD - boolean "VGA via LCD controller support" + bool "VGA via LCD controller support" depends on VIDEO && (MACH_SUN5I || MACH_SUN6I || MACH_SUN8I) default n ---help--- @@ -457,7 +462,7 @@ config VIDEO_VGA_VIA_LCD Olimex A13 boards. config VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH - boolean "Force sync active high for VGA via LCD controller support" + bool "Force sync active high for VGA via LCD controller support" depends on VIDEO_VGA_VIA_LCD default n ---help--- @@ -475,7 +480,7 @@ config VIDEO_VGA_EXTERNAL_DAC_EN format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. config VIDEO_COMPOSITE - boolean "Composite video output support" + bool "Composite video output support" depends on VIDEO && (MACH_SUN4I || MACH_SUN5I || MACH_SUN7I) default n ---help--- diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index de719cd..6f13cf6 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -28,6 +28,7 @@ F: configs/Auxtek-T004_defconfig F: configs/CHIP_defconfig F: configs/difrnce_dit4350_defconfig F: configs/Empire_electronix_d709_defconfig +F: configs/Empire_electronix_m712_defconfig F: configs/inet98v_rev2_defconfig F: configs/mk802_a10s_defconfig F: configs/q8_a13_tablet_defconfig @@ -37,6 +38,7 @@ F: configs/Wobo_i5_defconfig F: include/configs/sun6i.h F: configs/colorfly_e708_q1_defconfig F: configs/CSQ_CS908_defconfig +F: configs/inet_q972_defconfig F: configs/Mele_A1000G_quad_defconfig F: configs/Mele_M9_defconfig F: configs/Sinovoip_BPI_M2_defconfig @@ -61,6 +63,7 @@ F: configs/orangepi_one_defconfig F: configs/orangepi_pc_defconfig F: configs/orangepi_pc_plus_defconfig F: configs/orangepi_plus_defconfig +F: configs/orangepi_plus2e_defconfig F: configs/polaroid_mid2407pxe03_defconfig F: configs/polaroid_mid2809pxe04_defconfig F: configs/q8_a23_tablet_800x480_defconfig @@ -86,6 +89,11 @@ M: Iain Paton <ipaton0@gmail.com> S: Maintained F: configs/A20-OLinuXino-Lime2_defconfig +A33-OLINUXINO BOARD +M: Stefan Mavrodiev <stefan.mavrodiev@gmail.com> +S: Maintained +F: configs/A33-OLinuXino_defconfig + AINOL AW1 BOARD M: Paul Kocialkowski <contact@paulk.fr> S: Maintained @@ -154,6 +162,11 @@ M: Michal Suchanek <hramrach@gmail.com> S: Maintained F: configs/iNet_86VS_defconfig +INET D978 BOARD +M: Icenowy Zheng <icenowy@aosc.xyz> +S: Maintained +F: configs/iNet_D978_rev2_defconfig + LAMOBO-R1 BOARD M: Jelle de Jong <jelledejong@powercraft.nl> S: Maintained diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 209fb1c..6281c9d 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -602,7 +602,7 @@ static void parse_spl_header(const uint32_t spl_addr) * data is expected in uEnv.txt compatible format, so "env * import -t" the string(s) at fel_script_address right away. */ - himport_r(&env_htab, (char *)spl->fel_script_address, + himport_r(&env_htab, (char *)(uintptr_t)spl->fel_script_address, spl->fel_uEnv_length, '\n', H_NOCLEAR, 0, 0, NULL); return; } diff --git a/board/synopsys/Kconfig b/board/synopsys/Kconfig index 8ab48cd..27e5509 100644 --- a/board/synopsys/Kconfig +++ b/board/synopsys/Kconfig @@ -1,9 +1,9 @@ -if TARGET_ARCANGEL4 +if TARGET_NSIM config SYS_VENDOR default "synopsys" config SYS_CONFIG_NAME - default "arcangel4" + default "nsim" endif diff --git a/board/synopsys/MAINTAINERS b/board/synopsys/MAINTAINERS index 43114ce..b9bfd3c 100644 --- a/board/synopsys/MAINTAINERS +++ b/board/synopsys/MAINTAINERS @@ -1,6 +1,8 @@ - BOARD M: Alexey Brodkin <abrodkin@synopsys.com> S: Maintained -F: include/configs/arcangel4.h -F: configs/arcangel4_defconfig -F: configs/arcangel4-be_defconfig +F: include/configs/nsim.h +F: configs/nsim_700_defconfig +F: configs/nsim_700be_defconfig +F: configs/nsim_hs38_defconfig +F: configs/nsim_hs38be_defconfig diff --git a/board/synopsys/axs101/Makefile b/board/synopsys/axs101/Makefile deleted file mode 100644 index f0965f7..0000000 --- a/board/synopsys/axs101/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y += axs101.o -obj-$(CONFIG_CMD_NAND) += nand.o diff --git a/board/synopsys/axs101/Kconfig b/board/synopsys/axs10x/Kconfig index 79e5400..c60b6a2 100644 --- a/board/synopsys/axs101/Kconfig +++ b/board/synopsys/axs10x/Kconfig @@ -1,12 +1,12 @@ -if TARGET_AXS101 +if TARGET_AXS10X config SYS_BOARD - default "axs101" + default "axs10x" config SYS_VENDOR default "synopsys" config SYS_CONFIG_NAME - default "axs101" + default "axs10x" endif diff --git a/board/synopsys/axs101/MAINTAINERS b/board/synopsys/axs10x/MAINTAINERS index 79fff8e..abb890b 100644 --- a/board/synopsys/axs101/MAINTAINERS +++ b/board/synopsys/axs10x/MAINTAINERS @@ -1,7 +1,7 @@ -AXS101 BOARD +AXS10X BOARD M: Alexey Brodkin <abrodkin@synopsys.com> S: Maintained -F: board/synopsys/axs101/ -F: include/configs/axs101.h +F: board/synopsys/axs10x/ +F: include/configs/axs10x.h F: configs/axs101_defconfig F: configs/axs103_defconfig diff --git a/board/synopsys/axs10x/Makefile b/board/synopsys/axs10x/Makefile new file mode 100644 index 0000000..e29d520 --- /dev/null +++ b/board/synopsys/axs10x/Makefile @@ -0,0 +1,8 @@ +# +# Copyright (C) 2013-2016 Synopsys, Inc. All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y += axs10x.o +obj-$(CONFIG_CMD_NAND) += nand.o diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs10x/axs10x.c index a5e774b..a5e774b 100644 --- a/board/synopsys/axs101/axs101.c +++ b/board/synopsys/axs10x/axs10x.c diff --git a/board/synopsys/axs101/axs10x.h b/board/synopsys/axs10x/axs10x.h index 8e8c41f..8e8c41f 100644 --- a/board/synopsys/axs101/axs10x.h +++ b/board/synopsys/axs10x/axs10x.h diff --git a/board/synopsys/axs101/nand.c b/board/synopsys/axs10x/nand.c index 4be52e2..4be52e2 100644 --- a/board/synopsys/axs101/nand.c +++ b/board/synopsys/axs10x/nand.c diff --git a/board/tcl/sl50/Kconfig b/board/tcl/sl50/Kconfig index 390a476..d0068d9 100644 --- a/board/tcl/sl50/Kconfig +++ b/board/tcl/sl50/Kconfig @@ -22,10 +22,4 @@ config CONS_INDEX board you may want something other than UART0 as for example the IDK uses UART3 so enter 4 here. -config DM_GPIO - default y - -config DM_SERIAL - default y - endif diff --git a/board/technexion/pico-imx6ul/pico-imx6ul.c b/board/technexion/pico-imx6ul/pico-imx6ul.c index 5cbf803..49aeb80 100644 --- a/board/technexion/pico-imx6ul/pico-imx6ul.c +++ b/board/technexion/pico-imx6ul/pico-imx6ul.c @@ -231,9 +231,7 @@ int power_init_board(void) printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id); /* disable Low Power Mode during standby mode */ - pmic_reg_read(pfuze, PFUZE3000_LDOGCTL, ®); - reg |= 0x1; - pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, reg); + pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1); /* SW1B step ramp up time from 2us to 4us/25mV */ pmic_reg_write(pfuze, PFUZE3000_SW1BCONF, 0x40); diff --git a/board/ti/am57xx/MAINTAINERS b/board/ti/am57xx/MAINTAINERS index b8ae019..500bb7a 100644 --- a/board/ti/am57xx/MAINTAINERS +++ b/board/ti/am57xx/MAINTAINERS @@ -1,7 +1,8 @@ AM57XX EVM -M: Felipe Balbi <balbi@ti.com> +M: Lokesh Vutla <lokeshvutla@ti.com> S: Maintained F: board/ti/am57xx/ F: include/configs/am57xx_evm.h F: configs/am57xx_evm_defconfig F: configs/am57xx_evm_nodt_defconfig +F: configs/am57xx_hs_evm_defconfig diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 927d136..64de602 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -338,7 +338,9 @@ static void setup_board_eeprom_env(void) if (rc) goto invalid_eeprom; - if (board_is_am572x_evm()) + if (board_is_x15()) + name = "beagle_x15"; + else if (board_is_am572x_evm()) name = "am57xx_evm"; else if (board_is_am572x_idk()) name = "am572x_idk"; diff --git a/board/ti/evm/Kconfig b/board/ti/evm/Kconfig index f02aa31..4f490dd 100644 --- a/board/ti/evm/Kconfig +++ b/board/ti/evm/Kconfig @@ -10,29 +10,3 @@ config SYS_CONFIG_NAME default "omap3_evm" endif - -if TARGET_OMAP3_EVM_QUICK_MMC - -config SYS_BOARD - default "evm" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "omap3_evm_quick_mmc" - -endif - -if TARGET_OMAP3_EVM_QUICK_NAND - -config SYS_BOARD - default "evm" - -config SYS_VENDOR - default "ti" - -config SYS_CONFIG_NAME - default "omap3_evm_quick_nand" - -endif diff --git a/board/ti/evm/MAINTAINERS b/board/ti/evm/MAINTAINERS index 90c3f6b..612a08a 100644 --- a/board/ti/evm/MAINTAINERS +++ b/board/ti/evm/MAINTAINERS @@ -3,8 +3,4 @@ M: Tom Rini <trini@konsulko.com> S: Maintained F: board/ti/evm/ F: include/configs/omap3_evm.h -F: include/configs/omap3_evm_quick_mmc.h -F: include/configs/omap3_evm_quick_nand.h F: configs/omap3_evm_defconfig -F: configs/omap3_evm_quick_mmc_defconfig -F: configs/omap3_evm_quick_nand_defconfig diff --git a/board/ti/ks2_evm/README b/board/ti/ks2_evm/README index 05baff6..5430c7d 100644 --- a/board/ti/ks2_evm/README +++ b/board/ti/ks2_evm/README @@ -20,6 +20,9 @@ The K2E SoC details are available at The K2L SoC details are available at http://www.ti.com/lit/ds/symlink/tci6630k2l.pdf +The K2G SoC details are available at + http://www.ti.com/lit/ds/symlink/66ak2g02.pdf + Board configuration: ==================== @@ -30,6 +33,7 @@ Some of the peripherals that are configured by U-Boot |K2HK |2 |512MB |6MB |4(2) |2 |3 |3 | |K2E |4 |512MB |2MB |8(2) |2 |3 |3 | |K2L |2 |512MB |2MB |4(2) |4 |3 |3 | +|K2G |2 |256MB |1MB |1 |1 |1 |1 | +------+-------+-------+-----------+-----------+-------+-------+----+ There are only 2 eth port installed on the boards. @@ -47,44 +51,48 @@ Board configuration files: include/configs/k2hk_evm.h include/configs/k2e_evm.h include/configs/k2l_evm.h +include/configs/k2g_evm.h As U-Boot is migrating to Kconfig there is also board defconfig files configs/k2e_evm_defconfig configs/k2hk_evm_defconfig configs/k2l_evm_defconfig +configs/k2g_evm_defconfig Supported boot modes: - SPI NOR boot - AEMIF NAND boot - UART boot + - MMC boot (Only on K2G) Supported image formats: - - u-boot-dtb.bin: for loading and running u-boot-dtb.bin through + - u-boot.bin: for loading and running u-boot.bin through Texas Instruments code composure studio (CCS) and for UART boot. - u-boot-spi.gph: gpimage for programming SPI NOR flash for SPI NOR boot - - MLO: gpimage for programming AEMIF NAND flash for NAND boot + - MLO: gpimage for programming AEMIF NAND flash for NAND boot, MMC boot. Build instructions: =================== -Examples for k2hk, for k2e and k2l just replace k2hk prefix accordingly. +Examples for k2hk, for k2e, k2l and k2g just replace k2hk prefix accordingly. Don't forget to add ARCH=arm and CROSS_COMPILE. -To build u-boot-dtb.bin, u-boot-spi.gph, MLO: +To build u-boot.bin, u-boot-spi.gph, MLO: >make k2hk_evm_defconfig >make Load and Run U-Boot on keystone EVMs using CCS ========================================= -Need Code Composer Studio (CCS) installed on a PC to load and run u-boot-dtb.bin +Need Code Composer Studio (CCS) installed on a PC to load and run u-boot.bin on EVM. See instructions at below link for installing CCS on a Windows PC. http://processors.wiki.ti.com/index.php/MCSDK_UG_Chapter_Getting_Started# Installing_Code_Composer_Studio -Use u-boot-dtb.bin from the build folder for loading and running U-Boot binary +Use u-boot.bin from the build folder for loading and running U-Boot binary on EVM. Follow instructions at K2HK http://processors.wiki.ti.com/index.php/EVMK2H_Hardware_Setup K2E http://processors.wiki.ti.com/index.php/EVMK2E_Hardware_Setup K2L http://processors.wiki.ti.com/index.php/TCIEVMK2L_Hardware_Setup +K2G http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup to configure SW1 dip switch to use "No Boot/JTAG DSP Little Endian Boot Mode" and Power ON the EVM. Follow instructions to connect serial port of EVM to @@ -100,13 +108,13 @@ loading the U-Boot binary on the target EVM. Instead do the following:- is connected: Unknown)" at the debug window (This is created once Target configuration is launched) and select "Connect Target". 2. Once target connect is successful, choose Tools->Load Memory option from the - top level menu. At the Load Memory window, choose the file u-boot-dtb.bin + top level menu. At the Load Memory window, choose the file u-boot.bin through "Browse" button and click "next >" button. In the next window, enter - Start address as 0xc001000, choose Type-size "32 bits" and click "Finish" + Start address as 0xc000000, choose Type-size "32 bits" and click "Finish" button. 3. Click View -> Registers from the top level menu to view registers window. 4. From Registers, window expand "Core Registers" to view PC. Edit PC value - to be 0xc001000. From the "Run" top level menu, select "Free Run" + to be 0xc000000. From the "Run" top level menu, select "Free Run" 5. The U-Boot prompt is shown at the Tera Term/ Hyper terminal console as below and type any key to stop autoboot as instructed := @@ -167,8 +175,20 @@ Load and Run U-Boot on keystone EVMs using UART download Open BMC and regular UART terminals. -1. On the regular UART port start xmodem transfer of the u-boot-dtb.bin +1. On the regular UART port start xmodem transfer of the u-boot.bin 2. Using BMC terminal set the ARM-UART bootmode and reboot the EVM BMC> bootmode #4 MBC> reboot 3. When xmodem is complete you should see the U-Boot starts on the UART port + +Load and Run U-Boot on K2G EVMs using MMC +======================================================== + +Open BMC and regular UART terminals. + +1. Set the SW3 dip switch to "ARM MMC Boot mode" as per instruction at + http://processors.wiki.ti.com/index.php/66AK2G02_GP_EVM_Hardware_Setup +2. Create SD card partitions as per steps given in Hardware Setup Guide. +3. Copy MLO to Boot Partition. +4. Insert SD card and Power on the EVM. + The EVM now boots with U-Boot image from SD card. diff --git a/board/udoo/udoo_spl.c b/board/udoo/udoo_spl.c index a1154ed..592e69b 100644 --- a/board/udoo/udoo_spl.c +++ b/board/udoo/udoo_spl.c @@ -193,6 +193,8 @@ static struct mx6_ddr_sysinfo mem_qdl = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static void ccgr_init(void) diff --git a/board/wandboard/spl.c b/board/wandboard/spl.c index 77afae7..085095c 100644 --- a/board/wandboard/spl.c +++ b/board/wandboard/spl.c @@ -187,6 +187,8 @@ static struct mx6_ddr_sysinfo mem_q = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static struct mx6_mmdc_calibration mx6dl_1g_mmdc_calib = { @@ -228,6 +230,8 @@ static struct mx6_ddr_sysinfo mem_dl = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; /* DDR 32bit 512MB */ @@ -245,6 +249,8 @@ static struct mx6_ddr_sysinfo mem_s = { .mif3_mode = 3, .rst_to_cke = 0x23, .sde_to_rst = 0x10, + .refsel = 1, /* Refresh cycles at 32KHz */ + .refr = 7, /* 8 refresh commands per refresh cycle */ }; static void ccgr_init(void) diff --git a/board/warp/imximage.cfg b/board/warp/imximage.cfg new file mode 100644 index 0000000..7b1d6b7 --- /dev/null +++ b/board/warp/imximage.cfg @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2013 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + * + * Refer docs/README.imxmage for more details about how-to configure + * and create imximage boot image + * + * The syntax is taken as close as possible with the kwbimage + */ + +/* image version */ + +IMAGE_VERSION 2 + +/* + * Boot Device : one of + * spi, sd (the board has no nand neither onenand) + */ + +BOOT_FROM sd + +/* + * Device Configuration Data (DCD) + * + * Each entry must have the format: + * Addr-type Address Value + * + * where: + * Addr-type register length (1,2 or 4 bytes) + * Address absolute address of the register + * value value to be stored in the register + */ +DATA 4 0x020c4018 0x00260324 + +DATA 4 0x020c4068 0xffffffff +DATA 4 0x020c406c 0xffffffff +DATA 4 0x020c4070 0xffffffff +DATA 4 0x020c4074 0xffffffff +DATA 4 0x020c4078 0xffffffff +DATA 4 0x020c407c 0xffffffff +DATA 4 0x020c4080 0xffffffff + +DATA 4 0x020e0344 0x00003030 +DATA 4 0x020e0348 0x00003030 +DATA 4 0x020e034c 0x00003030 +DATA 4 0x020e0350 0x00003030 +DATA 4 0x020e030c 0x00000030 +DATA 4 0x020e0310 0x00000030 +DATA 4 0x020e0314 0x00000030 +DATA 4 0x020e0318 0x00000030 +DATA 4 0x020e0300 0x00000030 +DATA 4 0x020e031c 0x00000030 +DATA 4 0x020e0338 0x00000028 +DATA 4 0x020e0320 0x00000030 +DATA 4 0x020e032c 0x00000000 +DATA 4 0x020e033c 0x00000008 +DATA 4 0x020e0340 0x00000008 +DATA 4 0x020e05c4 0x00000030 +DATA 4 0x020e05cc 0x00000030 +DATA 4 0x020e05d4 0x00000030 +DATA 4 0x020e05d8 0x00000030 +DATA 4 0x020e05ac 0x00000030 +DATA 4 0x020e05c8 0x00000030 +DATA 4 0x020e05b0 0x00020000 +DATA 4 0x020e05b4 0x00000000 +DATA 4 0x020e05c0 0x00020000 +DATA 4 0x020e05d0 0x00080000 + +DATA 4 0x021b001c 0x00008000 +DATA 4 0x021b085c 0x1b4700c7 +DATA 4 0x021b0800 0xa1390003 +DATA 4 0x021b0890 0x00400000 +DATA 4 0x021b08b8 0x00000800 +DATA 4 0x021b081c 0x33333333 +DATA 4 0x021b0820 0x33333333 +DATA 4 0x021b0824 0x33333333 +DATA 4 0x021b0828 0x33333333 +DATA 4 0x021b082c 0xf3333333 +DATA 4 0x021b0830 0xf3333333 +DATA 4 0x021b0834 0xf3333333 +DATA 4 0x021b0838 0xf3333333 +DATA 4 0x021b0848 0x4241444a +DATA 4 0x021b0850 0x3030312b +DATA 4 0x021b083c 0x20000000 +DATA 4 0x021b0840 0x00000000 +DATA 4 0x021b08c0 0x24911492 +DATA 4 0x021b08b8 0x00000800 +DATA 4 0x021b000c 0x33374133 +DATA 4 0x021b0004 0x00020024 +DATA 4 0x021b0010 0x00100A82 +DATA 4 0x021b0014 0x00000093 +DATA 4 0x021b0018 0x00001688 +DATA 4 0x021b002c 0x0f9f26d2 +DATA 4 0x021b0030 0x009f0e10 +DATA 4 0x021b0038 0x00190778 +DATA 4 0x021b0008 0x00000000 +DATA 4 0x021b0040 0x0000004f +DATA 4 0x021b0000 0x83110000 +DATA 4 0x021b001c 0x003f8030 +DATA 4 0x021b001c 0xff0a8030 +DATA 4 0x021b001c 0x82018030 +DATA 4 0x021b001c 0x04028030 +DATA 4 0x021b001c 0x02038030 +DATA 4 0x021b001c 0xff0a8038 +DATA 4 0x021b001c 0x82018038 +DATA 4 0x021b001c 0x04028038 +DATA 4 0x021b001c 0x02038038 +DATA 4 0x021b0800 0xa1310003 +DATA 4 0x021b0020 0x00001800 +DATA 4 0x021b0818 0x00000000 +DATA 4 0x021b08b8 0x00000800 +DATA 4 0x021b0004 0x00025564 +DATA 4 0x021b0404 0x00011006 +DATA 4 0x021b001c 0x00000000 diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 27e31f3..da9afb4 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -11,12 +11,17 @@ #include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/imx-common/iomux-v3.h> +#include <asm/imx-common/mxc_i2c.h> #include <asm/io.h> #include <common.h> #include <fsl_esdhc.h> +#include <i2c.h> #include <mmc.h> #include <asm/arch/crm_regs.h> #include <usb.h> +#include <power/pmic.h> +#include <power/pfuze3000_pmic.h> +#include "../freescale/common/pfuze.h" DECLARE_GLOBAL_DATA_PTR; @@ -25,6 +30,26 @@ DECLARE_GLOBAL_DATA_PTR; #define USDHC_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU47KOHM) +#define I2C_PAD_CTRL (PAD_CTL_DSE_3P3V_32OHM | PAD_CTL_SRE_SLOW | \ + PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PUS_PU100KOHM) + +#ifdef CONFIG_SYS_I2C_MXC +#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) +/* I2C1 for PMIC */ +static struct i2c_pads_info i2c_pad_info1 = { + .scl = { + .i2c_mode = MX7D_PAD_I2C1_SCL__I2C1_SCL | PC, + .gpio_mode = MX7D_PAD_I2C1_SCL__GPIO4_IO8 | PC, + .gp = IMX_GPIO_NR(4, 8), + }, + .sda = { + .i2c_mode = MX7D_PAD_I2C1_SDA__I2C1_SDA | PC, + .gpio_mode = MX7D_PAD_I2C1_SDA__GPIO4_IO9 | PC, + .gp = IMX_GPIO_NR(4, 9), + }, +}; +#endif + int dram_init(void) { gd->ram_size = PHYS_SDRAM_SIZE; @@ -85,17 +110,56 @@ int board_early_init_f(void) return 0; } +#ifdef CONFIG_POWER +#define I2C_PMIC 0 +static struct pmic *pfuze; +int power_init_board(void) +{ + int ret; + unsigned int reg, rev_id; + + ret = power_pfuze3000_init(I2C_PMIC); + if (ret) + return ret; + + pfuze = pmic_get("PFUZE3000"); + ret = pmic_probe(pfuze); + if (ret) + return ret; + + pmic_reg_read(pfuze, PFUZE3000_DEVICEID, ®); + pmic_reg_read(pfuze, PFUZE3000_REVID, &rev_id); + printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id); + + /* disable Low Power Mode during standby mode */ + pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1); + + return 0; +} +#endif + int board_init(void) { /* address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; + #ifdef CONFIG_SYS_I2C_MXC + setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); + #endif + return 0; } int checkboard(void) { - puts("Board: WARP7\n"); + char *mode; + + if (IS_ENABLED(CONFIG_ARMV7_BOOT_SEC_DEFAULT)) + mode = "secure"; + else + mode = "non-secure"; + + printf("Board: WARP7 in %s mode\n", mode); return 0; } diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index f15dc5d..0c5d997 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -307,3 +307,8 @@ int board_usb_cleanup(int index, enum usb_init_type init) return 0; } #endif + +void reset_misc(void) +{ + psci_system_reset(true); +} |