mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Compare commits
204 Commits
v2016.01-r
...
v2016.01-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f84c2b665b | ||
|
|
5a4672bb4f | ||
|
|
d0602bd467 | ||
|
|
edf5dd835e | ||
|
|
211d57a45f | ||
|
|
5a37a4007a | ||
|
|
2ec62022ed | ||
|
|
a1ecb4b700 | ||
|
|
3721208fa7 | ||
|
|
34059d8f50 | ||
|
|
48275c96ff | ||
|
|
a1684b6105 | ||
|
|
e5ad7d9889 | ||
|
|
ed77aeb575 | ||
|
|
ccf5648e0e | ||
|
|
dbd6fcfbe2 | ||
|
|
8e535af2e4 | ||
|
|
ea08234651 | ||
|
|
a5cad67735 | ||
|
|
92232747bb | ||
|
|
ac5516dd30 | ||
|
|
b5a5d2bd96 | ||
|
|
225217da28 | ||
|
|
9368aa6a68 | ||
|
|
5b5226a8e6 | ||
|
|
c90ada94fb | ||
|
|
70311e69fa | ||
|
|
ef4b01b2f7 | ||
|
|
faed7ac8fa | ||
|
|
1f5f187172 | ||
|
|
5df93c5564 | ||
|
|
b5aaa03634 | ||
|
|
6b9cdb716f | ||
|
|
5d8546efa7 | ||
|
|
22854bda80 | ||
|
|
1c0e84ca82 | ||
|
|
11b35d557b | ||
|
|
4909f0e16a | ||
|
|
aeea8754ff | ||
|
|
455e8fde4d | ||
|
|
bc3abe149f | ||
|
|
7ef051ec9e | ||
|
|
2aee06a259 | ||
|
|
4832e17787 | ||
|
|
b5e9b9a9a1 | ||
|
|
4280f50238 | ||
|
|
ef159abf99 | ||
|
|
4632b1ea20 | ||
|
|
4de9bbdcc8 | ||
|
|
4fcd0b33c7 | ||
|
|
94067580a5 | ||
|
|
7bccc75a2b | ||
|
|
c942810787 | ||
|
|
9d9211ac11 | ||
|
|
da872d7c13 | ||
|
|
bcdfef7a26 | ||
|
|
7bbf825492 | ||
|
|
04a44d3671 | ||
|
|
bc36605035 | ||
|
|
f0b567bf0a | ||
|
|
8647219b5c | ||
|
|
123b701779 | ||
|
|
e4b70d8035 | ||
|
|
fee331f66c | ||
|
|
70cc443d58 | ||
|
|
5d5716eebc | ||
|
|
a4bb9b3636 | ||
|
|
c0982871df | ||
|
|
e30824f439 | ||
|
|
e179cedd09 | ||
|
|
507e677bc4 | ||
|
|
be5e4bdced | ||
|
|
f4d9bd06f7 | ||
|
|
06cb6ccd8e | ||
|
|
193979e2fe | ||
|
|
155e740f73 | ||
|
|
f52dd802cc | ||
|
|
ae1f2f0c4a | ||
|
|
28b9774808 | ||
|
|
de578e22d4 | ||
|
|
2f6560a146 | ||
|
|
c056c52bbd | ||
|
|
627d929826 | ||
|
|
5f3a562a3b | ||
|
|
1f99ab5c92 | ||
|
|
2c12ff039c | ||
|
|
014728133a | ||
|
|
b4d5cf0bc8 | ||
|
|
1c84cc6e3b | ||
|
|
9cddb4fe02 | ||
|
|
ea1332ceb4 | ||
|
|
1c5c6a5761 | ||
|
|
e2f019d783 | ||
|
|
0d6faf2bd0 | ||
|
|
2949ae5212 | ||
|
|
862d9296dd | ||
|
|
509356224b | ||
|
|
35065cdd94 | ||
|
|
52bc7c7e2b | ||
|
|
2e680f92b8 | ||
|
|
e6e3faa5c2 | ||
|
|
989c5f0a8f | ||
|
|
3a4800a596 | ||
|
|
9711f52806 | ||
|
|
e8f954a756 | ||
|
|
70f959c3c4 | ||
|
|
b644d3e932 | ||
|
|
beedbc2ea0 | ||
|
|
c04921414c | ||
|
|
aabd7ddb88 | ||
|
|
c107c0c05c | ||
|
|
e81495224f | ||
|
|
000f4e7686 | ||
|
|
6c4a1eba3f | ||
|
|
0b8bc6314e | ||
|
|
312db9f75f | ||
|
|
5915517b7b | ||
|
|
47b4c228b5 | ||
|
|
e390680015 | ||
|
|
762b353546 | ||
|
|
7ba0261810 | ||
|
|
b1f6be5ac8 | ||
|
|
1a33892164 | ||
|
|
b22b1dc6b7 | ||
|
|
e994dddbbe | ||
|
|
a46b1852de | ||
|
|
a07bdad749 | ||
|
|
0c028a0328 | ||
|
|
1aaf3f9ae4 | ||
|
|
3901978d42 | ||
|
|
c4243ac9e2 | ||
|
|
6c6e006a20 | ||
|
|
7cc079989d | ||
|
|
8a51429e00 | ||
|
|
0fb7197436 | ||
|
|
19601dd99c | ||
|
|
653447b407 | ||
|
|
69bf2d2faf | ||
|
|
6463fd8f95 | ||
|
|
f4a8a1757b | ||
|
|
fc011f6402 | ||
|
|
e4c5383e4d | ||
|
|
2b22a99c65 | ||
|
|
962a43cc96 | ||
|
|
4363de63a8 | ||
|
|
717f8845ac | ||
|
|
7bf274b9ca | ||
|
|
5cc5b901e6 | ||
|
|
8405b8d98a | ||
|
|
9d5108d8be | ||
|
|
69b918b65d | ||
|
|
b3b522f247 | ||
|
|
665624149a | ||
|
|
5076c64a08 | ||
|
|
76de51a6da | ||
|
|
fe94b48de2 | ||
|
|
cba65a77c4 | ||
|
|
339fd6dca5 | ||
|
|
bfdb07eb4b | ||
|
|
b6a2c436e0 | ||
|
|
aae00f8bab | ||
|
|
615879ac1a | ||
|
|
6f9d670d8e | ||
|
|
cb37518516 | ||
|
|
fc335d63b0 | ||
|
|
6fa40e796c | ||
|
|
0edae52f08 | ||
|
|
1e90d9fd31 | ||
|
|
3847c0c180 | ||
|
|
3a1adb621b | ||
|
|
8e4920e53e | ||
|
|
23ef5aea84 | ||
|
|
53cc647dc6 | ||
|
|
cd337da21e | ||
|
|
379b49d82e | ||
|
|
f7a5f025ba | ||
|
|
a5d4785ccb | ||
|
|
0305be1087 | ||
|
|
61d815a2cb | ||
|
|
eb623b98c9 | ||
|
|
7b98a3b676 | ||
|
|
8951523c6a | ||
|
|
bb3654629a | ||
|
|
23baf66f25 | ||
|
|
887e2fd9da | ||
|
|
6edf6a2179 | ||
|
|
086a2509e9 | ||
|
|
333d859dcb | ||
|
|
81f50d93cb | ||
|
|
f542948b1e | ||
|
|
95ab8fee8a | ||
|
|
813c7372bb | ||
|
|
d5a3357f1b | ||
|
|
762e24a078 | ||
|
|
cbc1a91afb | ||
|
|
789fa275b3 | ||
|
|
d475d59020 | ||
|
|
efe2d80cca | ||
|
|
9bf76c21e0 | ||
|
|
2317cf0970 | ||
|
|
4932443d26 | ||
|
|
c5c5c201fe | ||
|
|
a0ae380b3c | ||
|
|
8555dd88cd |
6
.mailmap
6
.mailmap
@@ -13,7 +13,11 @@ Andreas Bießmann <andreas.devel@googlemail.com>
|
||||
Aneesh V <aneesh@ti.com>
|
||||
Dirk Behme <dirk.behme@googlemail.com>
|
||||
Fabio Estevam <fabio.estevam@freescale.com>
|
||||
Jagannadha Sutradharudu Teki <402jagan@gmail.com>
|
||||
Jagan Teki <402jagan@gmail.com>
|
||||
Jagan Teki <jaganna@gmail.com>
|
||||
Jagan Teki <jaganna@xilinx.com>
|
||||
Jagan Teki <jagannadh.teki@gmail.com>
|
||||
Jagan Teki <jagannadha.sutradharudu-teki@xilinx.com>
|
||||
Markus Klotzbuecher <mk@denx.de>
|
||||
Prabhakar Kushwaha <prabhakar@freescale.com>
|
||||
Rajeshwari Shinde <rajeshwari.s@samsung.com>
|
||||
|
||||
2
Makefile
2
Makefile
@@ -5,7 +5,7 @@
|
||||
VERSION = 2016
|
||||
PATCHLEVEL = 01
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION = -rc3
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
||||
14
README
14
README
@@ -3869,7 +3869,15 @@ Configuration Settings:
|
||||
Scratch address used by the alternate memory test
|
||||
You only need to set this if address zero isn't writeable
|
||||
|
||||
- CONFIG_SYS_MEM_TOP_HIDE (PPC only):
|
||||
- CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
If defined, the size of CONFIG_SYS_MEM_RESERVE_SECURE memory
|
||||
is substracted from total RAM and won't be reported to OS.
|
||||
This memory can be used as secure memory. A variable
|
||||
gd->secure_ram is used to track the location. In systems
|
||||
the RAM base is not zero, or RAM is divided into banks,
|
||||
this variable needs to be recalcuated to get the address.
|
||||
|
||||
- CONFIG_SYS_MEM_TOP_HIDE:
|
||||
If CONFIG_SYS_MEM_TOP_HIDE is defined in the board config header,
|
||||
this specified memory area will get subtracted from the top
|
||||
(end) of RAM and won't get "touched" at all by U-Boot. By
|
||||
@@ -5048,8 +5056,8 @@ This firmware often needs to be loaded during U-Boot booting.
|
||||
- CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE
|
||||
Define minimum DDR size required for debug server image
|
||||
|
||||
- CONFIG_SYS_MEM_TOP_HIDE_MIN
|
||||
Define minimum DDR size to be hided from top of the DDR memory
|
||||
- CONFIG_SYS_MC_RSV_MEM_ALIGN
|
||||
Define alignment of reserved memory MC requires
|
||||
|
||||
Reproducible builds
|
||||
-------------------
|
||||
|
||||
@@ -40,6 +40,7 @@ config BLACKFIN
|
||||
|
||||
config M68K
|
||||
bool "M68000 architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select HAVE_GENERIC_BOARD
|
||||
select SYS_GENERIC_BOARD
|
||||
|
||||
|
||||
@@ -42,4 +42,16 @@
|
||||
clock-names = "stmmaceth";
|
||||
max-speed = <100>;
|
||||
};
|
||||
|
||||
ehci@0xe0040000 {
|
||||
compatible = "generic-ehci";
|
||||
reg = < 0xe0040000 0x100 >;
|
||||
interrupts = < 8 >;
|
||||
};
|
||||
|
||||
ohci@0xe0060000 {
|
||||
compatible = "generic-ohci";
|
||||
reg = < 0xe0060000 0x100 >;
|
||||
interrupts = < 8 >;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -516,14 +516,16 @@ config ARCH_SUNXI
|
||||
bool "Support sunxi (Allwinner) SoCs"
|
||||
select CMD_USB
|
||||
select DM
|
||||
select DM_GPIO
|
||||
select DM_ETH
|
||||
select DM_GPIO
|
||||
select DM_KEYBOARD
|
||||
select DM_SERIAL
|
||||
select DM_USB
|
||||
select OF_CONTROL
|
||||
select OF_SEPARATE
|
||||
select SPL_STACK_R if !MACH_SUN9I
|
||||
select SPL_SYS_MALLOC_SIMPLE if !MACH_SUN9I
|
||||
select SYS_NS16550
|
||||
select USB
|
||||
select USB_STORAGE
|
||||
select USB_KEYBOARD
|
||||
@@ -696,6 +698,8 @@ config ARCH_UNIPHIER
|
||||
config TARGET_STM32F429_DISCOVERY
|
||||
bool "Support STM32F429 Discovery"
|
||||
select CPU_V7M
|
||||
select DM
|
||||
select DM_SERIAL
|
||||
|
||||
config ARCH_ROCKCHIP
|
||||
bool "Support Rockchip SoCs"
|
||||
|
||||
@@ -164,6 +164,13 @@ void config_sdram(const struct emif_regs *regs, int nr)
|
||||
writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
|
||||
writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
|
||||
writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
|
||||
|
||||
/* Trigger initialization */
|
||||
writel(0x00003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
|
||||
/* Wait 1ms because of L3 timeout error */
|
||||
udelay(1000);
|
||||
|
||||
/* Write proper sdram_ref_cref_ctrl value */
|
||||
writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
|
||||
writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
|
||||
}
|
||||
@@ -292,7 +299,9 @@ void config_ddr_phy(const struct emif_regs *regs, int nr)
|
||||
EMIF_REG_INITREF_DIS_MASK);
|
||||
#endif
|
||||
if (regs->zq_config)
|
||||
writel(0x80003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
|
||||
/* Set time between rising edge of DDR_RESET to rising
|
||||
* edge of DDR_CKE to > 500us per memory spec. */
|
||||
writel(0x00003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
|
||||
|
||||
writel(regs->emif_ddr_phy_ctlr_1,
|
||||
&emif_reg[nr]->emif_ddr_phy_ctrl_1);
|
||||
|
||||
@@ -8,6 +8,7 @@ obj-y += cpu.o
|
||||
obj-y += clock.o
|
||||
obj-y += timer.o
|
||||
obj-y += fsl_epu.o
|
||||
obj-y += soc.o
|
||||
|
||||
obj-$(CONFIG_SCSI_AHCI_PLAT) += ls102xa_sata.o
|
||||
obj-$(CONFIG_OF_LIBFDT) += fdt.o
|
||||
|
||||
@@ -218,6 +218,14 @@ void enable_caches(void)
|
||||
}
|
||||
#endif /* #ifndef CONFIG_SYS_DCACHE_OFF */
|
||||
|
||||
|
||||
uint get_svr(void)
|
||||
{
|
||||
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
|
||||
|
||||
return in_be32(&gur->svr);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
|
||||
90
arch/arm/cpu/armv7/ls102xa/soc.c
Normal file
90
arch/arm/cpu/armv7/ls102xa/soc.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2015 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/immap_ls102xa.h>
|
||||
#include <asm/arch/ls102xa_soc.h>
|
||||
|
||||
unsigned int get_soc_major_rev(void)
|
||||
{
|
||||
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
|
||||
unsigned int svr, major;
|
||||
|
||||
svr = in_be32(&gur->svr);
|
||||
major = SVR_MAJ(svr);
|
||||
|
||||
return major;
|
||||
}
|
||||
|
||||
int arch_soc_init(void)
|
||||
{
|
||||
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
|
||||
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
|
||||
unsigned int major;
|
||||
|
||||
#ifdef CONFIG_FSL_QSPI
|
||||
out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FSL_DCU_FB
|
||||
out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN);
|
||||
#endif
|
||||
|
||||
/* Configure Little endian for SAI, ASRC and SPDIF */
|
||||
out_be32(&scfg->endiancr, SCFG_ENDIANCR_LE);
|
||||
|
||||
/*
|
||||
* Enable snoop requests and DVM message requests for
|
||||
* All the slave insterfaces.
|
||||
*/
|
||||
out_le32(&cci->slave[0].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
out_le32(&cci->slave[1].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
out_le32(&cci->slave[2].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
out_le32(&cci->slave[4].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
|
||||
major = get_soc_major_rev();
|
||||
if (major == SOC_MAJOR_VER_1_0) {
|
||||
/*
|
||||
* Set CCI-400 Slave interface S1, S2 Shareable Override
|
||||
* Register All transactions are treated as non-shareable
|
||||
*/
|
||||
out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
|
||||
/* Workaround for the issue that DDR could not respond to
|
||||
* barrier transaction which is generated by executing DSB/ISB
|
||||
* instruction. Set CCI-400 control override register to
|
||||
* terminate the barrier transaction. After DDR is initialized,
|
||||
* allow barrier transaction to DDR again */
|
||||
out_le32(&cci->ctrl_ord, CCI400_CTRLORD_TERM_BARRIER);
|
||||
}
|
||||
|
||||
/* Enable all the snoop signal for various masters */
|
||||
out_be32(&scfg->snpcnfgcr, SCFG_SNPCNFGCR_SEC_RD_WR |
|
||||
SCFG_SNPCNFGCR_DCU_RD_WR |
|
||||
SCFG_SNPCNFGCR_SATA_RD_WR |
|
||||
SCFG_SNPCNFGCR_USB3_RD_WR |
|
||||
SCFG_SNPCNFGCR_DBG_RD_WR |
|
||||
SCFG_SNPCNFGCR_EDMA_SNP);
|
||||
|
||||
/*
|
||||
* Memory controller require a register write before being enabled.
|
||||
* Affects: DDR
|
||||
* Register: EDDRTQCFG
|
||||
* Description: Memory controller performance is not optimal with
|
||||
* default internal target queue register values.
|
||||
* Workaround: Write a value of 63b2_0042h to address: 157_020Ch.
|
||||
*/
|
||||
out_be32(&scfg->eddrtqcfg, 0x63b20042);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -208,6 +208,7 @@ int board_mmc_init(bd_t *bis)
|
||||
break;
|
||||
case BOOT_DEVICE_MMC2:
|
||||
case BOOT_DEVICE_MMC2_2:
|
||||
omap_mmc_init(0, 0, 0, -1, -1);
|
||||
omap_mmc_init(1, 0, 0, -1, -1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -26,13 +26,18 @@ obj-$(CONFIG_MACH_SUN4I) += clock_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN5I) += clock_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN6I) += clock_sun6i.o
|
||||
obj-$(CONFIG_MACH_SUN7I) += clock_sun4i.o
|
||||
ifdef CONFIG_MACH_SUN8I_A83T
|
||||
obj-y += clock_sun8i_a83t.o
|
||||
else
|
||||
obj-$(CONFIG_MACH_SUN8I) += clock_sun6i.o
|
||||
endif
|
||||
obj-$(CONFIG_MACH_SUN9I) += clock_sun9i.o
|
||||
obj-$(CONFIG_MACH_SUN6I) += tzpc.o
|
||||
|
||||
obj-$(CONFIG_AXP152_POWER) += pmic_bus.o
|
||||
obj-$(CONFIG_AXP209_POWER) += pmic_bus.o
|
||||
obj-$(CONFIG_AXP221_POWER) += pmic_bus.o
|
||||
obj-$(CONFIG_AXP818_POWER) += pmic_bus.o
|
||||
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ifdef CONFIG_ARMV7_PSCI
|
||||
@@ -49,6 +54,7 @@ obj-$(CONFIG_MACH_SUN6I) += dram_sun6i.o
|
||||
obj-$(CONFIG_MACH_SUN7I) += dram_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN8I_A23) += dram_sun8i_a23.o
|
||||
obj-$(CONFIG_MACH_SUN8I_A33) += dram_sun8i_a33.o
|
||||
obj-$(CONFIG_MACH_SUN8I_A83T) += dram_sun8i_a83t.o
|
||||
obj-$(CONFIG_MACH_SUN8I_H3) += dram_sun8i_h3.o
|
||||
obj-y += fel_utils.o
|
||||
endif
|
||||
|
||||
@@ -76,6 +76,10 @@ static int gpio_init(void)
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPA(4), SUN8I_H3_GPA_UART0);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPA(5), SUN8I_H3_GPA_UART0);
|
||||
sunxi_gpio_set_pull(SUNXI_GPA(5), SUNXI_GPIO_PULL_UP);
|
||||
#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN8I_A83T)
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPB(9), SUN8I_A83T_GPB_UART0);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPB(10), SUN8I_A83T_GPB_UART0);
|
||||
sunxi_gpio_set_pull(SUNXI_GPB(10), SUNXI_GPIO_PULL_UP);
|
||||
#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN9I)
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPH(12), SUN9I_GPH_UART0);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPH(13), SUN9I_GPH_UART0);
|
||||
|
||||
@@ -59,7 +59,7 @@ void clock_init_uart(void)
|
||||
|
||||
/* open the clock for uart */
|
||||
setbits_le32(&ccm->apb1_gate,
|
||||
CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX-1));
|
||||
CLK_GATE_OPEN << (APB1_GATE_UART_SHIFT+CONFIG_CONS_INDEX - 1));
|
||||
}
|
||||
|
||||
int clock_twi_onoff(int port, int state)
|
||||
@@ -67,16 +67,13 @@ int clock_twi_onoff(int port, int state)
|
||||
struct sunxi_ccm_reg *const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
|
||||
if (port > 2)
|
||||
return -1;
|
||||
|
||||
/* set the apb clock gate for twi */
|
||||
if (state)
|
||||
setbits_le32(&ccm->apb1_gate,
|
||||
CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
|
||||
CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
|
||||
else
|
||||
clrbits_le32(&ccm->apb1_gate,
|
||||
CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT+port));
|
||||
CLK_GATE_OPEN << (APB1_GATE_TWI_SHIFT + port));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -77,9 +77,6 @@ int clock_twi_onoff(int port, int state)
|
||||
struct sunxi_ccm_reg *const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
|
||||
if (port > 3)
|
||||
return -1;
|
||||
|
||||
/* set the apb clock gate for twi */
|
||||
if (state)
|
||||
setbits_le32(&ccm->apb2_gate,
|
||||
|
||||
136
arch/arm/cpu/armv7/sunxi/clock_sun8i_a83t.c
Normal file
136
arch/arm/cpu/armv7/sunxi/clock_sun8i_a83t.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* A83 specific clock code
|
||||
*
|
||||
* (C) Copyright 2007-2012
|
||||
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
||||
* Tom Cubie <tangliang@allwinnertech.com>
|
||||
*
|
||||
* (C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/prcm.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
void clock_init_safe(void)
|
||||
{
|
||||
struct sunxi_ccm_reg * const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
|
||||
clock_set_pll1(408000000);
|
||||
/* enable pll_hsic, default is 480M */
|
||||
writel(PLL8_CFG_DEFAULT, &ccm->pll8_cfg);
|
||||
writel(readl(&ccm->pll8_cfg) | (0x1 << 31), &ccm->pll8_cfg);
|
||||
while (!(readl(&ccm->pll_stable_status) & (1 << 8))) {}
|
||||
|
||||
/* switch to default 24MHz before changing to hsic */
|
||||
writel(0x0, &ccm->cci400_cfg);
|
||||
sdelay(50);
|
||||
writel(CCM_CCI400_CLK_SEL_HSIC, &ccm->cci400_cfg);
|
||||
sdelay(100);
|
||||
|
||||
/* switch before changing pll6 */
|
||||
clrsetbits_le32(&ccm->ahb1_apb1_div, AHB1_CLK_SRC_MASK,
|
||||
AHB1_CLK_SRC_OSC24M);
|
||||
writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
|
||||
while (!(readl(&ccm->pll_stable_status) & (1 << 6))) {}
|
||||
|
||||
writel(AHB1_ABP1_DIV_DEFAULT, &ccm->ahb1_apb1_div);
|
||||
writel(CCM_MBUS_RESET_RESET, &ccm->mbus_reset);
|
||||
writel(MBUS_CLK_DEFAULT, &ccm->mbus_clk_cfg);
|
||||
|
||||
/* timestamp */
|
||||
writel(1, 0x01720000);
|
||||
}
|
||||
#endif
|
||||
|
||||
void clock_init_uart(void)
|
||||
{
|
||||
struct sunxi_ccm_reg *const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
|
||||
/* uart clock source is apb2 */
|
||||
writel(APB2_CLK_SRC_OSC24M|
|
||||
APB2_CLK_RATE_N_1|
|
||||
APB2_CLK_RATE_M(1),
|
||||
&ccm->apb2_div);
|
||||
|
||||
/* open the clock for uart */
|
||||
setbits_le32(&ccm->apb2_gate,
|
||||
CLK_GATE_OPEN << (APB2_GATE_UART_SHIFT +
|
||||
CONFIG_CONS_INDEX - 1));
|
||||
|
||||
/* deassert uart reset */
|
||||
setbits_le32(&ccm->apb2_reset_cfg,
|
||||
1 << (APB2_RESET_UART_SHIFT +
|
||||
CONFIG_CONS_INDEX - 1));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
void clock_set_pll1(unsigned int clk)
|
||||
{
|
||||
struct sunxi_ccm_reg * const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
const int p = 0;
|
||||
|
||||
/* Switch to 24MHz clock while changing PLL1 */
|
||||
writel(AXI_DIV_2 << AXI0_DIV_SHIFT |
|
||||
AXI_DIV_2 << AXI1_DIV_SHIFT |
|
||||
CPU_CLK_SRC_OSC24M << C0_CPUX_CLK_SRC_SHIFT |
|
||||
CPU_CLK_SRC_OSC24M << C1_CPUX_CLK_SRC_SHIFT,
|
||||
&ccm->cpu_axi_cfg);
|
||||
|
||||
/* clk = 24*n/p, p is ignored if clock is >288MHz */
|
||||
writel(CCM_PLL1_CTRL_EN | CCM_PLL1_CTRL_P(p) | CMM_PLL1_CLOCK_TIME_2 |
|
||||
CCM_PLL1_CTRL_N(clk / 24000000),
|
||||
&ccm->pll1_c0_cfg);
|
||||
while (!(readl(&ccm->pll_stable_status) & 0x01)) {}
|
||||
|
||||
writel(CCM_PLL1_CTRL_EN | CCM_PLL1_CTRL_P(p) | CMM_PLL1_CLOCK_TIME_2 |
|
||||
CCM_PLL1_CTRL_N(clk / (24000000)),
|
||||
&ccm->pll1_c1_cfg);
|
||||
while (!(readl(&ccm->pll_stable_status) & 0x02)) {}
|
||||
|
||||
/* Switch CPU to PLL1 */
|
||||
writel(AXI_DIV_2 << AXI0_DIV_SHIFT |
|
||||
AXI_DIV_2 << AXI1_DIV_SHIFT |
|
||||
CPU_CLK_SRC_PLL1 << C0_CPUX_CLK_SRC_SHIFT |
|
||||
CPU_CLK_SRC_PLL1 << C1_CPUX_CLK_SRC_SHIFT,
|
||||
&ccm->cpu_axi_cfg);
|
||||
}
|
||||
#endif
|
||||
|
||||
void clock_set_pll5(unsigned int clk)
|
||||
{
|
||||
struct sunxi_ccm_reg * const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
unsigned int div1 = 0, div2 = 0;
|
||||
|
||||
/* A83T PLL5 DDR rate = 24000000 * (n+1)/(div1+1)/(div2+1) */
|
||||
writel(CCM_PLL5_CTRL_EN | CCM_PLL5_CTRL_UPD |
|
||||
CCM_PLL5_CTRL_N(clk / (24000000)) |
|
||||
div2 << CCM_PLL5_DIV2_SHIFT |
|
||||
div1 << CCM_PLL5_DIV1_SHIFT, &ccm->pll5_cfg);
|
||||
|
||||
udelay(5500);
|
||||
}
|
||||
|
||||
|
||||
unsigned int clock_get_pll6(void)
|
||||
{
|
||||
struct sunxi_ccm_reg *const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
|
||||
uint32_t rval = readl(&ccm->pll6_cfg);
|
||||
int n = ((rval & CCM_PLL6_CTRL_N_MASK) >> CCM_PLL6_CTRL_N_SHIFT);
|
||||
int div1 = ((rval & CCM_PLL6_CTRL_DIV1_MASK) >>
|
||||
CCM_PLL6_CTRL_DIV1_SHIFT) + 1;
|
||||
int div2 = ((rval & CCM_PLL6_CTRL_DIV2_MASK) >>
|
||||
CCM_PLL6_CTRL_DIV2_SHIFT) + 1;
|
||||
return 24000000 * n / div1 / div2;
|
||||
}
|
||||
@@ -73,6 +73,8 @@ int print_cpuinfo(void)
|
||||
puts("CPU: Allwinner H3 (SUN8I)\n");
|
||||
#elif defined CONFIG_MACH_SUN9I
|
||||
puts("CPU: Allwinner A80 (SUN9I)\n");
|
||||
#elif defined CONFIG_MACH_SUN8I_A83T
|
||||
puts("CPU: Allwinner A83T (SUN8I)\n");
|
||||
#else
|
||||
#warning Please update cpu_info.c with correct CPU information
|
||||
puts("CPU: SUNXI Family\n");
|
||||
|
||||
424
arch/arm/cpu/armv7/sunxi/dram_sun8i_a83t.c
Normal file
424
arch/arm/cpu/armv7/sunxi/dram_sun8i_a83t.c
Normal file
@@ -0,0 +1,424 @@
|
||||
/*
|
||||
* Sun8i a33 platform dram controller init.
|
||||
*
|
||||
* (C) Copyright 2007-2015 Allwinner Technology Co.
|
||||
* Jerry Wang <wangflord@allwinnertech.com>
|
||||
* (C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
* (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#include <common.h>
|
||||
#include <errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/dram.h>
|
||||
#include <asm/arch/prcm.h>
|
||||
|
||||
#define DRAM_CLK_MUL 2
|
||||
#define DRAM_CLK_DIV 1
|
||||
|
||||
struct dram_para {
|
||||
u8 cs1;
|
||||
u8 seq;
|
||||
u8 bank;
|
||||
u8 rank;
|
||||
u8 rows;
|
||||
u8 bus_width;
|
||||
u16 page_size;
|
||||
};
|
||||
|
||||
static void mctl_set_cr(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_mctl_com_reg * const mctl_com =
|
||||
(struct sunxi_mctl_com_reg *)SUNXI_DRAM_COM_BASE;
|
||||
|
||||
writel(MCTL_CR_CS1_CONTROL(para->cs1) | MCTL_CR_UNKNOWN |
|
||||
MCTL_CR_CHANNEL(1) | MCTL_CR_DDR3 |
|
||||
(para->seq ? MCTL_CR_SEQUENCE : 0) |
|
||||
((para->bus_width == 16) ? MCTL_CR_BUSW16 : MCTL_CR_BUSW8) |
|
||||
MCTL_CR_PAGE_SIZE(para->page_size) | MCTL_CR_ROW(para->rows) |
|
||||
MCTL_CR_BANK(para->bank) | MCTL_CR_RANK(para->rank),
|
||||
&mctl_com->cr);
|
||||
}
|
||||
|
||||
static void auto_detect_dram_size(struct dram_para *para)
|
||||
{
|
||||
u8 orig_rank = para->rank;
|
||||
int rows, columns;
|
||||
|
||||
/* Row detect */
|
||||
para->page_size = 512;
|
||||
para->seq = 1;
|
||||
para->rows = 16;
|
||||
para->rank = 1;
|
||||
mctl_set_cr(para);
|
||||
for (rows = 11 ; rows < 16 ; rows++) {
|
||||
if (mctl_mem_matches(1 << (rows + 9))) /* row-column */
|
||||
break;
|
||||
}
|
||||
|
||||
/* Column (page size) detect */
|
||||
para->rows = 11;
|
||||
para->page_size = 8192;
|
||||
mctl_set_cr(para);
|
||||
for (columns = 9 ; columns < 13 ; columns++) {
|
||||
if (mctl_mem_matches(1 << columns))
|
||||
break;
|
||||
}
|
||||
|
||||
para->seq = 0;
|
||||
para->rank = orig_rank;
|
||||
para->rows = rows;
|
||||
para->page_size = 1 << columns;
|
||||
mctl_set_cr(para);
|
||||
}
|
||||
|
||||
static inline int ns_to_t(int nanoseconds)
|
||||
{
|
||||
const unsigned int ctrl_freq =
|
||||
CONFIG_DRAM_CLK * DRAM_CLK_MUL / DRAM_CLK_DIV;
|
||||
|
||||
return (ctrl_freq * nanoseconds + 999) / 1000;
|
||||
}
|
||||
|
||||
static void auto_set_timing_para(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
u32 reg_val;
|
||||
|
||||
u8 tccd = 2;
|
||||
u8 tfaw = ns_to_t(50);
|
||||
u8 trrd = max(ns_to_t(10), 4);
|
||||
u8 trcd = ns_to_t(15);
|
||||
u8 trc = ns_to_t(53);
|
||||
u8 txp = max(ns_to_t(8), 3);
|
||||
u8 twtr = max(ns_to_t(8), 4);
|
||||
u8 trtp = max(ns_to_t(8), 4);
|
||||
u8 twr = max(ns_to_t(15), 3);
|
||||
u8 trp = ns_to_t(15);
|
||||
u8 tras = ns_to_t(38);
|
||||
|
||||
u16 trefi = ns_to_t(7800) / 32;
|
||||
u16 trfc = ns_to_t(350);
|
||||
|
||||
/* Fixed timing parameters */
|
||||
u8 tmrw = 0;
|
||||
u8 tmrd = 4;
|
||||
u8 tmod = 12;
|
||||
u8 tcke = 3;
|
||||
u8 tcksrx = 5;
|
||||
u8 tcksre = 5;
|
||||
u8 tckesr = 4;
|
||||
u8 trasmax = 24;
|
||||
u8 tcl = 6; /* CL 12 */
|
||||
u8 tcwl = 4; /* CWL 8 */
|
||||
u8 t_rdata_en = 4;
|
||||
u8 wr_latency = 2;
|
||||
|
||||
u32 tdinit0 = (500 * CONFIG_DRAM_CLK) + 1; /* 500us */
|
||||
u32 tdinit1 = (360 * CONFIG_DRAM_CLK) / 1000 + 1; /* 360ns */
|
||||
u32 tdinit2 = (200 * CONFIG_DRAM_CLK) + 1; /* 200us */
|
||||
u32 tdinit3 = (1 * CONFIG_DRAM_CLK) + 1; /* 1us */
|
||||
|
||||
u8 twtp = tcwl + 2 + twr; /* WL + BL / 2 + tWR */
|
||||
u8 twr2rd = tcwl + 2 + twtr; /* WL + BL / 2 + tWTR */
|
||||
u8 trd2wr = tcl + 2 + 1 - tcwl; /* RL + BL / 2 + 2 - WL */
|
||||
|
||||
/* Set work mode register */
|
||||
mctl_set_cr(para);
|
||||
/* Set mode register */
|
||||
writel(MCTL_MR0, &mctl_ctl->mr0);
|
||||
writel(MCTL_MR1, &mctl_ctl->mr1);
|
||||
writel(MCTL_MR2, &mctl_ctl->mr2);
|
||||
writel(MCTL_MR3, &mctl_ctl->mr3);
|
||||
/* Set dram timing */
|
||||
reg_val = (twtp << 24) | (tfaw << 16) | (trasmax << 8) | (tras << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg0);
|
||||
reg_val = (txp << 16) | (trtp << 8) | (trc << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg1);
|
||||
reg_val = (tcwl << 24) | (tcl << 16) | (trd2wr << 8) | (twr2rd << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg2);
|
||||
reg_val = (tmrw << 16) | (tmrd << 12) | (tmod << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg3);
|
||||
reg_val = (trcd << 24) | (tccd << 16) | (trrd << 8) | (trp << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg4);
|
||||
reg_val = (tcksrx << 24) | (tcksre << 16) | (tckesr << 8) | (tcke << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg5);
|
||||
/* Set two rank timing and exit self-refresh timing */
|
||||
reg_val = readl(&mctl_ctl->dramtmg8);
|
||||
reg_val &= ~(0xff << 8);
|
||||
reg_val &= ~(0xff << 0);
|
||||
reg_val |= (0x33 << 8);
|
||||
reg_val |= (0x8 << 0);
|
||||
writel(reg_val, &mctl_ctl->dramtmg8);
|
||||
/* Set phy interface time */
|
||||
reg_val = (0x2 << 24) | (t_rdata_en << 16) | (0x1 << 8)
|
||||
| (wr_latency << 0);
|
||||
/* PHY interface write latency and read latency configure */
|
||||
writel(reg_val, &mctl_ctl->pitmg0);
|
||||
/* Set phy time PTR0-2 use default */
|
||||
writel(((tdinit0 << 0) | (tdinit1 << 20)), &mctl_ctl->ptr3);
|
||||
writel(((tdinit2 << 0) | (tdinit3 << 20)), &mctl_ctl->ptr4);
|
||||
/* Set refresh timing */
|
||||
reg_val = (trefi << 16) | (trfc << 0);
|
||||
writel(reg_val, &mctl_ctl->rfshtmg);
|
||||
}
|
||||
|
||||
static void mctl_set_pir(u32 val)
|
||||
{
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
writel(val, &mctl_ctl->pir);
|
||||
mctl_await_completion(&mctl_ctl->pgsr0, 0x1, 0x1);
|
||||
}
|
||||
|
||||
static void mctl_data_train_cfg(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
if (para->rank == 2)
|
||||
clrsetbits_le32(&mctl_ctl->dtcr, 0x3 << 24, 0x3 << 24);
|
||||
else
|
||||
clrsetbits_le32(&mctl_ctl->dtcr, 0x3 << 24, 0x1 << 24);
|
||||
}
|
||||
|
||||
static int mctl_train_dram(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
mctl_data_train_cfg(para);
|
||||
mctl_set_pir(0x5f3);
|
||||
|
||||
return ((readl(&mctl_ctl->pgsr0) >> 20) & 0xff) ? -EIO : 0;
|
||||
}
|
||||
|
||||
static void set_master_priority(void)
|
||||
{
|
||||
writel(0x00a0000d, MCTL_MASTER_CFG0(0));
|
||||
writel(0x00500064, MCTL_MASTER_CFG1(0));
|
||||
writel(0x07000009, MCTL_MASTER_CFG0(1));
|
||||
writel(0x00000600, MCTL_MASTER_CFG1(1));
|
||||
writel(0x01000009, MCTL_MASTER_CFG0(3));
|
||||
writel(0x00000064, MCTL_MASTER_CFG1(3));
|
||||
writel(0x08000009, MCTL_MASTER_CFG0(4));
|
||||
writel(0x00000640, MCTL_MASTER_CFG1(4));
|
||||
writel(0x20000308, MCTL_MASTER_CFG0(8));
|
||||
writel(0x00001000, MCTL_MASTER_CFG1(8));
|
||||
writel(0x02800009, MCTL_MASTER_CFG0(9));
|
||||
writel(0x00000100, MCTL_MASTER_CFG1(9));
|
||||
writel(0x01800009, MCTL_MASTER_CFG0(5));
|
||||
writel(0x00000100, MCTL_MASTER_CFG1(5));
|
||||
writel(0x01800009, MCTL_MASTER_CFG0(7));
|
||||
writel(0x00000100, MCTL_MASTER_CFG1(7));
|
||||
writel(0x00640009, MCTL_MASTER_CFG0(6));
|
||||
writel(0x00000032, MCTL_MASTER_CFG1(6));
|
||||
writel(0x0100000d, MCTL_MASTER_CFG0(2));
|
||||
writel(0x00500080, MCTL_MASTER_CFG1(2));
|
||||
}
|
||||
|
||||
static int mctl_channel_init(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
struct sunxi_mctl_com_reg * const mctl_com =
|
||||
(struct sunxi_mctl_com_reg *)SUNXI_DRAM_COM_BASE;
|
||||
u32 low_data_lines_status; /* Training status of datalines 0 - 7 */
|
||||
u32 high_data_lines_status; /* Training status of datalines 8 - 15 */
|
||||
u32 i, rval;
|
||||
|
||||
auto_set_timing_para(para);
|
||||
|
||||
/* Set dram master access priority */
|
||||
writel(0x000101a0, &mctl_com->bwcr);
|
||||
/* set cpu high priority */
|
||||
writel(0x1, &mctl_com->mapr);
|
||||
set_master_priority();
|
||||
udelay(250);
|
||||
|
||||
/* Disable dram VTC */
|
||||
clrbits_le32(&mctl_ctl->pgcr0, 0x3f << 0 | 0x1 << 30);
|
||||
clrsetbits_le32(&mctl_ctl->pgcr1, 0x1 << 24, 0x1 << 26);
|
||||
|
||||
writel(0x94be6fa3, MCTL_PROTECT);
|
||||
udelay(100);
|
||||
clrsetbits_le32(MX_UPD2, 0xfff << 16, 0x50 << 26);
|
||||
writel(0x0, MCTL_PROTECT);
|
||||
udelay(100);
|
||||
|
||||
|
||||
/* Set ODT */
|
||||
if (IS_ENABLED(CONFIG_DRAM_ODT_EN))
|
||||
rval = 0x0;
|
||||
else
|
||||
rval = 0x2;
|
||||
|
||||
for (i = 0 ; i < 11 ; i++) {
|
||||
clrsetbits_le32(DATX0IOCR(i), (0x3 << 24) | (0x3 << 16),
|
||||
rval << 24);
|
||||
clrsetbits_le32(DATX1IOCR(i), (0x3 << 24) | (0x3 << 16),
|
||||
rval << 24);
|
||||
clrsetbits_le32(DATX2IOCR(i), (0x3 << 24) | (0x3 << 16),
|
||||
rval << 24);
|
||||
clrsetbits_le32(DATX3IOCR(i), (0x3 << 24) | (0x3 << 16),
|
||||
rval << 24);
|
||||
}
|
||||
|
||||
for (i = 0; i < 31; i++)
|
||||
clrsetbits_le32(CAIOCR(i), 0x3 << 26 | 0x3 << 16, 0x2 << 26);
|
||||
|
||||
/* set PLL configuration */
|
||||
if (CONFIG_DRAM_CLK >= 480)
|
||||
setbits_le32(&mctl_ctl->pllgcr, 0x1 << 19);
|
||||
else
|
||||
setbits_le32(&mctl_ctl->pllgcr, 0x3 << 19);
|
||||
|
||||
/* Auto detect dram config, set 2 rank and 16bit bus-width */
|
||||
para->cs1 = 0;
|
||||
para->rank = 2;
|
||||
para->bus_width = 16;
|
||||
mctl_set_cr(para);
|
||||
|
||||
/* Open DQS gating */
|
||||
clrbits_le32(&mctl_ctl->pgcr2, (0x3 << 6));
|
||||
clrbits_le32(&mctl_ctl->dqsgmr, (0x1 << 8) | (0x7));
|
||||
|
||||
if (readl(&mctl_com->cr) & 0x1)
|
||||
writel(0x00000303, &mctl_ctl->odtmap);
|
||||
else
|
||||
writel(0x00000201, &mctl_ctl->odtmap);
|
||||
|
||||
mctl_data_train_cfg(para);
|
||||
/* ZQ calibration */
|
||||
clrsetbits_le32(ZQnPR(0), 0x000000ff, CONFIG_DRAM_ZQ & 0xff);
|
||||
clrsetbits_le32(ZQnPR(1), 0x000000ff, (CONFIG_DRAM_ZQ >> 8) & 0xff);
|
||||
/* CA calibration */
|
||||
mctl_set_pir(0x0201f3 | 0x1<<10);
|
||||
|
||||
/* DQS gate training */
|
||||
if (mctl_train_dram(para) != 0) {
|
||||
low_data_lines_status = (readl(DXnGSR0(0)) >> 24) & 0x03;
|
||||
high_data_lines_status = (readl(DXnGSR0(1)) >> 24) & 0x03;
|
||||
|
||||
if (low_data_lines_status == 0x3)
|
||||
return -EIO;
|
||||
|
||||
/* DRAM has only one rank */
|
||||
para->rank = 1;
|
||||
mctl_set_cr(para);
|
||||
|
||||
if (low_data_lines_status == high_data_lines_status)
|
||||
goto done; /* 16 bit bus, 1 rank */
|
||||
|
||||
if (!(low_data_lines_status & high_data_lines_status)) {
|
||||
/* Retry 16 bit bus-width with CS1 set */
|
||||
para->cs1 = 1;
|
||||
mctl_set_cr(para);
|
||||
if (mctl_train_dram(para) == 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Try 8 bit bus-width */
|
||||
writel(0x0, DXnGCR0(1)); /* Disable high DQ */
|
||||
para->cs1 = 0;
|
||||
para->bus_width = 8;
|
||||
mctl_set_cr(para);
|
||||
if (mctl_train_dram(para) != 0)
|
||||
return -EIO;
|
||||
}
|
||||
done:
|
||||
/* Check the dramc status */
|
||||
mctl_await_completion(&mctl_ctl->statr, 0x1, 0x1);
|
||||
|
||||
/* Close DQS gating */
|
||||
setbits_le32(&mctl_ctl->pgcr2, 0x3 << 6);
|
||||
|
||||
/* set PGCR3,CKE polarity */
|
||||
writel(0x00aa0060, &mctl_ctl->pgcr3);
|
||||
/* Enable master access */
|
||||
writel(0xffffffff, &mctl_com->maer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mctl_sys_init(struct dram_para *para)
|
||||
{
|
||||
struct sunxi_ccm_reg * const ccm =
|
||||
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
clrbits_le32(&ccm->mbus_clk_cfg, MBUS_CLK_GATE);
|
||||
clrbits_le32(&ccm->mbus_reset, CCM_MBUS_RESET_RESET);
|
||||
clrbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MCTL);
|
||||
clrbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_RESET_OFFSET_MCTL);
|
||||
clrbits_le32(&ccm->pll5_cfg, CCM_PLL5_CTRL_EN);
|
||||
clrbits_le32(&ccm->dram_clk_cfg, 0x01<<31);
|
||||
|
||||
clock_set_pll5(CONFIG_DRAM_CLK * 1000000 * DRAM_CLK_MUL);
|
||||
|
||||
clrsetbits_le32(&ccm->dram_clk_cfg, CCM_DRAMCLK_CFG_DIV_MASK,
|
||||
CCM_DRAMCLK_CFG_DIV(DRAM_CLK_DIV) |
|
||||
CCM_DRAMCLK_CFG_RST | CCM_DRAMCLK_CFG_UPD);
|
||||
mctl_await_completion(&ccm->dram_clk_cfg, CCM_DRAMCLK_CFG_UPD, 0);
|
||||
|
||||
setbits_le32(&ccm->ahb_reset0_cfg, 1 << 14);
|
||||
setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MCTL);
|
||||
setbits_le32(&ccm->mbus_reset, CCM_MBUS_RESET_RESET);
|
||||
setbits_le32(&ccm->mbus_clk_cfg, MBUS_CLK_GATE);
|
||||
|
||||
setbits_le32(&ccm->ahb_reset0_cfg, 1 << AHB_RESET_OFFSET_MCTL);
|
||||
setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_MCTL);
|
||||
setbits_le32(&ccm->mbus_reset, CCM_MBUS_RESET_RESET);
|
||||
setbits_le32(&ccm->mbus_clk_cfg, MBUS_CLK_GATE);
|
||||
|
||||
/* Set dram master access priority */
|
||||
writel(0x0000e00f, &mctl_ctl->clken); /* normal */
|
||||
|
||||
udelay(250);
|
||||
}
|
||||
|
||||
unsigned long sunxi_dram_init(void)
|
||||
{
|
||||
struct sunxi_mctl_com_reg * const mctl_com =
|
||||
(struct sunxi_mctl_com_reg *)SUNXI_DRAM_COM_BASE;
|
||||
struct sunxi_mctl_ctl_reg * const mctl_ctl =
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
struct dram_para para = {
|
||||
.cs1 = 0,
|
||||
.bank = 1,
|
||||
.rank = 1,
|
||||
.rows = 15,
|
||||
.bus_width = 16,
|
||||
.page_size = 2048,
|
||||
};
|
||||
|
||||
setbits_le32(SUNXI_PRCM_BASE + 0x1e0, 0x1 << 8);
|
||||
|
||||
writel(0, (SUNXI_PRCM_BASE + 0x1e8));
|
||||
udelay(10);
|
||||
|
||||
mctl_sys_init(¶);
|
||||
|
||||
if (mctl_channel_init(¶) != 0)
|
||||
return 0;
|
||||
|
||||
auto_detect_dram_size(¶);
|
||||
|
||||
/* Enable master software clk */
|
||||
writel(readl(&mctl_com->swonr) | 0x3ffff, &mctl_com->swonr);
|
||||
|
||||
/* Set DRAM ODT MAP */
|
||||
if (para.rank == 2)
|
||||
writel(0x00000303, &mctl_ctl->odtmap);
|
||||
else
|
||||
writel(0x00000201, &mctl_ctl->odtmap);
|
||||
|
||||
return para.page_size * (para.bus_width / 8) *
|
||||
(1 << (para.bank + para.rank + para.rows));
|
||||
}
|
||||
@@ -73,10 +73,10 @@ static void mctl_dq_delay(u32 read, u32 write)
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
val = DATX_IOCR_WRITE_DELAY((write >> (i * 4)) & 0xf) |
|
||||
DATX_IOCR_READ_DELAY((read >> (i * 4)) & 0xf);
|
||||
DATX_IOCR_READ_DELAY(((read >> (i * 4)) & 0xf) * 2);
|
||||
|
||||
for (j = DATX_IOCR_DQ(0); j <= DATX_IOCR_DM; j++)
|
||||
setbits_le32(&mctl_ctl->datx[i].iocr[j], val);
|
||||
writel(val, &mctl_ctl->datx[i].iocr[j]);
|
||||
}
|
||||
|
||||
clrbits_le32(&mctl_ctl->pgcr[0], 1 << 26);
|
||||
@@ -85,8 +85,8 @@ static void mctl_dq_delay(u32 read, u32 write)
|
||||
val = DATX_IOCR_WRITE_DELAY((write >> (16 + i * 4)) & 0xf) |
|
||||
DATX_IOCR_READ_DELAY((read >> (16 + i * 4)) & 0xf);
|
||||
|
||||
setbits_le32(&mctl_ctl->datx[i].iocr[DATX_IOCR_DQS], val);
|
||||
setbits_le32(&mctl_ctl->datx[i].iocr[DATX_IOCR_DQSN], val);
|
||||
writel(val, &mctl_ctl->datx[i].iocr[DATX_IOCR_DQS]);
|
||||
writel(val, &mctl_ctl->datx[i].iocr[DATX_IOCR_DQSN]);
|
||||
}
|
||||
|
||||
setbits_le32(&mctl_ctl->pgcr[0], 1 << 26);
|
||||
@@ -436,8 +436,8 @@ unsigned long sunxi_dram_init(void)
|
||||
(struct sunxi_mctl_ctl_reg *)SUNXI_DRAM_CTL0_BASE;
|
||||
|
||||
struct dram_para para = {
|
||||
.read_delays = 0x00007979,
|
||||
.write_delays = 0x6aaa0000,
|
||||
.read_delays = 0x00007979, /* dram_tpr12 */
|
||||
.write_delays = 0x6aaa0000, /* dram_tpr11 */
|
||||
.dual_rank = 0,
|
||||
.bus_width = 32,
|
||||
.row_bits = 15,
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#define AXP221_CTRL_ADDR 0x3e
|
||||
#define AXP221_INIT_DATA 0x3e
|
||||
|
||||
/* AXP818 device and runtime addresses are same as AXP223 */
|
||||
#define AXP223_DEVICE_ADDR 0x3a3
|
||||
#define AXP223_RUNTIME_ADDR 0x2d
|
||||
|
||||
@@ -35,7 +36,7 @@ int pmic_bus_init(void)
|
||||
if (!needs_init)
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_AXP221_POWER
|
||||
#if defined CONFIG_AXP221_POWER || defined CONFIG_AXP818_POWER
|
||||
# ifdef CONFIG_MACH_SUN6I
|
||||
p2wi_init();
|
||||
ret = p2wi_change_to_p2wi_mode(AXP221_CHIP_ADDR, AXP221_CTRL_ADDR,
|
||||
@@ -61,7 +62,7 @@ int pmic_bus_read(u8 reg, u8 *data)
|
||||
return i2c_read(AXP152_I2C_ADDR, reg, 1, data, 1);
|
||||
#elif defined CONFIG_AXP209_POWER
|
||||
return i2c_read(AXP209_I2C_ADDR, reg, 1, data, 1);
|
||||
#elif defined CONFIG_AXP221_POWER
|
||||
#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP818_POWER
|
||||
# ifdef CONFIG_MACH_SUN6I
|
||||
return p2wi_read(reg, data);
|
||||
# else
|
||||
@@ -76,7 +77,7 @@ int pmic_bus_write(u8 reg, u8 data)
|
||||
return i2c_write(AXP152_I2C_ADDR, reg, 1, &data, 1);
|
||||
#elif defined CONFIG_AXP209_POWER
|
||||
return i2c_write(AXP209_I2C_ADDR, reg, 1, &data, 1);
|
||||
#elif defined CONFIG_AXP221_POWER
|
||||
#elif defined CONFIG_AXP221_POWER || defined CONFIG_AXP818_POWER
|
||||
# ifdef CONFIG_MACH_SUN6I
|
||||
return p2wi_write(reg, data);
|
||||
# else
|
||||
|
||||
@@ -206,11 +206,65 @@ static inline void early_mmu_setup(void)
|
||||
set_sctlr(get_sctlr() | CR_M);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
/*
|
||||
* Called from final mmu setup. The phys_addr is new, non-existing
|
||||
* address. A new sub table is created @level2_table_secure to cover
|
||||
* size of CONFIG_SYS_MEM_RESERVE_SECURE memory.
|
||||
*/
|
||||
static inline int final_secure_ddr(u64 *level0_table,
|
||||
u64 *level2_table_secure,
|
||||
phys_addr_t phys_addr)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
struct table_info table = {};
|
||||
struct sys_mmu_table ddr_entry = {
|
||||
0, 0, BLOCK_SIZE_L1, MT_NORMAL,
|
||||
PMD_SECT_OUTER_SHARE | PMD_SECT_NS
|
||||
};
|
||||
u64 index;
|
||||
|
||||
/* Need to create a new table */
|
||||
ddr_entry.virt_addr = phys_addr & ~(BLOCK_SIZE_L1 - 1);
|
||||
ddr_entry.phys_addr = phys_addr & ~(BLOCK_SIZE_L1 - 1);
|
||||
ret = find_table(&ddr_entry, &table, level0_table);
|
||||
if (ret)
|
||||
return ret;
|
||||
index = (ddr_entry.virt_addr - table.table_base) >> SECTION_SHIFT_L1;
|
||||
set_pgtable_table(table.ptr, index, level2_table_secure);
|
||||
table.ptr = level2_table_secure;
|
||||
table.table_base = ddr_entry.virt_addr;
|
||||
table.entry_size = BLOCK_SIZE_L2;
|
||||
ret = set_block_entry(&ddr_entry, &table);
|
||||
if (ret) {
|
||||
printf("MMU error: could not fill non-secure ddr block entries\n");
|
||||
return ret;
|
||||
}
|
||||
ddr_entry.virt_addr = phys_addr;
|
||||
ddr_entry.phys_addr = phys_addr;
|
||||
ddr_entry.size = CONFIG_SYS_MEM_RESERVE_SECURE;
|
||||
ddr_entry.attribute = PMD_SECT_OUTER_SHARE;
|
||||
ret = find_table(&ddr_entry, &table, level0_table);
|
||||
if (ret) {
|
||||
printf("MMU error: could not find secure ddr table\n");
|
||||
return ret;
|
||||
}
|
||||
ret = set_block_entry(&ddr_entry, &table);
|
||||
if (ret)
|
||||
printf("MMU error: could not set secure ddr block entry\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The final tables look similar to early tables, but different in detail.
|
||||
* These tables are in DRAM. Sub tables are added to enable cache for
|
||||
* QBMan and OCRAM.
|
||||
*
|
||||
* Put the MMU table in secure memory if gd->secure_ram is valid.
|
||||
* OCRAM will be not used for this purpose so gd->secure_ram can't be 0.
|
||||
*
|
||||
* Level 1 table 0 contains 512 entries for each 1GB from 0 to 512GB.
|
||||
* Level 1 table 1 contains 512 entries for each 1GB from 512GB to 1TB.
|
||||
* Level 2 table 0 contains 512 entries for each 2MB from 0 to 1GB.
|
||||
@@ -223,18 +277,40 @@ static inline void early_mmu_setup(void)
|
||||
*/
|
||||
static inline void final_mmu_setup(void)
|
||||
{
|
||||
unsigned int el, i;
|
||||
unsigned int el = current_el();
|
||||
unsigned int i;
|
||||
u64 *level0_table = (u64 *)gd->arch.tlb_addr;
|
||||
u64 *level1_table0 = (u64 *)(gd->arch.tlb_addr + 0x1000);
|
||||
u64 *level1_table1 = (u64 *)(gd->arch.tlb_addr + 0x2000);
|
||||
u64 *level2_table0 = (u64 *)(gd->arch.tlb_addr + 0x3000);
|
||||
#ifdef CONFIG_FSL_LSCH3
|
||||
u64 *level2_table1 = (u64 *)(gd->arch.tlb_addr + 0x4000);
|
||||
#elif defined(CONFIG_FSL_LSCH2)
|
||||
u64 *level2_table1 = (u64 *)(gd->arch.tlb_addr + 0x4000);
|
||||
u64 *level2_table2 = (u64 *)(gd->arch.tlb_addr + 0x5000);
|
||||
u64 *level1_table0;
|
||||
u64 *level1_table1;
|
||||
u64 *level2_table0;
|
||||
u64 *level2_table1;
|
||||
#ifdef CONFIG_FSL_LSCH2
|
||||
u64 *level2_table2;
|
||||
#endif
|
||||
struct table_info table = {level0_table, 0, BLOCK_SIZE_L0};
|
||||
struct table_info table = {NULL, 0, BLOCK_SIZE_L0};
|
||||
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
u64 *level2_table_secure;
|
||||
|
||||
if (el == 3) {
|
||||
/*
|
||||
* Only use gd->secure_ram if the address is recalculated
|
||||
* Align to 4KB for MMU table
|
||||
*/
|
||||
if (gd->secure_ram & MEM_RESERVE_SECURE_MAINTAINED)
|
||||
level0_table = (u64 *)(gd->secure_ram & ~0xfff);
|
||||
else
|
||||
printf("MMU warning: gd->secure_ram is not maintained, disabled.\n");
|
||||
}
|
||||
#endif
|
||||
level1_table0 = level0_table + 512;
|
||||
level1_table1 = level1_table0 + 512;
|
||||
level2_table0 = level1_table1 + 512;
|
||||
level2_table1 = level2_table0 + 512;
|
||||
#ifdef CONFIG_FSL_LSCH2
|
||||
level2_table2 = level2_table1 + 512;
|
||||
#endif
|
||||
table.ptr = level0_table;
|
||||
|
||||
/* Invalidate all table entries */
|
||||
memset(level0_table, 0, PGTABLE_SIZE);
|
||||
@@ -269,17 +345,34 @@ static inline void final_mmu_setup(void)
|
||||
&final_mmu_table[i]);
|
||||
}
|
||||
}
|
||||
/* Set the secure memory to secure in MMU */
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
if (el == 3 && gd->secure_ram & MEM_RESERVE_SECURE_MAINTAINED) {
|
||||
#ifdef CONFIG_FSL_LSCH3
|
||||
level2_table_secure = level2_table1 + 512;
|
||||
#elif defined(CONFIG_FSL_LSCH2)
|
||||
level2_table_secure = level2_table2 + 512;
|
||||
#endif
|
||||
if (!final_secure_ddr(level0_table,
|
||||
level2_table_secure,
|
||||
gd->secure_ram & ~0x3)) {
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_SECURED;
|
||||
debug("Now MMU table is in secured memory at 0x%llx\n",
|
||||
gd->secure_ram & ~0x3);
|
||||
} else {
|
||||
printf("MMU warning: Failed to secure DDR\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* flush new MMU table */
|
||||
flush_dcache_range(gd->arch.tlb_addr,
|
||||
gd->arch.tlb_addr + gd->arch.tlb_size);
|
||||
flush_dcache_range((ulong)level0_table,
|
||||
(ulong)level0_table + gd->arch.tlb_size);
|
||||
|
||||
#ifdef CONFIG_SYS_DPAA_FMAN
|
||||
flush_dcache_all();
|
||||
#endif
|
||||
/* point TTBR to the new table */
|
||||
el = current_el();
|
||||
|
||||
set_ttbr_tcr_mair(el, (u64)level0_table, LAYERSCAPE_TCR_FINAL,
|
||||
MEMORY_ATTRIBUTES);
|
||||
/*
|
||||
@@ -543,3 +636,24 @@ void reset_cpu(ulong addr)
|
||||
val |= 0x02;
|
||||
scfg_out32(rstcr, val);
|
||||
}
|
||||
|
||||
phys_size_t board_reserve_ram_top(phys_size_t ram_size)
|
||||
{
|
||||
phys_size_t ram_top = ram_size;
|
||||
|
||||
#ifdef CONFIG_SYS_MEM_TOP_HIDE
|
||||
#error CONFIG_SYS_MEM_TOP_HIDE not to be used together with this function
|
||||
#endif
|
||||
/* Carve the Debug Server private DRAM block from the end of DRAM */
|
||||
#ifdef CONFIG_FSL_DEBUG_SERVER
|
||||
ram_top -= debug_server_get_dram_block_size();
|
||||
#endif
|
||||
|
||||
/* Carve the MC private DRAM block from the end of DRAM */
|
||||
#ifdef CONFIG_FSL_MC_ENET
|
||||
ram_top -= mc_get_dram_block_size();
|
||||
ram_top &= ~(CONFIG_SYS_MC_RSV_MEM_ALIGN - 1);
|
||||
#endif
|
||||
|
||||
return ram_top;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
|
||||
u32 cfg;
|
||||
int lane;
|
||||
|
||||
memset(serdes_prtcl_map, 0, sizeof(serdes_prtcl_map));
|
||||
memset(serdes_prtcl_map, 0, sizeof(u8) * SERDES_PRCTL_COUNT);
|
||||
|
||||
cfg = gur_in32(&gur->rcwsr[4]) & sd_prctl_mask;
|
||||
cfg >>= sd_prctl_shift;
|
||||
|
||||
@@ -79,7 +79,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
|
||||
u32 cfg;
|
||||
int lane;
|
||||
|
||||
memset(serdes_prtcl_map, 0, sizeof(serdes_prtcl_map));
|
||||
memset(serdes_prtcl_map, 0, sizeof(u8) * SERDES_PRCTL_COUNT);
|
||||
|
||||
cfg = gur_in32(&gur->rcwsr[28]) & sd_prctl_mask;
|
||||
cfg >>= sd_prctl_shift;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <fsl_ifc.h>
|
||||
#include <ahci.h>
|
||||
#include <scsi.h>
|
||||
#include <asm/arch/soc.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/global_data.h>
|
||||
@@ -14,6 +16,41 @@
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_LS2080A) || defined(CONFIG_LS2085A)
|
||||
/*
|
||||
* This erratum requires setting a value to eddrtqcr1 to
|
||||
* optimal the DDR performance.
|
||||
*/
|
||||
static void erratum_a008336(void)
|
||||
{
|
||||
u32 *eddrtqcr1;
|
||||
|
||||
#ifdef CONFIG_SYS_FSL_ERRATUM_A008336
|
||||
#ifdef CONFIG_SYS_FSL_DCSR_DDR_ADDR
|
||||
eddrtqcr1 = (void *)CONFIG_SYS_FSL_DCSR_DDR_ADDR + 0x800;
|
||||
out_le32(eddrtqcr1, 0x63b30002);
|
||||
#endif
|
||||
#ifdef CONFIG_SYS_FSL_DCSR_DDR2_ADDR
|
||||
eddrtqcr1 = (void *)CONFIG_SYS_FSL_DCSR_DDR2_ADDR + 0x800;
|
||||
out_le32(eddrtqcr1, 0x63b30002);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* This erratum requires a register write before being Memory
|
||||
* controller 3 being enabled.
|
||||
*/
|
||||
static void erratum_a008514(void)
|
||||
{
|
||||
u32 *eddrtqcr1;
|
||||
|
||||
#ifdef CONFIG_SYS_FSL_ERRATUM_A008514
|
||||
#ifdef CONFIG_SYS_FSL_DCSR_DDR3_ADDR
|
||||
eddrtqcr1 = (void *)CONFIG_SYS_FSL_DCSR_DDR3_ADDR + 0x800;
|
||||
out_le32(eddrtqcr1, 0x63b20002);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_SYS_FSL_ERRATUM_A009635
|
||||
#define PLATFORM_CYCLE_ENV_VAR "a009635_interval_val"
|
||||
|
||||
@@ -118,29 +155,93 @@ void fsl_lsch3_early_init_f(void)
|
||||
erratum_rcw_src();
|
||||
init_early_memctl_regs(); /* tighten IFC timing */
|
||||
erratum_a009203();
|
||||
erratum_a008514();
|
||||
erratum_a008336();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SCSI_AHCI_PLAT
|
||||
int sata_init(void)
|
||||
{
|
||||
struct ccsr_ahci __iomem *ccsr_ahci;
|
||||
|
||||
ccsr_ahci = (void *)CONFIG_SYS_SATA2;
|
||||
out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG);
|
||||
out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
|
||||
|
||||
ccsr_ahci = (void *)CONFIG_SYS_SATA1;
|
||||
out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG);
|
||||
out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
|
||||
|
||||
ahci_init((void __iomem *)CONFIG_SYS_SATA1);
|
||||
scsi_scan(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_LS1043A)
|
||||
#ifdef CONFIG_SCSI_AHCI_PLAT
|
||||
int sata_init(void)
|
||||
{
|
||||
struct ccsr_ahci __iomem *ccsr_ahci = (void *)CONFIG_SYS_SATA;
|
||||
|
||||
out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG);
|
||||
out_le32(&ccsr_ahci->pp2c, AHCI_PORT_PHY_2_CFG);
|
||||
out_le32(&ccsr_ahci->pp3c, AHCI_PORT_PHY_3_CFG);
|
||||
out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
|
||||
|
||||
ahci_init((void __iomem *)CONFIG_SYS_SATA);
|
||||
scsi_scan(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void erratum_a009929(void)
|
||||
{
|
||||
#ifdef CONFIG_SYS_FSL_ERRATUM_A009929
|
||||
struct ccsr_gur *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
|
||||
u32 __iomem *dcsr_cop_ccp = (void *)CONFIG_SYS_DCSR_COP_CCP_ADDR;
|
||||
u32 rstrqmr1 = gur_in32(&gur->rstrqmr1);
|
||||
|
||||
rstrqmr1 |= 0x00000400;
|
||||
gur_out32(&gur->rstrqmr1, rstrqmr1);
|
||||
writel(0x01000000, dcsr_cop_ccp);
|
||||
#endif
|
||||
}
|
||||
|
||||
void fsl_lsch2_early_init_f(void)
|
||||
{
|
||||
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
|
||||
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
|
||||
|
||||
#ifdef CONFIG_FSL_IFC
|
||||
init_early_memctl_regs(); /* tighten IFC timing */
|
||||
#endif
|
||||
|
||||
/* Make SEC reads and writes snoopable */
|
||||
setbits_be32(&scfg->snpcnfgcr, SCFG_SNPCNFGCR_SECRDSNP |
|
||||
SCFG_SNPCNFGCR_SECWRSNP);
|
||||
|
||||
/*
|
||||
* Enable snoop requests and DVM message requests for
|
||||
* Slave insterface S4 (A53 core cluster)
|
||||
*/
|
||||
out_le32(&cci->slave[4].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
|
||||
/* Erratum */
|
||||
erratum_a009929();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INIT
|
||||
int board_late_init(void)
|
||||
{
|
||||
#ifdef CONFIG_SCSI_AHCI_PLAT
|
||||
sata_init();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -40,3 +40,14 @@ unsigned long timer_read_counter(void)
|
||||
#endif
|
||||
return cntpct;
|
||||
}
|
||||
|
||||
unsigned long usec2ticks(unsigned long usec)
|
||||
{
|
||||
ulong ticks;
|
||||
if (usec < 1000)
|
||||
ticks = ((usec * (get_tbclk()/1000)) + 500) / 1000;
|
||||
else
|
||||
ticks = ((usec / 10) * (get_tbclk() / 100000));
|
||||
|
||||
return ticks;
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ dtb-$(CONFIG_MACH_SUN5I) += \
|
||||
sun5i-a10s-r7-tv-dongle.dtb \
|
||||
sun5i-a10s-wobo-i5.dtb \
|
||||
sun5i-a13-ampe-a76.dtb \
|
||||
sun5i-a13-empire-electronix-d709.dtb \
|
||||
sun5i-a13-hsg-h702.dtb \
|
||||
sun5i-a13-inet-86vs.dtb \
|
||||
sun5i-a13-inet-98v-rev2.dtb \
|
||||
@@ -176,6 +177,8 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
|
||||
sun8i-a33-ga10h-v1.1.dtb \
|
||||
sun8i-a33-q8-tablet.dtb \
|
||||
sun8i-a33-sinlinx-sina33.dtb
|
||||
dtb-$(CONFIG_MACH_SUN8I_A83T) += \
|
||||
sun8i-a83t-allwinner-h8homlet-v2.dtb
|
||||
dtb-$(CONFIG_MACH_SUN8I_H3) += \
|
||||
sun8i-h3-orangepi-pc.dtb \
|
||||
sun8i-h3-orangepi-plus.dtb
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* to be added to the gmac1 device tree blob.
|
||||
*/
|
||||
ethernet0 = &gmac1;
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
regulator_3_3v: 3-3-v-regulator {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
aliases {
|
||||
ethernet0 = &gmac1;
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
memory {
|
||||
@@ -59,3 +60,7 @@
|
||||
status = "okay";
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
aliases {
|
||||
ethernet0 = &gmac0;
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
memory {
|
||||
@@ -51,3 +52,7 @@
|
||||
bus-width = <8>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* to be added to the gmac1 device tree blob.
|
||||
*/
|
||||
ethernet0 = &gmac1;
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
regulator_3_3v: 3-3-v-regulator {
|
||||
@@ -77,10 +78,6 @@
|
||||
vqmmc-supply = <®ulator_3_3v>;
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qspi {
|
||||
status = "okay";
|
||||
|
||||
@@ -100,3 +97,7 @@
|
||||
tslch-ns = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
aliases {
|
||||
aliases {
|
||||
ethernet0 = &gmac1;
|
||||
};
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
memory {
|
||||
name = "memory";
|
||||
@@ -90,3 +91,7 @@
|
||||
tslch-ns = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
bootargs = "console=ttyS0,115200";
|
||||
};
|
||||
|
||||
aliases {
|
||||
udc0 = &usb1;
|
||||
};
|
||||
|
||||
memory {
|
||||
name = "memory";
|
||||
device_type = "memory";
|
||||
@@ -28,6 +32,15 @@
|
||||
&gmac1 {
|
||||
status = "okay";
|
||||
phy-mode = "rgmii";
|
||||
|
||||
rxd0-skew-ps = <0>;
|
||||
rxd1-skew-ps = <0>;
|
||||
rxd2-skew-ps = <0>;
|
||||
rxd3-skew-ps = <0>;
|
||||
txen-skew-ps = <0>;
|
||||
txc-skew-ps = <2600>;
|
||||
rxdv-skew-ps = <0>;
|
||||
rxc-skew-ps = <2000>;
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
@@ -63,3 +76,7 @@
|
||||
tslch-ns = <4>;
|
||||
};
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
241
arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
Normal file
241
arch/arm/dts/sun5i-a13-empire-electronix-d709.dts
Normal file
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* Copyright 2015 Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* This file is dual-licensed: you can use it either under the terms
|
||||
* of the GPL or the X11 license, at your option. Note that this dual
|
||||
* licensing only applies to this file, and not this project as a
|
||||
* whole.
|
||||
*
|
||||
* a) This file is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* Or, alternatively,
|
||||
*
|
||||
* b) Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "sun5i-a13.dtsi"
|
||||
#include "sunxi-common-regulators.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
model = "Empire Electronix D709 tablet";
|
||||
compatible = "empire-electronix,d709", "allwinner,sun5i-a13";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart1;
|
||||
};
|
||||
|
||||
backlight: backlight {
|
||||
compatible = "pwm-backlight";
|
||||
pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
|
||||
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
|
||||
default-brightness-level = <8>;
|
||||
/* TODO: backlight uses axp gpio1 as enable pin */
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
cpu-supply = <®_dcdc2>;
|
||||
};
|
||||
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins_a>;
|
||||
status = "okay";
|
||||
|
||||
axp209: pmic@34 {
|
||||
reg = <0x34>;
|
||||
interrupts = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
#include "axp209.dtsi"
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c1_pins_a>;
|
||||
status = "okay";
|
||||
|
||||
pcf8563: rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
};
|
||||
|
||||
&lradc {
|
||||
vref-supply = <®_ldo2>;
|
||||
status = "okay";
|
||||
|
||||
button@200 {
|
||||
label = "Volume Up";
|
||||
linux,code = <KEY_VOLUMEUP>;
|
||||
channel = <0>;
|
||||
voltage = <200000>;
|
||||
};
|
||||
|
||||
button@400 {
|
||||
label = "Volume Down";
|
||||
linux,code = <KEY_VOLUMEDOWN>;
|
||||
channel = <0>;
|
||||
voltage = <400000>;
|
||||
};
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>;
|
||||
vmmc-supply = <®_vcc3v3>;
|
||||
bus-width = <4>;
|
||||
cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
|
||||
cd-inverted;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mmc2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc2_pins_a>;
|
||||
vmmc-supply = <®_vcc3v3>;
|
||||
bus-width = <8>;
|
||||
non-removable;
|
||||
status = "okay";
|
||||
|
||||
mmccard: mmccard@0 {
|
||||
reg = <0>;
|
||||
compatible = "mmc-card";
|
||||
broken-hpi;
|
||||
};
|
||||
};
|
||||
|
||||
&otg_sram {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pio {
|
||||
mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 {
|
||||
allwinner,pins = "PG0";
|
||||
allwinner,function = "gpio_in";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
|
||||
};
|
||||
|
||||
usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
|
||||
allwinner,pins = "PG1";
|
||||
allwinner,function = "gpio_in";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
|
||||
};
|
||||
|
||||
usb0_id_detect_pin: usb0_id_detect_pin@0 {
|
||||
allwinner,pins = "PG2";
|
||||
allwinner,function = "gpio_in";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
|
||||
};
|
||||
};
|
||||
|
||||
&pwm {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pwm0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
®_dcdc2 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1400000>;
|
||||
regulator-name = "vdd-cpu";
|
||||
};
|
||||
|
||||
®_dcdc3 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1250000>;
|
||||
regulator-max-microvolt = <1250000>;
|
||||
regulator-name = "vdd-int-pll";
|
||||
};
|
||||
|
||||
®_ldo1 {
|
||||
regulator-name = "vdd-rtc";
|
||||
};
|
||||
|
||||
®_ldo2 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-name = "avcc";
|
||||
};
|
||||
|
||||
®_ldo3 {
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-name = "vcc-wifi";
|
||||
};
|
||||
|
||||
®_usb0_vbus {
|
||||
gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart1_pins_b>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_otg {
|
||||
dr_mode = "otg";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb0_vbus_pin_a {
|
||||
allwinner,pins = "PG12";
|
||||
};
|
||||
|
||||
&usbphy {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
|
||||
usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
|
||||
usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
|
||||
usb0_vbus-supply = <®_usb0_vbus>;
|
||||
usb1_vbus-supply = <®_ldo3>;
|
||||
status = "okay";
|
||||
};
|
||||
64
arch/arm/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
Normal file
64
arch/arm/dts/sun8i-a83t-allwinner-h8homlet-v2.dts
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2015 Vishnu Patekar
|
||||
* Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
*
|
||||
* This file is dual-licensed: you can use it either under the terms
|
||||
* of the GPL or the X11 license, at your option. Note that this dual
|
||||
* licensing only applies to this file, and not this project as a
|
||||
* whole.
|
||||
*
|
||||
* a) This file is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* Or, alternatively,
|
||||
*
|
||||
* b) Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include "sun8i-a83t.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Allwinner A83T H8Homlet Proto Dev Board v2.0";
|
||||
compatible = "allwinner,h8homlet-v2", "allwinner,sun8i-a83t";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins_b>;
|
||||
status = "okay";
|
||||
};
|
||||
247
arch/arm/dts/sun8i-a83t.dtsi
Normal file
247
arch/arm/dts/sun8i-a83t.dtsi
Normal file
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Copyright 2015 Vishnu Patekar
|
||||
*
|
||||
* Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
*
|
||||
* This file is dual-licensed: you can use it either under the terms
|
||||
* of the GPL or the X11 license, at your option. Note that this dual
|
||||
* licensing only applies to this file, and not this project as a
|
||||
* whole.
|
||||
*
|
||||
* a) This file is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This file is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* Or, alternatively,
|
||||
*
|
||||
* b) Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
|
||||
/ {
|
||||
interrupt-parent = <&gic>;
|
||||
|
||||
chosen {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <0>;
|
||||
};
|
||||
|
||||
cpu@1 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <1>;
|
||||
};
|
||||
|
||||
cpu@2 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <2>;
|
||||
};
|
||||
|
||||
cpu@3 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <3>;
|
||||
};
|
||||
cpu@100 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <0x100>;
|
||||
};
|
||||
|
||||
cpu@101 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <0x101>;
|
||||
};
|
||||
cpu@102 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <0x102>;
|
||||
};
|
||||
|
||||
cpu@103 {
|
||||
compatible = "arm,cortex-a7";
|
||||
device_type = "cpu";
|
||||
reg = <0x103>;
|
||||
};
|
||||
};
|
||||
|
||||
memory {
|
||||
reg = <0x40000000 0x80000000>;
|
||||
};
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv7-timer";
|
||||
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
<GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
<GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
<GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
|
||||
clock-frequency = <24000000>;
|
||||
arm,cpu-registers-not-fw-configured;
|
||||
};
|
||||
|
||||
clocks {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
osc24M: osc24M_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <24000000>;
|
||||
clock-output-names = "osc24M";
|
||||
};
|
||||
|
||||
osc32k: osc32k_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <32768>;
|
||||
clock-output-names = "osc32k";
|
||||
};
|
||||
};
|
||||
|
||||
soc@01c00000 {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
gic: interrupt-controller@01c81000 {
|
||||
compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
|
||||
reg = <0x01c81000 0x1000>,
|
||||
<0x01c82000 0x1000>,
|
||||
<0x01c84000 0x2000>,
|
||||
<0x01c86000 0x2000>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <3>;
|
||||
interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
|
||||
};
|
||||
|
||||
pio: pinctrl@01c20800 {
|
||||
compatible = "allwinner,sun8i-a83t-pinctrl";
|
||||
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg = <0x01c20800 0x400>;
|
||||
clocks = <&osc24M>;
|
||||
gpio-controller;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <3>;
|
||||
#gpio-cells = <3>;
|
||||
|
||||
i2c0_pins_a: i2c0@0 {
|
||||
allwinner,pins = "PH0", "PH1";
|
||||
allwinner,function = "i2c0";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
i2c1_pins_a: i2c1@0 {
|
||||
allwinner,pins = "PH2", "PH3";
|
||||
allwinner,function = "i2c1";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
i2c2_pins_a: i2c2@0 {
|
||||
allwinner,pins = "PH4", "PH5";
|
||||
allwinner,function = "i2c2";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
mmc0_pins_a: mmc0@0 {
|
||||
allwinner,pins = "PF0", "PF1", "PF2",
|
||||
"PF3", "PF4", "PF5";
|
||||
allwinner,function = "mmc0";
|
||||
allwinner,drive = <SUN4I_PINCTRL_30_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
mmc1_pins_a: mmc1@0 {
|
||||
allwinner,pins = "PG0", "PG1", "PG2",
|
||||
"PG3", "PG4", "PG5";
|
||||
allwinner,function = "mmc1";
|
||||
allwinner,drive = <SUN4I_PINCTRL_30_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
mmc2_8bit_pins: mmc2_8bit {
|
||||
allwinner,pins = "PC5", "PC6", "PC8",
|
||||
"PC9", "PC10", "PC11",
|
||||
"PC12", "PC13", "PC14",
|
||||
"PC15";
|
||||
allwinner,function = "mmc2";
|
||||
allwinner,drive = <SUN4I_PINCTRL_30_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
uart0_pins_a: uart0@0 {
|
||||
allwinner,pins = "PF2", "PF4";
|
||||
allwinner,function = "uart0";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
|
||||
uart0_pins_b: uart0@1 {
|
||||
allwinner,pins = "PB9", "PB10";
|
||||
allwinner,function = "uart0";
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@01c28000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0x01c28000 0x400>;
|
||||
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
clocks = <&osc24M>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -18,6 +18,7 @@
|
||||
i2c0 = &i2c0;
|
||||
serial0 = &uart1;
|
||||
spi0 = &qspi;
|
||||
mmc0 = &sdhci0;
|
||||
};
|
||||
|
||||
memory {
|
||||
@@ -291,6 +292,7 @@
|
||||
};
|
||||
|
||||
&sdhci0 {
|
||||
u-boot,dm-pre-reloc;
|
||||
status = "okay";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_sdhci0_default>;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
ethernet0 = &gem0;
|
||||
serial0 = &uart1;
|
||||
spi0 = &qspi;
|
||||
mmc0 = &sdhci0;
|
||||
};
|
||||
|
||||
memory {
|
||||
@@ -50,6 +51,7 @@
|
||||
};
|
||||
|
||||
&sdhci0 {
|
||||
u-boot,dm-pre-reloc;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
aliases {
|
||||
ethernet0 = &gem0;
|
||||
serial0 = &uart1;
|
||||
spi0 = &qspi;
|
||||
mmc0 = &sdhci0;
|
||||
};
|
||||
|
||||
memory {
|
||||
@@ -28,6 +30,10 @@
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
usb_phy0: phy0 {
|
||||
compatible = "usb-nop-xceiv";
|
||||
#phy-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
&clkc {
|
||||
@@ -45,6 +51,7 @@
|
||||
};
|
||||
|
||||
&sdhci0 {
|
||||
u-boot,dm-pre-reloc;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -52,3 +59,14 @@
|
||||
u-boot,dm-pre-reloc;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&qspi {
|
||||
u-boot,dm-pre-reloc;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
status = "okay";
|
||||
dr_mode = "host";
|
||||
usb-phy = <&usb_phy0>;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
#define CONFIG_SYS_FSL_DDR /* Freescale DDR driver */
|
||||
#define CONFIG_SYS_FSL_DDR_VER FSL_DDR_VER_5_0
|
||||
|
||||
/*
|
||||
* Reserve secure memory
|
||||
* To be aligned with MMU block size
|
||||
*/
|
||||
#define CONFIG_SYS_MEM_RESERVE_SECURE (2048 * 1024) /* 2MB */
|
||||
|
||||
#if defined(CONFIG_LS2080A) || defined(CONFIG_LS2085A)
|
||||
#define CONFIG_MAX_CPUS 16
|
||||
#define CONFIG_SYS_FSL_IFC_BANK_COUNT 8
|
||||
@@ -126,8 +132,8 @@
|
||||
#define CONFIG_SYS_FSL_OCRAM_BASE 0x10000000 /* initial RAM */
|
||||
#define CONFIG_SYS_FSL_OCRAM_SIZE 0x200000 /* 2 MiB */
|
||||
#define CONFIG_SYS_FSL_DDR_BE
|
||||
#define CONFIG_SYS_LS1_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
|
||||
#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_LS1_DDR_BLOCK1_SIZE
|
||||
#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
|
||||
#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
|
||||
|
||||
#define CONFIG_SYS_FSL_CCSR_GUR_BE
|
||||
#define CONFIG_SYS_FSL_CCSR_SCFG_BE
|
||||
@@ -147,8 +153,8 @@
|
||||
#define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4"
|
||||
|
||||
#define CONFIG_SYS_FSL_SFP_VER_3_2
|
||||
#define CONFIG_SYS_FSL_SNVS_LE
|
||||
#define CONFIG_SYS_FSL_SEC_LE
|
||||
#define CONFIG_SYS_FSL_SEC_MON_BE
|
||||
#define CONFIG_SYS_FSL_SEC_BE
|
||||
#define CONFIG_SYS_FSL_SFP_BE
|
||||
#define CONFIG_SYS_FSL_SRK_LE
|
||||
#define CONFIG_KEY_REVOCATION
|
||||
@@ -160,6 +166,7 @@
|
||||
#define GICD_BASE 0x01401000
|
||||
#define GICC_BASE 0x01402000
|
||||
|
||||
#define CONFIG_SYS_FSL_ERRATUM_A009929
|
||||
#else
|
||||
#error SoC not defined
|
||||
#endif
|
||||
|
||||
@@ -129,7 +129,8 @@ static const struct sys_mmu_table early_mmu_table[] = {
|
||||
{ CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FSL_IFC_BASE1,
|
||||
CONFIG_SYS_FSL_IFC_SIZE1, MT_DEVICE_NGNRNE, PMD_SECT_NON_SHARE },
|
||||
{ CONFIG_SYS_FSL_DRAM_BASE1, CONFIG_SYS_FSL_DRAM_BASE1,
|
||||
CONFIG_SYS_FSL_DRAM_SIZE1, MT_NORMAL, PMD_SECT_OUTER_SHARE },
|
||||
CONFIG_SYS_FSL_DRAM_SIZE1, MT_NORMAL,
|
||||
PMD_SECT_OUTER_SHARE | PMD_SECT_NS },
|
||||
/* Map IFC region #2 up to CONFIG_SYS_FLASH_BASE for NAND boot */
|
||||
{ CONFIG_SYS_FSL_IFC_BASE2, CONFIG_SYS_FSL_IFC_BASE2,
|
||||
CONFIG_SYS_FLASH_BASE - CONFIG_SYS_FSL_IFC_BASE2,
|
||||
@@ -138,7 +139,8 @@ static const struct sys_mmu_table early_mmu_table[] = {
|
||||
CONFIG_SYS_FSL_DCSR_SIZE, MT_DEVICE_NGNRNE,
|
||||
PMD_SECT_NON_SHARE | PMD_SECT_PXN | PMD_SECT_UXN },
|
||||
{ CONFIG_SYS_FSL_DRAM_BASE2, CONFIG_SYS_FSL_DRAM_BASE2,
|
||||
CONFIG_SYS_FSL_DRAM_SIZE2, MT_NORMAL, PMD_SECT_OUTER_SHARE },
|
||||
CONFIG_SYS_FSL_DRAM_SIZE2, MT_NORMAL,
|
||||
PMD_SECT_OUTER_SHARE | PMD_SECT_NS },
|
||||
#elif defined(CONFIG_FSL_LSCH2)
|
||||
{ CONFIG_SYS_FSL_CCSR_BASE, CONFIG_SYS_FSL_CCSR_BASE,
|
||||
CONFIG_SYS_FSL_CCSR_SIZE, MT_DEVICE_NGNRNE,
|
||||
@@ -165,7 +167,8 @@ static const struct sys_mmu_table final_mmu_table[] = {
|
||||
{ CONFIG_SYS_FSL_OCRAM_BASE, CONFIG_SYS_FSL_OCRAM_BASE,
|
||||
CONFIG_SYS_FSL_OCRAM_SIZE, MT_NORMAL, PMD_SECT_NON_SHARE },
|
||||
{ CONFIG_SYS_FSL_DRAM_BASE1, CONFIG_SYS_FSL_DRAM_BASE1,
|
||||
CONFIG_SYS_FSL_DRAM_SIZE1, MT_NORMAL, PMD_SECT_OUTER_SHARE },
|
||||
CONFIG_SYS_FSL_DRAM_SIZE1, MT_NORMAL,
|
||||
PMD_SECT_OUTER_SHARE | PMD_SECT_NS },
|
||||
{ CONFIG_SYS_FSL_QSPI_BASE2, CONFIG_SYS_FSL_QSPI_BASE2,
|
||||
CONFIG_SYS_FSL_QSPI_SIZE2, MT_DEVICE_NGNRNE,
|
||||
PMD_SECT_NON_SHARE | PMD_SECT_PXN | PMD_SECT_UXN },
|
||||
@@ -183,7 +186,7 @@ static const struct sys_mmu_table final_mmu_table[] = {
|
||||
/* For QBMAN portal, only the first 64MB is cache-enabled */
|
||||
{ CONFIG_SYS_FSL_QBMAN_BASE, CONFIG_SYS_FSL_QBMAN_BASE,
|
||||
CONFIG_SYS_FSL_QBMAN_SIZE_1, MT_NORMAL,
|
||||
PMD_SECT_NON_SHARE | PMD_SECT_PXN | PMD_SECT_UXN },
|
||||
PMD_SECT_NON_SHARE | PMD_SECT_PXN | PMD_SECT_UXN | PMD_SECT_NS },
|
||||
{ CONFIG_SYS_FSL_QBMAN_BASE + CONFIG_SYS_FSL_QBMAN_SIZE_1,
|
||||
CONFIG_SYS_FSL_QBMAN_BASE + CONFIG_SYS_FSL_QBMAN_SIZE_1,
|
||||
CONFIG_SYS_FSL_QBMAN_SIZE - CONFIG_SYS_FSL_QBMAN_SIZE_1,
|
||||
@@ -212,7 +215,8 @@ static const struct sys_mmu_table final_mmu_table[] = {
|
||||
CONFIG_SYS_FSL_PEBUF_SIZE, MT_DEVICE_NGNRNE,
|
||||
PMD_SECT_NON_SHARE | PMD_SECT_PXN | PMD_SECT_UXN },
|
||||
{ CONFIG_SYS_FSL_DRAM_BASE2, CONFIG_SYS_FSL_DRAM_BASE2,
|
||||
CONFIG_SYS_FSL_DRAM_SIZE2, MT_NORMAL, PMD_SECT_OUTER_SHARE },
|
||||
CONFIG_SYS_FSL_DRAM_SIZE2, MT_NORMAL,
|
||||
PMD_SECT_OUTER_SHARE | PMD_SECT_NS },
|
||||
#elif defined(CONFIG_FSL_LSCH2)
|
||||
{ CONFIG_SYS_FSL_BOOTROM_BASE, CONFIG_SYS_FSL_BOOTROM_BASE,
|
||||
CONFIG_SYS_FSL_BOOTROM_SIZE, MT_DEVICE_NGNRNE,
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
|
||||
#define CONFIG_SYS_IMMR 0x01000000
|
||||
#define CONFIG_SYS_DCSRBAR 0x20000000
|
||||
#define CONFIG_SYS_DCSR_DCFG_ADDR (CONFIG_SYS_DCSRBAR + 0x00220000)
|
||||
#define CONFIG_SYS_DCSR_DCFG_ADDR (CONFIG_SYS_DCSRBAR + 0x00140000)
|
||||
#define CONFIG_SYS_DCSR_COP_CCP_ADDR (CONFIG_SYS_DCSRBAR + 0x02008040)
|
||||
|
||||
#define CONFIG_SYS_FSL_DDR_ADDR (CONFIG_SYS_IMMR + 0x00080000)
|
||||
#define CONFIG_SYS_CCI400_ADDR (CONFIG_SYS_IMMR + 0x00180000)
|
||||
@@ -38,7 +39,7 @@
|
||||
#define CONFIG_SYS_PCIE3_ADDR (CONFIG_SYS_IMMR + 0x2600000)
|
||||
#define CONFIG_SYS_FSL_SEC_ADDR (CONFIG_SYS_IMMR + 0x700000)
|
||||
#define CONFIG_SYS_FSL_JR0_ADDR (CONFIG_SYS_IMMR + 0x710000)
|
||||
#define CONFIG_SYS_SNVS_ADDR (CONFIG_SYS_IMMR + 0xe90000)
|
||||
#define CONFIG_SYS_SEC_MON_ADDR (CONFIG_SYS_IMMR + 0xe90000)
|
||||
#define CONFIG_SYS_SFP_ADDR (CONFIG_SYS_IMMR + 0xe80200)
|
||||
|
||||
#define CONFIG_SYS_FSL_TIMER_ADDR 0x02b00000
|
||||
|
||||
@@ -69,6 +69,10 @@
|
||||
#define TZASC_REGION_ATTRIBUTES_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x110)
|
||||
#define TZASC_REGION_ID_ACCESS_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x114)
|
||||
|
||||
/* SATA */
|
||||
#define AHCI_BASE_ADDR1 (CONFIG_SYS_IMMR + 0x02200000)
|
||||
#define AHCI_BASE_ADDR2 (CONFIG_SYS_IMMR + 0x02210000)
|
||||
|
||||
/* PCIe */
|
||||
#define CONFIG_SYS_PCIE1_ADDR (CONFIG_SYS_IMMR + 0x2400000)
|
||||
#define CONFIG_SYS_PCIE2_ADDR (CONFIG_SYS_IMMR + 0x2500000)
|
||||
|
||||
@@ -51,6 +51,37 @@ struct cpu_type {
|
||||
#define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
|
||||
#define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
|
||||
|
||||
/* ahci port register default value */
|
||||
#define AHCI_PORT_PHY_1_CFG 0xa003fffe
|
||||
#define AHCI_PORT_PHY_2_CFG 0x28184d1f
|
||||
#define AHCI_PORT_PHY_3_CFG 0x0e081509
|
||||
#define AHCI_PORT_TRANS_CFG 0x08000029
|
||||
|
||||
/* AHCI (sata) register map */
|
||||
struct ccsr_ahci {
|
||||
u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
|
||||
u32 pcfg; /* port config */
|
||||
u32 ppcfg; /* port phy1 config */
|
||||
u32 pp2c; /* port phy2 config */
|
||||
u32 pp3c; /* port phy3 config */
|
||||
u32 pp4c; /* port phy4 config */
|
||||
u32 pp5c; /* port phy5 config */
|
||||
u32 axicc; /* AXI cache control */
|
||||
u32 paxic; /* port AXI config */
|
||||
u32 axipc; /* AXI PROT control */
|
||||
u32 ptc; /* port Trans Config */
|
||||
u32 pts; /* port Trans Status */
|
||||
u32 plc; /* port link config */
|
||||
u32 plc1; /* port link config1 */
|
||||
u32 plc2; /* port link config2 */
|
||||
u32 pls; /* port link status */
|
||||
u32 pls1; /* port link status1 */
|
||||
u32 pcmdc; /* port CMD config */
|
||||
u32 ppcs; /* port phy control status */
|
||||
u32 pberr; /* port 0/1 BIST error */
|
||||
u32 cmds; /* port 0/1 CMD status error */
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FSL_LSCH3
|
||||
void fsl_lsch3_early_init_f(void);
|
||||
#elif defined(CONFIG_FSL_LSCH2)
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#define SVR_MIN(svr) (((svr) >> 0) & 0xf)
|
||||
#define SVR_SOC_VER(svr) (((svr) >> 8) & 0x7ff)
|
||||
#define IS_E_PROCESSOR(svr) (svr & 0x80000)
|
||||
#define IS_SVR_REV(svr, maj, min) \
|
||||
((SVR_MAJ(svr) == maj) && (SVR_MIN(svr) == min))
|
||||
|
||||
#define SOC_VER_SLS1020 0x00
|
||||
#define SOC_VER_LS1020 0x10
|
||||
@@ -150,6 +152,12 @@ struct ccsr_gur {
|
||||
#define SCFG_ETSECCMCR_GE1_CLK125 0x08000000
|
||||
#define SCFG_PIXCLKCR_PXCKEN 0x80000000
|
||||
#define SCFG_QSPI_CLKSEL 0xc0100000
|
||||
#define SCFG_SNPCNFGCR_SEC_RD_WR 0xc0000000
|
||||
#define SCFG_SNPCNFGCR_DCU_RD_WR 0x03000000
|
||||
#define SCFG_SNPCNFGCR_SATA_RD_WR 0x00c00000
|
||||
#define SCFG_SNPCNFGCR_USB3_RD_WR 0x00300000
|
||||
#define SCFG_SNPCNFGCR_DBG_RD_WR 0x000c0000
|
||||
#define SCFG_SNPCNFGCR_EDMA_SNP 0x00020000
|
||||
#define SCFG_ENDIANCR_LE 0x80000000
|
||||
|
||||
/* Supplemental Configuration Unit */
|
||||
@@ -222,7 +230,7 @@ struct ccsr_scfg {
|
||||
u32 scfgrevcr;
|
||||
u32 coresrencr;
|
||||
u32 pex2pmrdsr;
|
||||
u32 ddrc1cr;
|
||||
u32 eddrtqcfg;
|
||||
u32 ddrc2cr;
|
||||
u32 ddrc3cr;
|
||||
u32 ddrc4cr;
|
||||
@@ -422,4 +430,7 @@ struct ccsr_ahci {
|
||||
u32 pberr; /* port 0/1 BIST error */
|
||||
u32 cmds; /* port 0/1 CMD status error */
|
||||
};
|
||||
|
||||
uint get_svr(void);
|
||||
|
||||
#endif /* __ASM_ARCH_LS102XA_IMMAP_H_ */
|
||||
|
||||
12
arch/arm/include/asm/arch-ls102xa/ls102xa_soc.h
Normal file
12
arch/arm/include/asm/arch-ls102xa/ls102xa_soc.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2015 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __FSL_LS102XA_SOC_H
|
||||
#define __FSL_LS102XA_SOC_H
|
||||
|
||||
unsigned int get_soc_major_rev(void);
|
||||
int arch_soc_init(void);
|
||||
#endif /* __FSL_LS102XA_SOC_H */
|
||||
@@ -3,7 +3,7 @@
|
||||
* Yuri Tikhonov, Emcraft Systems, yur@emcraft.com
|
||||
*
|
||||
* (C) Copyright 2015
|
||||
* Kamil Lulko, <rev13@wp.pl>
|
||||
* Kamil Lulko, <kamil.lulko@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
@@ -106,6 +106,14 @@ struct stm32_flash_regs {
|
||||
#define STM32_FLASH_CR_SNB_OFFSET 3
|
||||
#define STM32_FLASH_CR_SNB_MASK (15 << STM32_FLASH_CR_SNB_OFFSET)
|
||||
|
||||
/*
|
||||
* Peripheral base addresses
|
||||
*/
|
||||
#define STM32_USART1_BASE (STM32_APB2PERIPH_BASE + 0x1000)
|
||||
#define STM32_USART2_BASE (STM32_APB1PERIPH_BASE + 0x4400)
|
||||
#define STM32_USART3_BASE (STM32_APB1PERIPH_BASE + 0x4800)
|
||||
#define STM32_USART6_BASE (STM32_APB2PERIPH_BASE + 0x1400)
|
||||
|
||||
enum clock {
|
||||
CLOCK_CORE,
|
||||
CLOCK_AHB,
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
#define CLK_GATE_CLOSE 0x0
|
||||
|
||||
/* clock control module regs definition */
|
||||
#if defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
|
||||
#if defined(CONFIG_MACH_SUN8I_A83T)
|
||||
#include <asm/arch/clock_sun8i_a83t.h>
|
||||
#elif defined(CONFIG_MACH_SUN6I) || defined(CONFIG_MACH_SUN8I)
|
||||
#include <asm/arch/clock_sun6i.h>
|
||||
#elif defined(CONFIG_MACH_SUN9I)
|
||||
#include <asm/arch/clock_sun9i.h>
|
||||
|
||||
@@ -220,11 +220,7 @@ struct sunxi_ccm_reg {
|
||||
#define CCM_PLL11_CTRL_UPD (0x1 << 30)
|
||||
#define CCM_PLL11_CTRL_EN (0x1 << 31)
|
||||
|
||||
#if defined CONFIG_MACH_SUN8I_H3
|
||||
#define AHB1_ABP1_DIV_DEFAULT 0x00003180 /* AHB1=PLL6/3,APB1=AHB1/2 */
|
||||
#else
|
||||
#define AHB1_ABP1_DIV_DEFAULT 0x00002020 /* AHB1=AXI/4, APB1=AHB1/2 */
|
||||
#endif
|
||||
|
||||
#define AXI_GATE_OFFSET_DRAM 0
|
||||
|
||||
|
||||
304
arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h
Normal file
304
arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h
Normal file
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* sun8i a83t clock register definitions
|
||||
*
|
||||
* (C) Copyright 2007-2011
|
||||
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
|
||||
* Tom Cubie <tangliang@allwinnertech.com>
|
||||
*
|
||||
* (C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
* from sun6i.h
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _SUNXI_CLOCK_SUN8I_A83T_H
|
||||
#define _SUNXI_CLOCK_SUN8I_A83T_H
|
||||
|
||||
struct sunxi_ccm_reg {
|
||||
u32 pll1_c0_cfg; /* 0x00 c1cpu# pll control */
|
||||
u32 pll1_c1_cfg; /* 0x04 c1cpu# pll control */
|
||||
u32 pll2_cfg; /* 0x08 pll2 audio control */
|
||||
u32 reserved1;
|
||||
u32 pll3_cfg; /* 0x10 pll3 video0 control */
|
||||
u32 reserved2;
|
||||
u32 pll4_cfg; /* 0x18 pll4 ve control */
|
||||
u32 reserved3;
|
||||
u32 pll5_cfg; /* 0x20 pll5 ddr control */
|
||||
u32 reserved4;
|
||||
u32 pll6_cfg; /* 0x28 pll6 peripheral control */
|
||||
u32 reserved5[3]; /* 0x2c */
|
||||
u32 pll7_cfg; /* 0x38 pll7 gpu control */
|
||||
u32 reserved6[2]; /* 0x3c */
|
||||
u32 pll8_cfg; /* 0x44 pll8 hsic control */
|
||||
u32 pll9_cfg; /* 0x48 pll9 de control */
|
||||
u32 pll10_cfg; /* 0x4c pll10 video1 control */
|
||||
u32 cpu_axi_cfg; /* 0x50 CPU/AXI divide ratio */
|
||||
u32 ahb1_apb1_div; /* 0x54 AHB1/APB1 divide ratio */
|
||||
u32 apb2_div; /* 0x58 APB2 divide ratio */
|
||||
u32 ahb2_div; /* 0x5c AHB2 divide ratio */
|
||||
u32 ahb_gate0; /* 0x60 ahb module clock gating 0 */
|
||||
u32 ahb_gate1; /* 0x64 ahb module clock gating 1 */
|
||||
u32 apb1_gate; /* 0x68 apb1 module clock gating 3 */
|
||||
u32 apb2_gate; /* 0x6c apb2 module clock gating 4 */
|
||||
u32 reserved7[2]; /* 0x70 */
|
||||
u32 cci400_cfg; /* 0x78 cci400 clock configuration A83T only */
|
||||
u32 reserved8; /* 0x7c */
|
||||
u32 nand0_clk_cfg; /* 0x80 nand clock control */
|
||||
u32 reserved9; /* 0x84 */
|
||||
u32 sd0_clk_cfg; /* 0x88 sd0 clock control */
|
||||
u32 sd1_clk_cfg; /* 0x8c sd1 clock control */
|
||||
u32 sd2_clk_cfg; /* 0x90 sd2 clock control */
|
||||
u32 sd3_clk_cfg; /* 0x94 sd3 clock control */
|
||||
u32 reserved10; /* 0x98 */
|
||||
u32 ss_clk_cfg; /* 0x9c security system clock control */
|
||||
u32 spi0_clk_cfg; /* 0xa0 spi0 clock control */
|
||||
u32 spi1_clk_cfg; /* 0xa4 spi1 clock control */
|
||||
u32 reserved11[2]; /* 0xa8 */
|
||||
u32 i2s0_clk_cfg; /* 0xb0 I2S0 clock control */
|
||||
u32 i2s1_clk_cfg; /* 0xb4 I2S1 clock control */
|
||||
u32 i2s2_clk_cfg; /* 0xb8 I2S2 clock control */
|
||||
u32 tdm_clk_cfg; /* 0xbc TDM clock control */
|
||||
u32 spdif_clk_cfg; /* 0xc0 SPDIF clock control */
|
||||
u32 reserved12[2]; /* 0xc4 */
|
||||
u32 usb_clk_cfg; /* 0xcc USB clock control */
|
||||
u32 reserved13[9]; /* 0xd0 */
|
||||
u32 dram_clk_cfg; /* 0xf4 DRAM configuration clock control */
|
||||
u32 dram_pll_cfg; /* 0xf8 PLL_DDR cfg register */
|
||||
u32 mbus_reset; /* 0xfc MBUS reset control */
|
||||
u32 dram_clk_gate; /* 0x100 DRAM module gating */
|
||||
u32 reserved14[5]; /* 0x104 BE0 */
|
||||
u32 lcd0_clk_cfg; /* 0x118 LCD0 module clock */
|
||||
u32 lcd1_clk_cfg; /* 0x11c LCD1 module clock */
|
||||
u32 reserved15[4]; /* 0x120 */
|
||||
u32 mipi_csi_clk_cfg; /* 0x130 MIPI CSI module clock */
|
||||
u32 csi_clk_cfg; /* 0x134 CSI module clock */
|
||||
u32 reserved16; /* 0x138 */
|
||||
u32 ve_clk_cfg; /* 0x13c VE module clock */
|
||||
u32 reserved17; /* 0x140 */
|
||||
u32 avs_clk_cfg; /* 0x144 AVS module clock */
|
||||
u32 reserved18[2]; /* 0x148 */
|
||||
u32 hdmi_clk_cfg; /* 0x150 HDMI module clock */
|
||||
u32 hdmi_slow_clk_cfg; /* 0x154 HDMI slow module clock */
|
||||
u32 reserved19; /* 0x158 */
|
||||
u32 mbus_clk_cfg; /* 0x15c MBUS module clock */
|
||||
u32 reserved20[2]; /* 0x160 */
|
||||
u32 mipi_dsi_clk_cfg; /* 0x168 MIPI DSI clock control */
|
||||
u32 reserved21[13]; /* 0x16c */
|
||||
u32 gpu_core_clk_cfg; /* 0x1a0 GPU core clock config */
|
||||
u32 gpu_mem_clk_cfg; /* 0x1a4 GPU memory clock config */
|
||||
u32 gpu_hyd_clk_cfg; /* 0x1a8 GPU HYD clock config */
|
||||
u32 reserved22[21]; /* 0x1ac */
|
||||
u32 pll_stable0; /* 0x200 PLL stable time 0 */
|
||||
u32 pll_stable1; /* 0x204 PLL stable time 1 */
|
||||
u32 reserved23; /* 0x208 */
|
||||
u32 pll_stable_status; /* 0x20c PLL stable status register */
|
||||
u32 reserved24[4]; /* 0x210 */
|
||||
u32 pll1_c0_bias_cfg; /* 0x220 PLL1 c0cpu# Bias config */
|
||||
u32 pll2_bias_cfg; /* 0x224 PLL2 audio Bias config */
|
||||
u32 pll3_bias_cfg; /* 0x228 PLL3 video Bias config */
|
||||
u32 pll4_bias_cfg; /* 0x22c PLL4 ve Bias config */
|
||||
u32 pll5_bias_cfg; /* 0x230 PLL5 ddr Bias config */
|
||||
u32 pll6_bias_cfg; /* 0x234 PLL6 periph Bias config */
|
||||
u32 pll1_c1_bias_cfg; /* 0x238 PLL1 c1cpu# Bias config */
|
||||
u32 pll8_bias_cfg; /* 0x23c PLL7 Bias config */
|
||||
u32 reserved25; /* 0x240 */
|
||||
u32 pll9_bias_cfg; /* 0x244 PLL9 hsic Bias config */
|
||||
u32 de_bias_cfg; /* 0x248 display engine Bias config */
|
||||
u32 video1_bias_cfg; /* 0x24c pll video1 bias register */
|
||||
u32 c0_tuning_cfg; /* 0x250 pll c0cpu# tuning register */
|
||||
u32 c1_tuning_cfg; /* 0x254 pll c1cpu# tuning register */
|
||||
u32 reserved26[11]; /* 0x258 */
|
||||
u32 pll2_pattern_cfg0; /* 0x284 PLL2 Pattern register 0 */
|
||||
u32 pll3_pattern_cfg0; /* 0x288 PLL3 Pattern register 0 */
|
||||
u32 reserved27; /* 0x28c */
|
||||
u32 pll5_pattern_cfg0; /* 0x290 PLL5 Pattern register 0*/
|
||||
u32 reserved28[4]; /* 0x294 */
|
||||
u32 pll2_pattern_cfg1; /* 0x2a4 PLL2 Pattern register 1 */
|
||||
u32 pll3_pattern_cfg1; /* 0x2a8 PLL3 Pattern register 1 */
|
||||
u32 reserved29; /* 0x2ac */
|
||||
u32 pll5_pattern_cfg1; /* 0x2b0 PLL5 Pattern register 1 */
|
||||
u32 reserved30[3]; /* 0x2b4 */
|
||||
u32 ahb_reset0_cfg; /* 0x2c0 AHB1 Reset 0 config */
|
||||
u32 ahb_reset1_cfg; /* 0x2c4 AHB1 Reset 1 config */
|
||||
u32 ahb_reset2_cfg; /* 0x2c8 AHB1 Reset 2 config */
|
||||
u32 reserved31;
|
||||
u32 ahb_reset3_cfg; /* 0x2d0 AHB1 Reset 3 config */
|
||||
u32 reserved32; /* 0x2d4 */
|
||||
u32 apb2_reset_cfg; /* 0x2d8 BUS Reset 4 config */
|
||||
};
|
||||
|
||||
/* apb2 bit field */
|
||||
#define APB2_CLK_SRC_LOSC (0x0 << 24)
|
||||
#define APB2_CLK_SRC_OSC24M (0x1 << 24)
|
||||
#define APB2_CLK_SRC_PLL6 (0x2 << 24)
|
||||
#define APB2_CLK_SRC_MASK (0x3 << 24)
|
||||
#define APB2_CLK_RATE_N_1 (0x0 << 16)
|
||||
#define APB2_CLK_RATE_N_2 (0x1 << 16)
|
||||
#define APB2_CLK_RATE_N_4 (0x2 << 16)
|
||||
#define APB2_CLK_RATE_N_8 (0x3 << 16)
|
||||
#define APB2_CLK_RATE_N_MASK (3 << 16)
|
||||
#define APB2_CLK_RATE_M(m) (((m)-1) << 0)
|
||||
#define APB2_CLK_RATE_M_MASK (0x1f << 0)
|
||||
|
||||
/* apb2 gate field */
|
||||
#define APB2_GATE_UART_SHIFT (16)
|
||||
#define APB2_GATE_UART_MASK (0xff << APB2_GATE_UART_SHIFT)
|
||||
#define APB2_GATE_TWI_SHIFT (0)
|
||||
#define APB2_GATE_TWI_MASK (0xf << APB2_GATE_TWI_SHIFT)
|
||||
|
||||
/* cpu_axi_cfg bits */
|
||||
#define AXI0_DIV_SHIFT 0
|
||||
#define AXI1_DIV_SHIFT 16
|
||||
#define C0_CPUX_CLK_SRC_SHIFT 12
|
||||
#define C1_CPUX_CLK_SRC_SHIFT 28
|
||||
|
||||
#define AXI_DIV_1 0
|
||||
#define AXI_DIV_2 1
|
||||
#define AXI_DIV_3 2
|
||||
#define AXI_DIV_4 3
|
||||
#define CPU_CLK_SRC_OSC24M 0
|
||||
#define CPU_CLK_SRC_PLL1 1
|
||||
|
||||
#define CCM_PLL1_CTRL_N(n) ((((n) - 1) & 0xff) << 8)
|
||||
#define CCM_PLL1_CTRL_P(n) (((n) & 0x1) << 16)
|
||||
#define CCM_PLL1_CTRL_EN (0x1 << 31)
|
||||
#define CMM_PLL1_CLOCK_TIME_2 (0x2 << 24)
|
||||
|
||||
#define PLL8_CFG_DEFAULT 0x42800
|
||||
#define CCM_CCI400_CLK_SEL_HSIC (0x2<<24)
|
||||
|
||||
#define CCM_PLL5_DIV1_SHIFT 16
|
||||
#define CCM_PLL5_DIV2_SHIFT 18
|
||||
#define CCM_PLL5_CTRL_N(n) (((n) - 1) << 8)
|
||||
#define CCM_PLL5_CTRL_UPD (0x1 << 30)
|
||||
#define CCM_PLL5_CTRL_EN (0x1 << 31)
|
||||
|
||||
#define PLL6_CFG_DEFAULT 0x80001900 /* 600 MHz */
|
||||
#define CCM_PLL6_CTRL_N_SHIFT 8
|
||||
#define CCM_PLL6_CTRL_N_MASK (0xff << CCM_PLL6_CTRL_N_SHIFT)
|
||||
#define CCM_PLL6_CTRL_DIV1_SHIFT 16
|
||||
#define CCM_PLL6_CTRL_DIV1_MASK (0x1 << CCM_PLL6_CTRL_DIV1_SHIFT)
|
||||
#define CCM_PLL6_CTRL_DIV2_SHIFT 18
|
||||
#define CCM_PLL6_CTRL_DIV2_MASK (0x1 << CCM_PLL6_CTRL_DIV2_SHIFT)
|
||||
|
||||
#define AHB1_ABP1_DIV_DEFAULT 0x00002190
|
||||
#define AHB1_CLK_SRC_MASK (0x3<<12)
|
||||
#define AHB1_CLK_SRC_INTOSC (0x0<<12)
|
||||
#define AHB1_CLK_SRC_OSC24M (0x1<<12)
|
||||
#define AHB1_CLK_SRC_PLL6 (0x2<<12)
|
||||
|
||||
#define AXI_GATE_OFFSET_DRAM 0
|
||||
|
||||
/* ahb_gate0 offsets */
|
||||
#define AHB_GATE_OFFSET_USB_OHCI1 30
|
||||
#define AHB_GATE_OFFSET_USB_OHCI0 29
|
||||
#define AHB_GATE_OFFSET_USB_EHCI1 27
|
||||
#define AHB_GATE_OFFSET_USB_EHCI0 26
|
||||
#define AHB_GATE_OFFSET_USB0 24
|
||||
#define AHB_GATE_OFFSET_SPI1 21
|
||||
#define AHB_GATE_OFFSET_SPI0 20
|
||||
#define AHB_GATE_OFFSET_HSTIMER 19
|
||||
#define AHB_GATE_OFFSET_EMAC 17
|
||||
#define AHB_GATE_OFFSET_MCTL 14
|
||||
#define AHB_GATE_OFFSET_GMAC 17
|
||||
#define AHB_GATE_OFFSET_NAND0 13
|
||||
#define AHB_GATE_OFFSET_MMC0 8
|
||||
#define AHB_GATE_OFFSET_MMC(n) (AHB_GATE_OFFSET_MMC0 + (n))
|
||||
#define AHB_GATE_OFFSET_DMA 6
|
||||
#define AHB_GATE_OFFSET_SS 5
|
||||
|
||||
/* ahb_gate1 offsets */
|
||||
#define AHB_GATE_OFFSET_DRC0 25
|
||||
#define AHB_GATE_OFFSET_DE_FE0 14
|
||||
#define AHB_GATE_OFFSET_DE_BE0 12
|
||||
#define AHB_GATE_OFFSET_HDMI 11
|
||||
#define AHB_GATE_OFFSET_LCD1 5
|
||||
#define AHB_GATE_OFFSET_LCD0 4
|
||||
|
||||
#define CCM_MMC_CTRL_M(x) ((x) - 1)
|
||||
#define CCM_MMC_CTRL_OCLK_DLY(x) ((x) << 8)
|
||||
#define CCM_MMC_CTRL_N(x) ((x) << 16)
|
||||
#define CCM_MMC_CTRL_SCLK_DLY(x) ((x) << 20)
|
||||
#define CCM_MMC_CTRL_OSCM24 (0x0 << 24)
|
||||
#define CCM_MMC_CTRL_PLL6 (0x1 << 24)
|
||||
#define CCM_MMC_CTRL_ENABLE (0x1 << 31)
|
||||
|
||||
#define CCM_USB_CTRL_PHY0_RST (0x1 << 0)
|
||||
#define CCM_USB_CTRL_PHY1_RST (0x1 << 1)
|
||||
#define CCM_USB_CTRL_PHY2_RST (0x1 << 2)
|
||||
/* There is no global phy clk gate on sun6i, define as 0 */
|
||||
#define CCM_USB_CTRL_PHYGATE 0
|
||||
#define CCM_USB_CTRL_PHY0_CLK (0x1 << 8)
|
||||
#define CCM_USB_CTRL_PHY1_CLK (0x1 << 9)
|
||||
#define CCM_USB_CTRL_PHY2_CLK (0x1 << 10)
|
||||
#define CCM_USB_CTRL_OHCI0_CLK (0x1 << 16)
|
||||
#define CCM_USB_CTRL_OHCI1_CLK (0x1 << 17)
|
||||
|
||||
#define CCM_GMAC_CTRL_TX_CLK_SRC_MII 0x0
|
||||
#define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1
|
||||
#define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
|
||||
#define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2)
|
||||
#define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2)
|
||||
#define CCM_GMAC_CTRL_RX_CLK_DELAY(x) ((x) << 5)
|
||||
#define CCM_GMAC_CTRL_TX_CLK_DELAY(x) ((x) << 10)
|
||||
|
||||
#define MDFS_CLK_DEFAULT 0x81000002 /* PLL6 / 3 */
|
||||
|
||||
#define CCM_DRAMCLK_CFG_DIV(x) ((x - 1) << 0)
|
||||
#define CCM_DRAMCLK_CFG_DIV_MASK (0xf << 0)
|
||||
#define CCM_DRAMCLK_CFG_DIV0(x) ((x - 1) << 8)
|
||||
#define CCM_DRAMCLK_CFG_DIV0_MASK (0xf << 8)
|
||||
#define CCM_DRAMCLK_CFG_UPD (0x1 << 16)
|
||||
#define CCM_DRAMCLK_CFG_RST (0x1 << 31)
|
||||
|
||||
#define CCM_DRAMPLL_CFG_SRC_PLL5 (0x0 << 16) /* Select PLL5 (DDR0) */
|
||||
#define CCM_DRAMPLL_CFG_SRC_PLL11 (0x1 << 16) /* Select PLL11 (DDR1) */
|
||||
#define CCM_DRAMPLL_CFG_SRC_MASK (0x1 << 16)
|
||||
|
||||
#define CCM_MBUS_RESET_RESET (0x1 << 31)
|
||||
|
||||
#define CCM_DRAM_GATE_OFFSET_DE_FE0 24
|
||||
#define CCM_DRAM_GATE_OFFSET_DE_FE1 25
|
||||
#define CCM_DRAM_GATE_OFFSET_DE_BE0 26
|
||||
#define CCM_DRAM_GATE_OFFSET_DE_BE1 27
|
||||
|
||||
|
||||
#define MBUS_CLK_DEFAULT 0x81000002 /* PLL6 / 2 */
|
||||
|
||||
#define MBUS_CLK_GATE (0x1 << 31)
|
||||
|
||||
/* ahb_reset0 offsets */
|
||||
#define AHB_RESET_OFFSET_GMAC 17
|
||||
#define AHB_RESET_OFFSET_MCTL 14
|
||||
#define AHB_RESET_OFFSET_MMC3 11
|
||||
#define AHB_RESET_OFFSET_MMC2 10
|
||||
#define AHB_RESET_OFFSET_MMC1 9
|
||||
#define AHB_RESET_OFFSET_MMC0 8
|
||||
#define AHB_RESET_OFFSET_MMC(n) (AHB_RESET_OFFSET_MMC0 + (n))
|
||||
#define AHB_RESET_OFFSET_SS 5
|
||||
|
||||
/* ahb_reset1 offsets */
|
||||
#define AHB_RESET_OFFSET_SAT 26
|
||||
#define AHB_RESET_OFFSET_DRC0 25
|
||||
#define AHB_RESET_OFFSET_DE_FE0 14
|
||||
#define AHB_RESET_OFFSET_DE_BE0 12
|
||||
#define AHB_RESET_OFFSET_HDMI 11
|
||||
#define AHB_RESET_OFFSET_LCD1 5
|
||||
#define AHB_RESET_OFFSET_LCD0 4
|
||||
|
||||
/* ahb_reset2 offsets */
|
||||
#define AHB_RESET_OFFSET_LVDS 0
|
||||
|
||||
/* apb2 reset */
|
||||
#define APB2_RESET_UART_SHIFT (16)
|
||||
#define APB2_RESET_UART_MASK (0xff << APB2_RESET_UART_SHIFT)
|
||||
#define APB2_RESET_TWI_SHIFT (0)
|
||||
#define APB2_RESET_TWI_MASK (0xf << APB2_RESET_TWI_SHIFT)
|
||||
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
void clock_set_pll1(unsigned int hz);
|
||||
void clock_set_pll5(unsigned int clk);
|
||||
unsigned int clock_get_pll6(void);
|
||||
#endif
|
||||
|
||||
#endif /* _SUNXI_CLOCK_SUN8I_A83T_H */
|
||||
@@ -22,6 +22,8 @@
|
||||
#include <asm/arch/dram_sun8i_a23.h>
|
||||
#elif defined(CONFIG_MACH_SUN8I_A33)
|
||||
#include <asm/arch/dram_sun8i_a33.h>
|
||||
#elif defined(CONFIG_MACH_SUN8I_A83T)
|
||||
#include <asm/arch/dram_sun8i_a83t.h>
|
||||
#elif defined(CONFIG_MACH_SUN8I_H3)
|
||||
#include <asm/arch/dram_sun8i_h3.h>
|
||||
#else
|
||||
|
||||
201
arch/arm/include/asm/arch-sunxi/dram_sun8i_a83t.h
Normal file
201
arch/arm/include/asm/arch-sunxi/dram_sun8i_a83t.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Sun8i platform dram controller register and constant defines
|
||||
*
|
||||
* (C) Copyright 2007-2015 Allwinner Technology Co.
|
||||
* Jerry Wang <wangflord@allwinnertech.com>
|
||||
* (C) Copyright 2015 Vishnu Patekar <vishnupatekar0510@gmail.com>
|
||||
* (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _SUNXI_DRAM_SUN8I_A83T_H
|
||||
#define _SUNXI_DRAM_SUN8I_A83T_H
|
||||
|
||||
struct sunxi_mctl_com_reg {
|
||||
u32 cr; /* 0x00 */
|
||||
u32 ccr; /* 0x04 controller configuration register */
|
||||
u32 dbgcr; /* 0x08 */
|
||||
u8 res0[0x4]; /* 0x0c */
|
||||
u32 mcr0_0; /* 0x10 */
|
||||
u32 mcr1_0; /* 0x14 */
|
||||
u32 mcr0_1; /* 0x18 */
|
||||
u32 mcr1_1; /* 0x1c */
|
||||
u32 mcr0_2; /* 0x20 */
|
||||
u32 mcr1_2; /* 0x24 */
|
||||
u32 mcr0_3; /* 0x28 */
|
||||
u32 mcr1_3; /* 0x2c */
|
||||
u32 mcr0_4; /* 0x30 */
|
||||
u32 mcr1_4; /* 0x34 */
|
||||
u32 mcr0_5; /* 0x38 */
|
||||
u32 mcr1_5; /* 0x3c */
|
||||
u32 mcr0_6; /* 0x40 */
|
||||
u32 mcr1_6; /* 0x44 */
|
||||
u32 mcr0_7; /* 0x48 */
|
||||
u32 mcr1_7; /* 0x4c */
|
||||
u32 mcr0_8; /* 0x50 */
|
||||
u32 mcr1_8; /* 0x54 */
|
||||
u32 mcr0_9; /* 0x58 */
|
||||
u32 mcr1_9; /* 0x5c */
|
||||
u32 mcr0_10; /* 0x60 */
|
||||
u32 mcr1_10; /* 0x64 */
|
||||
u32 mcr0_11; /* 0x68 */
|
||||
u32 mcr1_11; /* 0x6c */
|
||||
u32 mcr0_12; /* 0x70 */
|
||||
u32 mcr1_12; /* 0x74 */
|
||||
u32 mcr0_13; /* 0x78 */
|
||||
u32 mcr1_13; /* 0x7c */
|
||||
u32 mcr0_14; /* 0x80 */
|
||||
u32 mcr1_14; /* 0x84 */
|
||||
u32 mcr0_15; /* 0x88 */
|
||||
u32 mcr1_15; /* 0x8c */
|
||||
u32 bwcr; /* 0x90 */
|
||||
u32 maer; /* 0x94 */
|
||||
u32 mapr; /* 0x98 */
|
||||
u32 mcgcr; /* 0x9c */
|
||||
u32 bwctr; /* 0xa0 */
|
||||
u8 res2[0x8]; /* 0xa4 */
|
||||
u32 swoffr; /* 0xac */
|
||||
u8 res3[0x10]; /* 0xb0 */
|
||||
u32 swonr; /* 0xc0 */
|
||||
u8 res4[0x3c]; /* 0xc4 */
|
||||
u32 mdfscr; /* 0x100 */
|
||||
u32 mdfsmer; /* 0x104 */
|
||||
};
|
||||
|
||||
struct sunxi_mctl_ctl_reg {
|
||||
u32 pir; /* 0x00 */
|
||||
u32 pwrctl; /* 0x04 */
|
||||
u32 mrctrl0; /* 0x08 */
|
||||
u32 clken; /* 0x0c */
|
||||
u32 pgsr0; /* 0x10 */
|
||||
u32 pgsr1; /* 0x14 */
|
||||
u32 statr; /* 0x18 */
|
||||
u8 res1[0x14]; /* 0x1c */
|
||||
u32 mr0; /* 0x30 */
|
||||
u32 mr1; /* 0x34 */
|
||||
u32 mr2; /* 0x38 */
|
||||
u32 mr3; /* 0x3c */
|
||||
u32 pllgcr; /* 0x40 */
|
||||
u32 ptr0; /* 0x44 */
|
||||
u32 ptr1; /* 0x48 */
|
||||
u32 ptr2; /* 0x4c */
|
||||
u32 ptr3; /* 0x50 */
|
||||
u32 ptr4; /* 0x54 */
|
||||
u32 dramtmg0; /* 0x58 dram timing parameters register 0 */
|
||||
u32 dramtmg1; /* 0x5c dram timing parameters register 1 */
|
||||
u32 dramtmg2; /* 0x60 dram timing parameters register 2 */
|
||||
u32 dramtmg3; /* 0x64 dram timing parameters register 3 */
|
||||
u32 dramtmg4; /* 0x68 dram timing parameters register 4 */
|
||||
u32 dramtmg5; /* 0x6c dram timing parameters register 5 */
|
||||
u32 dramtmg6; /* 0x70 dram timing parameters register 6 */
|
||||
u32 dramtmg7; /* 0x74 dram timing parameters register 7 */
|
||||
u32 dramtmg8; /* 0x78 dram timing parameters register 8 */
|
||||
u32 odtcfg; /* 0x7c */
|
||||
u32 pitmg0; /* 0x80 */
|
||||
u32 pitmg1; /* 0x84 */
|
||||
u8 res2[0x4]; /* 0x88 */
|
||||
u32 rfshctl0; /* 0x8c */
|
||||
u32 rfshtmg; /* 0x90 */
|
||||
u32 rfshctl1; /* 0x94 */
|
||||
u32 pwrtmg; /* 0x98 */
|
||||
u8 res3[0x20]; /* 0x9c */
|
||||
u32 dqsgmr; /* 0xbc */
|
||||
u32 dtcr; /* 0xc0 */
|
||||
u32 dtar0; /* 0xc4 */
|
||||
u32 dtar1; /* 0xc8 */
|
||||
u32 dtar2; /* 0xcc */
|
||||
u32 dtar3; /* 0xd0 */
|
||||
u32 dtdr0; /* 0xd4 */
|
||||
u32 dtdr1; /* 0xd8 */
|
||||
u32 dtmr0; /* 0xdc */
|
||||
u32 dtmr1; /* 0xe0 */
|
||||
u32 dtbmr; /* 0xe4 */
|
||||
u32 catr0; /* 0xe8 */
|
||||
u32 catr1; /* 0xec */
|
||||
u32 dtedr0; /* 0xf0 */
|
||||
u32 dtedr1; /* 0xf4 */
|
||||
u8 res4[0x8]; /* 0xf8 */
|
||||
u32 pgcr0; /* 0x100 */
|
||||
u32 pgcr1; /* 0x104 */
|
||||
u32 pgcr2; /* 0x108 */
|
||||
u32 pgcr3; /* 0x10c */
|
||||
u32 iovcr0; /* 0x110 */
|
||||
u32 iovcr1; /* 0x114 */
|
||||
u32 dqsdr; /* 0x118 */
|
||||
u32 dxccr; /* 0x11c */
|
||||
u32 odtmap; /* 0x120 */
|
||||
u32 zqctl0; /* 0x124 */
|
||||
u32 zqctl1; /* 0x128 */
|
||||
u8 res6[0x14]; /* 0x12c */
|
||||
u32 zqncr; /* 0x140 zq control register 0 */
|
||||
u32 zqnpr; /* 0x144 zq control register 1 */
|
||||
u32 zqndr; /* 0x148 zq control register 2 */
|
||||
u32 zqnsr; /* 0x14c zq status register 0 */
|
||||
u32 res7; /* 0x150 zq status register 1 */
|
||||
u8 res8[0x6c]; /* 0x154 */
|
||||
u32 sched; /* 0x1c0 */
|
||||
u32 perfhpr0; /* 0x1c4 */
|
||||
u32 perfhpr1; /* 0x1c8 */
|
||||
u32 perflpr0; /* 0x1cc */
|
||||
u32 perflpr1; /* 0x1d0 */
|
||||
u32 perfwr0; /* 0x1d4 */
|
||||
u32 perfwr1; /* 0x1d8 */
|
||||
};
|
||||
|
||||
|
||||
#define ZQnPR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000144 + 0x10 * x)
|
||||
#define ZQnDR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000148 + 0x10 * x)
|
||||
#define ZQnSR(x) (SUNXI_DRAM_CTL0_BASE + 0x0000014c + 0x10 * x)
|
||||
|
||||
#define DXnGTR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000340 + 0x80 * x)
|
||||
#define DXnGCR0(x) (SUNXI_DRAM_CTL0_BASE + 0x00000344 + 0x80 * x)
|
||||
#define DXnGSR0(x) (SUNXI_DRAM_CTL0_BASE + 0x00000348 + 0x80 * x)
|
||||
#define DXnGSR1(x) (SUNXI_DRAM_CTL0_BASE + 0x0000034c + 0x80 * x)
|
||||
#define DXnGSR2(x) (SUNXI_DRAM_CTL0_BASE + 0x00000350 + 0x80 * x)
|
||||
|
||||
#define CAIOCR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000210 + 0x4 * (x))
|
||||
#define DXnMDLR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000300 + 0x80 * x)
|
||||
#define DXMDLR0 (SUNXI_DRAM_CTL0_BASE + 0x00000300)
|
||||
#define DXnLCDLR0(x) (SUNXI_DRAM_CTL0_BASE + 0x00000304 + 0x80 * x)
|
||||
#define DXnLCDLR1(x) (SUNXI_DRAM_CTL0_BASE + 0x00000308 + 0x80 * x)
|
||||
#define DXnLCDLR2(x) (SUNXI_DRAM_CTL0_BASE + 0x0000030c + 0x80 * x)
|
||||
#define DATX0IOCR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000310 + 0x4 * x)
|
||||
#define DATX1IOCR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000390 + 0x4 * x)
|
||||
#define DATX2IOCR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000410 + 0x4 * x)
|
||||
#define DATX3IOCR(x) (SUNXI_DRAM_CTL0_BASE + 0x00000490 + 0x4 * x)
|
||||
#define MX_UPD0 (SUNXI_DRAM_CTL0_BASE + 0x00000880)
|
||||
#define MX_UPD2 (SUNXI_DRAM_CTL0_BASE + 0x00000888)
|
||||
|
||||
#define MCTL_PROTECT (SUNXI_DRAM_COM_BASE + 0x800)
|
||||
#define MCTL_MASTER_CFG0(x) (SUNXI_DRAM_COM_BASE + 0x10 + 0x8 * x)
|
||||
#define MCTL_MASTER_CFG1(x) (SUNXI_DRAM_COM_BASE + 0x14 + 0x8 * x)
|
||||
|
||||
/*
|
||||
* DRAM common (sunxi_mctl_com_reg) register constants.
|
||||
*/
|
||||
#define MCTL_CR_RANK_MASK (3 << 0)
|
||||
#define MCTL_CR_RANK(x) (((x) - 1) << 0)
|
||||
#define MCTL_CR_BANK_MASK (3 << 2)
|
||||
#define MCTL_CR_BANK(x) ((x) << 2)
|
||||
#define MCTL_CR_ROW_MASK (0xf << 4)
|
||||
#define MCTL_CR_ROW(x) (((x) - 1) << 4)
|
||||
#define MCTL_CR_PAGE_SIZE_MASK (0xf << 8)
|
||||
#define MCTL_CR_PAGE_SIZE(x) ((fls(x) - 4) << 8)
|
||||
#define MCTL_CR_BUSW_MASK (7 << 12)
|
||||
#define MCTL_CR_BUSW8 (0 << 12)
|
||||
#define MCTL_CR_BUSW16 (1 << 12)
|
||||
#define MCTL_CR_SEQUENCE (1 << 15)
|
||||
#define MCTL_CR_DDR3 (3 << 16)
|
||||
#define MCTL_CR_CHANNEL_MASK (1 << 19)
|
||||
#define MCTL_CR_CHANNEL(x) (((x) - 1) << 19)
|
||||
#define MCTL_CR_UNKNOWN (0x4 << 20)
|
||||
#define MCTL_CR_CS1_CONTROL(x) ((x) << 24)
|
||||
|
||||
/* DRAM control (sunxi_mctl_ctl_reg) register constants */
|
||||
#define MCTL_MR0 0x1c70 /* CL=11, WR=12 */
|
||||
#define MCTL_MR1 0x40
|
||||
#define MCTL_MR2 0x18 /* CWL=8 */
|
||||
#define MCTL_MR3 0x0
|
||||
|
||||
#endif /* _SUNXI_DRAM_SUN8I_A83T_H */
|
||||
@@ -158,6 +158,7 @@ enum sunxi_gpio_number {
|
||||
#define SUN5I_GPB_UART0 2
|
||||
#define SUN8I_GPB_UART2 2
|
||||
#define SUN8I_A33_GPB_UART0 3
|
||||
#define SUN8I_A83T_GPB_UART0 2
|
||||
|
||||
#define SUNXI_GPC_NAND 2
|
||||
#define SUNXI_GPC_SDC2 3
|
||||
|
||||
@@ -11,13 +11,17 @@
|
||||
#define CONFIG_CMD_ESBC_VALIDATE
|
||||
#define CONFIG_FSL_SEC_MON
|
||||
#define CONFIG_SHA_PROG_HW_ACCEL
|
||||
#define CONFIG_DM
|
||||
#define CONFIG_RSA
|
||||
#define CONFIG_RSA_FREESCALE_EXP
|
||||
|
||||
#ifndef CONFIG_FSL_CAAM
|
||||
#define CONFIG_FSL_CAAM
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DM
|
||||
#define CONFIG_DM
|
||||
#endif
|
||||
|
||||
#define CONFIG_KEY_REVOCATION
|
||||
#ifndef CONFIG_SYS_RAMBOOT
|
||||
/* The key used for verification of next level images
|
||||
|
||||
@@ -17,21 +17,6 @@ config ROCKCHIP_RK3036
|
||||
and video codec support. Peripherals include Gigabit Ethernet,
|
||||
USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
|
||||
|
||||
config ROCKCHIP_SPL_HDR
|
||||
string "Header of rockchip's spl loader"
|
||||
help
|
||||
Rockchip's bootrom requires the spl loader to start with a 4-bytes
|
||||
header. The content of this header depends on the chip type.
|
||||
|
||||
config ROCKCHIP_MAX_SPL_SIZE
|
||||
hex "Max size of rockchip's spl loader"
|
||||
help
|
||||
Different chip may have different sram size. And if we want to jump
|
||||
back to the bootrom after spl, we may need to reserve some sram space
|
||||
for the bootrom.
|
||||
The max spl loader size should be sram size minus reserved
|
||||
size(if needed)
|
||||
|
||||
config SYS_MALLOC_F
|
||||
default y
|
||||
|
||||
|
||||
@@ -3,21 +3,19 @@ if ROCKCHIP_RK3036
|
||||
config TARGET_EVB_RK3036
|
||||
bool "EVB_RK3036"
|
||||
|
||||
config TARGET_KYLIN_RK3036
|
||||
bool "KYLIN_RK3036"
|
||||
|
||||
config SYS_SOC
|
||||
default "rockchip"
|
||||
|
||||
config SYS_MALLOC_F_LEN
|
||||
default 0x400
|
||||
|
||||
config ROCKCHIP_SPL_HDR
|
||||
default "RK30"
|
||||
|
||||
config ROCKCHIP_MAX_SPL_SIZE
|
||||
default 0x1000
|
||||
|
||||
config ROCKCHIP_COMMON
|
||||
bool "Support rk common fuction"
|
||||
|
||||
source "board/evb_rk3036/evb_rk3036/Kconfig"
|
||||
source "board/kylin/kylin_rk3036/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
@@ -701,15 +701,19 @@ finish:
|
||||
static void sdram_all_config(struct rk3036_sdram_priv *priv)
|
||||
{
|
||||
u32 os_reg = 0;
|
||||
u32 cs1_row = 0;
|
||||
struct rk3036_ddr_config config = priv->ddr_config;
|
||||
|
||||
if (config.rank > 1)
|
||||
cs1_row = config.cs1_row - 13;
|
||||
|
||||
os_reg = config.ddr_type << DDR_TYPE_SHIFT |
|
||||
0 << DDR_CHN_CNT_SHIFT |
|
||||
(config.rank - 1) << DDR_RANK_CNT_SHIFT |
|
||||
(config.col - 1) << DDR_COL_SHIFT |
|
||||
(config.bank == 3 ? 0 : 1) << DDR_BANK_SHIFT |
|
||||
(config.cs0_row - 13) << DDR_CS0_ROW_SHIFT |
|
||||
(config.cs1_row - 13) << DDR_CS1_ROW_SHIFT |
|
||||
cs1_row << DDR_CS1_ROW_SHIFT |
|
||||
1 << DDR_BW_SHIFT | config.bw << DDR_DIE_BW_SHIFT;
|
||||
writel(os_reg, &priv->grf->os_reg[1]);
|
||||
}
|
||||
|
||||
@@ -16,12 +16,6 @@ config TARGET_CHROMEBOOK_JERRY
|
||||
WiFi. It includes a Chrome OS EC (Cortex-M3) to provide access to
|
||||
the keyboard and battery functions.
|
||||
|
||||
config ROCKCHIP_SPL_HDR
|
||||
default "RK32"
|
||||
|
||||
config ROCKCHIP_MAX_SPL_SIZE
|
||||
default 0x8000
|
||||
|
||||
config SYS_SOC
|
||||
default "rockchip"
|
||||
|
||||
|
||||
@@ -2,9 +2,14 @@ if ARCH_SOCFPGA
|
||||
|
||||
config TARGET_SOCFPGA_ARRIA5
|
||||
bool
|
||||
select TARGET_SOCFPGA_GEN5
|
||||
|
||||
config TARGET_SOCFPGA_CYCLONE5
|
||||
bool
|
||||
select TARGET_SOCFPGA_GEN5
|
||||
|
||||
config TARGET_SOCFPGA_GEN5
|
||||
bool
|
||||
|
||||
choice
|
||||
prompt "Altera SOCFPGA board select"
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
#
|
||||
|
||||
obj-y += misc.o timer.o reset_manager.o system_manager.o clock_manager.o \
|
||||
fpga_manager.o scan_manager.o
|
||||
fpga_manager.o board.o
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
|
||||
|
||||
# QTS-generated config file wrappers
|
||||
obj-y += wrap_pll_config.o
|
||||
obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += scan_manager.o wrap_pll_config.o
|
||||
obj-$(CONFIG_SPL_BUILD) += wrap_iocsr_config.o wrap_pinmux_config.o \
|
||||
wrap_sdram_config.o
|
||||
CFLAGS_wrap_iocsr_config.o += -I$(srctree)/board/$(BOARDDIR)
|
||||
|
||||
64
arch/arm/mach-socfpga/board.c
Normal file
64
arch/arm/mach-socfpga/board.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Altera SoCFPGA common board code
|
||||
*
|
||||
* Copyright (C) 2015 Marek Vasut <marex@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <errno.h>
|
||||
#include <asm/arch/reset_manager.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/dwc2_udc.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void s_init(void) {}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters for ATAG (if ATAG is used) */
|
||||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
struct dwc2_plat_otg_data socfpga_otg_data = {
|
||||
.usb_gusbcfg = 0x1417,
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
int node[2], count;
|
||||
fdt_addr_t addr;
|
||||
|
||||
count = fdtdec_find_aliases_for_id(gd->fdt_blob, "udc",
|
||||
COMPAT_ALTERA_SOCFPGA_DWC2USB,
|
||||
node, 2);
|
||||
if (count <= 0) /* No controller found. */
|
||||
return 0;
|
||||
|
||||
addr = fdtdec_get_addr(gd->fdt_blob, node[0], "reg");
|
||||
if (addr == FDT_ADDR_T_NONE) {
|
||||
printf("UDC Controller has no 'reg' property!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Patch the address from OF into the controller pdata. */
|
||||
socfpga_otg_data.regs_otg = addr;
|
||||
|
||||
return dwc2_udc_probe(&socfpga_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
@@ -129,9 +129,13 @@ struct socfpga_system_manager {
|
||||
#define SYSMGR_FPGAINTF_NAND (1 << 4)
|
||||
#define SYSMGR_FPGAINTF_SDMMC (1 << 5)
|
||||
|
||||
/* FIXME: This is questionable macro. */
|
||||
#define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel) \
|
||||
((((drvsel) << 0) & 0x7) | (((smplsel) << 3) & 0x38))
|
||||
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
||||
#define SYSMGR_SDMMC_SMPLSEL_SHIFT 3
|
||||
#else
|
||||
#define SYSMGR_SDMMC_SMPLSEL_SHIFT 4
|
||||
#endif
|
||||
|
||||
#define SYSMGR_SDMMC_DRVSEL_SHIFT 0
|
||||
|
||||
/* EMAC Group Bit definitions */
|
||||
#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0
|
||||
|
||||
@@ -33,7 +33,6 @@ config TARGET_ZYNQ_ZC770
|
||||
|
||||
config TARGET_ZYNQ_ZYBO
|
||||
bool "Zynq Zybo Board"
|
||||
select ZYNQ_CUSTOM_INIT
|
||||
|
||||
endchoice
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
## Build a couple of necessary functions into a private libgcc
|
||||
## if the user asked for it
|
||||
lib-$(CONFIG_USE_PRIVATE_LIBGCC) += lshrdi3.o muldi3.o ashldi3.o
|
||||
|
||||
obj-$(CONFIG_CMD_BOOTM) += bootm.o
|
||||
obj-y += cache.o
|
||||
obj-y += interrupts.o
|
||||
|
||||
50
arch/m68k/lib/ashldi3.c
Normal file
50
arch/m68k/lib/ashldi3.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* ashldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
|
||||
* gcc-2.7.2.3/longlong.h
|
||||
*
|
||||
* Copyright (C) 1989-2015 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct DIstruct s;
|
||||
DItype ll;
|
||||
} DIunion;
|
||||
|
||||
DItype __ashldi3 (DItype u, word_type b)
|
||||
{
|
||||
DIunion w;
|
||||
word_type bm;
|
||||
DIunion uu;
|
||||
|
||||
if (b == 0)
|
||||
return u;
|
||||
|
||||
uu.ll = u;
|
||||
|
||||
bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
|
||||
if (bm <= 0)
|
||||
{
|
||||
w.s.low = 0;
|
||||
w.s.high = (USItype)uu.s.low << -bm;
|
||||
}
|
||||
else
|
||||
{
|
||||
USItype carries = (USItype)uu.s.low >> bm;
|
||||
w.s.low = (USItype)uu.s.low << b;
|
||||
w.s.high = ((USItype)uu.s.high << b) | carries;
|
||||
}
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
50
arch/m68k/lib/lshrdi3.c
Normal file
50
arch/m68k/lib/lshrdi3.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* lshrdi3.c extracted from gcc-2.7.2.3/libgcc2.c and
|
||||
* gcc-2.7.2.3/longlong.h
|
||||
*
|
||||
* Copyright (C) 1989-2015 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#define BITS_PER_UNIT 8
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct DIstruct s;
|
||||
DItype ll;
|
||||
} DIunion;
|
||||
|
||||
DItype __lshrdi3 (DItype u, word_type b)
|
||||
{
|
||||
DIunion w;
|
||||
word_type bm;
|
||||
DIunion uu;
|
||||
|
||||
if (b == 0)
|
||||
return u;
|
||||
|
||||
uu.ll = u;
|
||||
|
||||
bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
|
||||
if (bm <= 0)
|
||||
{
|
||||
w.s.high = 0;
|
||||
w.s.low = (USItype)uu.s.high >> -bm;
|
||||
}
|
||||
else
|
||||
{
|
||||
USItype carries = (USItype)uu.s.high << bm;
|
||||
w.s.high = (USItype)uu.s.high >> b;
|
||||
w.s.low = ((USItype)uu.s.low >> b) | carries;
|
||||
}
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
71
arch/m68k/lib/muldi3.c
Normal file
71
arch/m68k/lib/muldi3.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
|
||||
* gcc-2.7.2.3/longlong.h
|
||||
*
|
||||
* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#define SI_TYPE_SIZE 32
|
||||
#define __BITS4 (SI_TYPE_SIZE / 4)
|
||||
#define __ll_B (1L << (SI_TYPE_SIZE / 2))
|
||||
#define __ll_lowpart(t) ((USItype) (t) % __ll_B)
|
||||
#define __ll_highpart(t) ((USItype) (t) / __ll_B)
|
||||
|
||||
#define umul_ppmm(w1, w0, u, v) \
|
||||
do { \
|
||||
USItype __x0, __x1, __x2, __x3; \
|
||||
USItype __ul, __vl, __uh, __vh; \
|
||||
\
|
||||
__ul = __ll_lowpart (u); \
|
||||
__uh = __ll_highpart (u); \
|
||||
__vl = __ll_lowpart (v); \
|
||||
__vh = __ll_highpart (v); \
|
||||
\
|
||||
__x0 = (USItype) __ul * __vl; \
|
||||
__x1 = (USItype) __ul * __vh; \
|
||||
__x2 = (USItype) __uh * __vl; \
|
||||
__x3 = (USItype) __uh * __vh; \
|
||||
\
|
||||
__x1 += __ll_highpart (__x0);/* this can't give carry */ \
|
||||
__x1 += __x2; /* but this indeed can */ \
|
||||
if (__x1 < __x2) /* did we get it? */ \
|
||||
__x3 += __ll_B; /* yes, add it in the proper pos. */ \
|
||||
\
|
||||
(w1) = __x3 + __ll_highpart (__x1); \
|
||||
(w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \
|
||||
} while (0)
|
||||
|
||||
#define __umulsidi3(u, v) \
|
||||
({DIunion __w; \
|
||||
umul_ppmm (__w.s.high, __w.s.low, u, v); \
|
||||
__w.ll; })
|
||||
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef int word_type __attribute__ ((mode (__word__)));
|
||||
|
||||
struct DIstruct {SItype high, low;};
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct DIstruct s;
|
||||
DItype ll;
|
||||
} DIunion;
|
||||
|
||||
DItype __muldi3 (DItype u, DItype v)
|
||||
{
|
||||
DIunion w;
|
||||
DIunion uu, vv;
|
||||
|
||||
uu.ll = u,
|
||||
vv.ll = v;
|
||||
|
||||
w.ll = __umulsidi3 (uu.s.low, vv.s.low);
|
||||
w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high
|
||||
+ (USItype) uu.s.high * (USItype) vv.s.low);
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
@@ -11,6 +11,8 @@ choice
|
||||
config TARGET_MICROBLAZE_GENERIC
|
||||
bool "Support microblaze-generic"
|
||||
select SUPPORT_SPL
|
||||
select OF_CONTROL
|
||||
select DM
|
||||
|
||||
endchoice
|
||||
|
||||
|
||||
@@ -21,6 +21,14 @@ int print_cpuinfo(void)
|
||||
}
|
||||
#endif /* CONFIG_DISPLAY_CPUINFO */
|
||||
|
||||
#ifdef CONFIG_ALTERA_SYSID
|
||||
int checkboard(void)
|
||||
{
|
||||
display_sysid();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
disable_interrupts();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/fsl_errata.h>
|
||||
#include <fsl_errata.h>
|
||||
#include <asm/processor.h>
|
||||
#include <fsl_usb.h>
|
||||
#include "fsl_corenet_serdes.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/fsl_errata.h>
|
||||
#include <fsl_errata.h>
|
||||
#include <asm/fsl_law.h>
|
||||
#include <asm/fsl_serdes.h>
|
||||
#include <asm/fsl_srio.h>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <asm/processor.h>
|
||||
#include <asm/fsl_law.h>
|
||||
#include <asm/errno.h>
|
||||
#include <asm/fsl_errata.h>
|
||||
#include <fsl_errata.h>
|
||||
#include "fsl_corenet2_serdes.h"
|
||||
|
||||
#ifdef CONFIG_SYS_FSL_SRDS_1
|
||||
@@ -184,7 +184,7 @@ void serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift,
|
||||
u32 cfg;
|
||||
int lane;
|
||||
|
||||
memset(serdes_prtcl_map, 0, sizeof(serdes_prtcl_map));
|
||||
memset(serdes_prtcl_map, 0, sizeof(u8) * SERDES_PRCTL_COUNT);
|
||||
#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
|
||||
struct ccsr_sfp_regs __iomem *sfp_regs =
|
||||
(struct ccsr_sfp_regs __iomem *)(CONFIG_SYS_SFP_ADDR);
|
||||
|
||||
@@ -807,6 +807,7 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
|
||||
#define MAX_QE_RISC 1
|
||||
#define QE_NUM_OF_SNUM 28
|
||||
#define CONFIG_SYS_FSL_SFP_VER_3_0
|
||||
#define CONFIG_SYS_FSL_ERRATUM_A008378
|
||||
|
||||
#elif defined(CONFIG_PPC_T1024) || defined(CONFIG_PPC_T1023) ||\
|
||||
defined(CONFIG_PPC_T1014) || defined(CONFIG_PPC_T1013)
|
||||
@@ -854,6 +855,7 @@ defined(CONFIG_PPC_T1014) || defined(CONFIG_PPC_T1013)
|
||||
#define MAX_QE_RISC 1
|
||||
#define QE_NUM_OF_SNUM 28
|
||||
#define CONFIG_SYS_FSL_SFP_VER_3_0
|
||||
#define CONFIG_SYS_FSL_ERRATUM_A008378
|
||||
|
||||
#elif defined(CONFIG_PPC_T2080) || defined(CONFIG_PPC_T2081)
|
||||
#define CONFIG_E6500
|
||||
|
||||
@@ -22,7 +22,6 @@ obj-$(CONFIG_INTEL_BAYTRAIL) += baytrail/
|
||||
obj-$(CONFIG_SYS_COREBOOT) += coreboot/
|
||||
obj-$(CONFIG_EFI_APP) += efi/
|
||||
obj-$(CONFIG_QEMU) += qemu/
|
||||
obj-$(CONFIG_NORTHBRIDGE_INTEL_SANDYBRIDGE) += ivybridge/
|
||||
obj-$(CONFIG_NORTHBRIDGE_INTEL_IVYBRIDGE) += ivybridge/
|
||||
obj-$(CONFIG_INTEL_QUARK) += quark/
|
||||
obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/
|
||||
|
||||
@@ -399,6 +399,11 @@ int x86_cpu_init_f(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_I8254_TIMER
|
||||
/* Set up the i8254 timer if required */
|
||||
i8254_init();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,44 +5,13 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
|
||||
config NORTHBRIDGE_INTEL_SANDYBRIDGE
|
||||
bool
|
||||
select CACHE_MRC_BIN
|
||||
select CPU_INTEL_MODEL_206AX
|
||||
|
||||
config NORTHBRIDGE_INTEL_IVYBRIDGE
|
||||
bool
|
||||
select CACHE_MRC_BIN
|
||||
select CPU_INTEL_MODEL_306AX
|
||||
|
||||
if NORTHBRIDGE_INTEL_SANDYBRIDGE
|
||||
|
||||
config VGA_BIOS_ID
|
||||
string
|
||||
default "8086,0106"
|
||||
|
||||
config CACHE_MRC_SIZE_KB
|
||||
int
|
||||
default 256
|
||||
|
||||
config DCACHE_RAM_BASE
|
||||
hex
|
||||
default 0xff7f0000
|
||||
|
||||
config DCACHE_RAM_SIZE
|
||||
hex
|
||||
default 0x10000
|
||||
|
||||
endif
|
||||
|
||||
if NORTHBRIDGE_INTEL_IVYBRIDGE
|
||||
|
||||
config VGA_BIOS_ID
|
||||
string
|
||||
default "8086,0166"
|
||||
|
||||
config EXTERNAL_MRC_BLOB
|
||||
config CACHE_MRC_BIN
|
||||
bool
|
||||
default n
|
||||
|
||||
@@ -58,10 +27,6 @@ config DCACHE_RAM_SIZE
|
||||
hex
|
||||
default 0x20000
|
||||
|
||||
endif
|
||||
|
||||
if NORTHBRIDGE_INTEL_SANDYBRIDGE || NORTHBRIDGE_INTEL_IVYBRIDGE
|
||||
|
||||
config HAVE_MRC
|
||||
bool "Add a System Agent binary"
|
||||
help
|
||||
@@ -80,25 +45,9 @@ config DCACHE_RAM_MRC_VAR_SIZE
|
||||
memory reference code. This should be set to 16KB (0x4000 hex)
|
||||
so that MRC has enough space to run.
|
||||
|
||||
config MRC_FILE
|
||||
string "Intel System Agent path and filename"
|
||||
depends on HAVE_MRC
|
||||
default "systemagent-ivybridge.bin" if NORTHBRIDGE_INTEL_IVYBRIDGE
|
||||
default "systemagent-sandybridge.bin" if NORTHBRIDGE_INTEL_SANDYBRIDGE
|
||||
help
|
||||
The path and filename of the file to use as System Agent
|
||||
binary.
|
||||
|
||||
config CPU_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select SMM_TSEG
|
||||
select ARCH_BOOTBLOCK_X86_32
|
||||
select ARCH_ROMSTAGE_X86_32
|
||||
select ARCH_RAMSTAGE_X86_32
|
||||
select SSE2
|
||||
select UDELAY_LAPIC
|
||||
select CPU_MICROCODE_IN_CBFS
|
||||
select TSC_SYNC_MFENCE
|
||||
select HAVE_INTEL_ME
|
||||
select X86_RAMTEST
|
||||
|
||||
@@ -124,20 +73,3 @@ config ENABLE_VMX
|
||||
slowly.
|
||||
|
||||
endif
|
||||
|
||||
config CPU_INTEL_SOCKET_RPGA989
|
||||
bool
|
||||
|
||||
if CPU_INTEL_SOCKET_RPGA989
|
||||
|
||||
config SOCKET_SPECIFIC_OPTIONS # dummy
|
||||
def_bool y
|
||||
select MMX
|
||||
select SSE
|
||||
select CACHE_AS_RAM
|
||||
|
||||
config CACHE_MRC_BIN
|
||||
bool
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
@@ -298,16 +298,7 @@ int print_cpuinfo(void)
|
||||
pm1_cnt = inl(DEFAULT_PMBASE + PM1_CNT);
|
||||
|
||||
if ((pm1_sts & WAK_STS) && ((pm1_cnt >> 10) & 7) == 5) {
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
debug("Resume from S3 detected.\n");
|
||||
boot_mode = PEI_BOOT_RESUME;
|
||||
/* Clear SLP_TYPE. This will break stage2 but
|
||||
* we care for that when we get there.
|
||||
*/
|
||||
outl(pm1_cnt & ~(7 << 10), DEFAULT_PMBASE + PM1_CNT);
|
||||
#else
|
||||
debug("Resume from S3 detected, but disabled.\n");
|
||||
#endif
|
||||
} else {
|
||||
/*
|
||||
* TODO: An indication of life might be possible here (e.g.
|
||||
|
||||
@@ -240,15 +240,6 @@ static void pch_rtc_init(pci_dev_t dev)
|
||||
}
|
||||
debug("rtc_failed = 0x%x\n", rtc_failed);
|
||||
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
/* Avoid clearing pending interrupts and resetting the RTC control
|
||||
* register in the resume path because the Linux kernel relies on
|
||||
* this to know if it should restart the RTC timerqueue if the wake
|
||||
* was due to the RTC alarm.
|
||||
*/
|
||||
if (acpi_get_slp_type() == 3)
|
||||
return;
|
||||
#endif
|
||||
/* TODO: Handle power failure */
|
||||
if (rtc_failed)
|
||||
printf("RTC power failed\n");
|
||||
|
||||
@@ -169,20 +169,4 @@ void northbridge_init(pci_dev_t dev)
|
||||
|
||||
void northbridge_enable(pci_dev_t dev)
|
||||
{
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
switch (x86_pci_read_config32(dev, SKPAD)) {
|
||||
case 0xcafebabe:
|
||||
debug("Normal boot.\n");
|
||||
apci_set_slp_type(0);
|
||||
break;
|
||||
case 0xcafed00d:
|
||||
debug("S3 Resume.\n");
|
||||
apci_set_slp_type(3);
|
||||
break;
|
||||
default:
|
||||
debug("Unknown boot method, assuming normal.\n");
|
||||
apci_set_slp_type(0);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
"pci8086,8811",
|
||||
"pciclass,070002",
|
||||
"pciclass,0700",
|
||||
"x86-uart";
|
||||
"ns16550";
|
||||
u-boot,dm-pre-reloc;
|
||||
reg = <0x00025100 0x0 0x0 0x0 0x0
|
||||
0x01025110 0x0 0x0 0x0 0x0>;
|
||||
@@ -131,7 +131,7 @@
|
||||
"pci8086,8812",
|
||||
"pciclass,070002",
|
||||
"pciclass,0700",
|
||||
"x86-uart";
|
||||
"ns16550";
|
||||
u-boot,dm-pre-reloc;
|
||||
reg = <0x00025200 0x0 0x0 0x0 0x0
|
||||
0x01025210 0x0 0x0 0x0 0x0>;
|
||||
@@ -145,7 +145,7 @@
|
||||
"pci8086,8813",
|
||||
"pciclass,070002",
|
||||
"pciclass,0700",
|
||||
"x86-uart";
|
||||
"ns16550";
|
||||
u-boot,dm-pre-reloc;
|
||||
reg = <0x00025300 0x0 0x0 0x0 0x0
|
||||
0x01025310 0x0 0x0 0x0 0x0>;
|
||||
@@ -159,7 +159,7 @@
|
||||
"pci8086,8814",
|
||||
"pciclass,070002",
|
||||
"pciclass,0700",
|
||||
"x86-uart";
|
||||
"ns16550";
|
||||
u-boot,dm-pre-reloc;
|
||||
reg = <0x00025400 0x0 0x0 0x0 0x0
|
||||
0x01025410 0x0 0x0 0x0 0x0>;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
"pci8086,0936",
|
||||
"pciclass,070002",
|
||||
"pciclass,0700",
|
||||
"x86-uart";
|
||||
"ns16550";
|
||||
u-boot,dm-pre-reloc;
|
||||
reg = <0x0000a500 0x0 0x0 0x0 0x0
|
||||
0x0200a510 0x0 0x0 0x0 0x0>;
|
||||
|
||||
@@ -3,83 +3,4 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/reset_manager.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/s3c_udc.h>
|
||||
#include <usb_mass_storage.h>
|
||||
|
||||
#include <micrel.h>
|
||||
#include <netdev.h>
|
||||
#include <phy.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void s_init(void) {}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters for ATAG (if ATAG is used) */
|
||||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* PHY configuration
|
||||
*/
|
||||
#ifdef CONFIG_PHY_MICREL_KSZ9021
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
/*
|
||||
* These skew settings for the KSZ9021 ethernet phy is required for ethernet
|
||||
* to work reliably on most flavors of cyclone5 boards.
|
||||
*/
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_CLOCK_SKEW,
|
||||
0xf0f0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (phydev->drv->config)
|
||||
return phydev->drv->config(phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
struct s3c_plat_otg_data socfpga_otg_data = {
|
||||
.regs_otg = CONFIG_USB_DWC2_REG_ADDR,
|
||||
.usb_gusbcfg = 0x1417,
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return s3c_udc_probe(&socfpga_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,83 +3,4 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/reset_manager.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/s3c_udc.h>
|
||||
#include <usb_mass_storage.h>
|
||||
|
||||
#include <micrel.h>
|
||||
#include <netdev.h>
|
||||
#include <phy.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void s_init(void) {}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters for ATAG (if ATAG is used) */
|
||||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* PHY configuration
|
||||
*/
|
||||
#ifdef CONFIG_PHY_MICREL_KSZ9021
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
/*
|
||||
* These skew settings for the KSZ9021 ethernet phy is required for ethernet
|
||||
* to work reliably on most flavors of cyclone5 boards.
|
||||
*/
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_CLOCK_SKEW,
|
||||
0xf0f0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (phydev->drv->config)
|
||||
return phydev->drv->config(phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
struct s3c_plat_otg_data socfpga_otg_data = {
|
||||
.regs_otg = CONFIG_USB_DWC2_REG_ADDR,
|
||||
.usb_gusbcfg = 0x1417,
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return s3c_udc_probe(&socfpga_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <asm/arch/sysmap.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/s3c_udc.h>
|
||||
#include <usb/dwc2_udc.h>
|
||||
#include <g_dnl.h>
|
||||
|
||||
#define SECWATCHDOG_SDOGCR_OFFSET 0x00000000
|
||||
@@ -95,14 +95,14 @@ int board_mmc_init(bd_t *bis)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
static struct s3c_plat_otg_data bcm_otg_data = {
|
||||
static struct dwc2_plat_otg_data bcm_otg_data = {
|
||||
.regs_otg = HSOTG_BASE_ADDR
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
debug("%s: performing s3c_udc_probe\n", __func__);
|
||||
return s3c_udc_probe(&bcm_otg_data);
|
||||
debug("%s: performing dwc2_udc_probe\n", __func__);
|
||||
return dwc2_udc_probe(&bcm_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
|
||||
|
||||
@@ -3,43 +3,4 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/reset_manager.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/s3c_udc.h>
|
||||
#include <usb_mass_storage.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void s_init(void) {}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters for ATAG (if ATAG is used) */
|
||||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
struct s3c_plat_otg_data socfpga_otg_data = {
|
||||
.regs_otg = CONFIG_USB_DWC2_REG_ADDR,
|
||||
.usb_gusbcfg = 0x1417,
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return s3c_udc_probe(&socfpga_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,83 +3,4 @@
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/reset_manager.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include <usb.h>
|
||||
#include <usb/s3c_udc.h>
|
||||
#include <usb_mass_storage.h>
|
||||
|
||||
#include <micrel.h>
|
||||
#include <netdev.h>
|
||||
#include <phy.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
void s_init(void) {}
|
||||
|
||||
/*
|
||||
* Miscellaneous platform dependent initialisations
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
/* Address of boot parameters for ATAG (if ATAG is used) */
|
||||
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* PHY configuration
|
||||
*/
|
||||
#ifdef CONFIG_PHY_MICREL_KSZ9021
|
||||
int board_phy_config(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
/*
|
||||
* These skew settings for the KSZ9021 ethernet phy is required for ethernet
|
||||
* to work reliably on most flavors of cyclone5 boards.
|
||||
*/
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW,
|
||||
0x0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ksz9021_phy_extended_write(phydev,
|
||||
MII_KSZ9021_EXT_RGMII_CLOCK_SKEW,
|
||||
0xf0f0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (phydev->drv->config)
|
||||
return phydev->drv->config(phydev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_GADGET
|
||||
struct s3c_plat_otg_data socfpga_otg_data = {
|
||||
.regs_otg = CONFIG_USB_DWC2_REG_ADDR,
|
||||
.usb_gusbcfg = 0x1417,
|
||||
};
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return s3c_udc_probe(&socfpga_otg_data);
|
||||
}
|
||||
|
||||
int g_dnl_board_usb_cable_connected(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -52,6 +52,8 @@ int fdt_set_phy_handle(void *fdt, char *compat, phys_addr_t addr,
|
||||
if (!ph)
|
||||
return -FDT_ERR_BADPHANDLE;
|
||||
|
||||
ph = cpu_to_fdt32(ph);
|
||||
|
||||
offset = fdt_node_offset_by_compat_reg(fdt, compat, addr);
|
||||
if (offset < 0)
|
||||
return offset;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <u-boot/rsa-mod-exp.h>
|
||||
#include <hash.h>
|
||||
#include <fsl_secboot_err.h>
|
||||
#ifndef CONFIG_MPC85xx
|
||||
#ifdef CONFIG_LS102XA
|
||||
#include <asm/arch/immap_ls102xa.h>
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,8 @@ int get_csf_base_addr(u32 *csf_addr, u32 *flash_base_addr)
|
||||
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
|
||||
u32 csf_hdr_addr = in_be32(&gur->scratchrw[0]);
|
||||
|
||||
if (memcmp((u8 *)csf_hdr_addr, barker_code, ESBC_BARKER_LEN))
|
||||
if (memcmp((u8 *)(uintptr_t)csf_hdr_addr,
|
||||
barker_code, ESBC_BARKER_LEN))
|
||||
return -1;
|
||||
|
||||
*csf_addr = csf_hdr_addr;
|
||||
@@ -117,7 +118,7 @@ static int get_ie_info_addr(u32 *ie_addr)
|
||||
if (get_csf_base_addr(&csf_addr, &flash_base_addr))
|
||||
return -1;
|
||||
|
||||
hdr = (struct fsl_secboot_img_hdr *)csf_addr;
|
||||
hdr = (struct fsl_secboot_img_hdr *)(uintptr_t)csf_addr;
|
||||
|
||||
/* For SoC's with Trust Architecture v1 with corenet bus
|
||||
* the sg table field in CSF header has absolute address
|
||||
@@ -130,7 +131,7 @@ static int get_ie_info_addr(u32 *ie_addr)
|
||||
(((u32)hdr->psgtable & ~(CONFIG_SYS_PBI_FLASH_BASE)) +
|
||||
flash_base_addr);
|
||||
#else
|
||||
sg_tbl = (struct fsl_secboot_sg_table *)(csf_addr +
|
||||
sg_tbl = (struct fsl_secboot_sg_table *)(uintptr_t)(csf_addr +
|
||||
(u32)hdr->psgtable);
|
||||
#endif
|
||||
|
||||
@@ -379,8 +380,8 @@ static int calc_img_key_hash(struct fsl_secboot_img_priv *img)
|
||||
#ifdef CONFIG_KEY_REVOCATION
|
||||
if (check_srk(img)) {
|
||||
ret = algo->hash_update(algo, ctx,
|
||||
(u8 *)(img->ehdrloc + img->hdr.srk_tbl_off),
|
||||
img->hdr.len_kr.num_srk * sizeof(struct srk_table), 1);
|
||||
(u8 *)(uintptr_t)(img->ehdrloc + img->hdr.srk_tbl_off),
|
||||
img->hdr.len_kr.num_srk * sizeof(struct srk_table), 1);
|
||||
srk = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -438,8 +439,8 @@ static int calc_esbchdr_esbc_hash(struct fsl_secboot_img_priv *img)
|
||||
#ifdef CONFIG_KEY_REVOCATION
|
||||
if (check_srk(img)) {
|
||||
ret = algo->hash_update(algo, ctx,
|
||||
(u8 *)(img->ehdrloc + img->hdr.srk_tbl_off),
|
||||
img->hdr.len_kr.num_srk * sizeof(struct srk_table), 0);
|
||||
(u8 *)(uintptr_t)(img->ehdrloc + img->hdr.srk_tbl_off),
|
||||
img->hdr.len_kr.num_srk * sizeof(struct srk_table), 0);
|
||||
key_hash = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -454,8 +455,13 @@ static int calc_esbchdr_esbc_hash(struct fsl_secboot_img_priv *img)
|
||||
return ret;
|
||||
|
||||
/* Update hash for actual Image */
|
||||
#ifdef CONFIG_ESBC_ADDR_64BIT
|
||||
ret = algo->hash_update(algo, ctx,
|
||||
(u8 *)img->hdr.pimg, img->hdr.img_size, 1);
|
||||
(u8 *)(uintptr_t)img->hdr.pimg64, img->hdr.img_size, 1);
|
||||
#else
|
||||
ret = algo->hash_update(algo, ctx,
|
||||
(u8 *)(uintptr_t)img->hdr.pimg, img->hdr.img_size, 1);
|
||||
#endif
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -533,7 +539,7 @@ static int read_validate_esbc_client_header(struct fsl_secboot_img_priv *img)
|
||||
{
|
||||
char buf[20];
|
||||
struct fsl_secboot_img_hdr *hdr = &img->hdr;
|
||||
void *esbc = (u8 *)img->ehdrloc;
|
||||
void *esbc = (u8 *)(uintptr_t)img->ehdrloc;
|
||||
u8 *k, *s;
|
||||
#ifdef CONFIG_KEY_REVOCATION
|
||||
u32 ret;
|
||||
@@ -549,7 +555,11 @@ static int read_validate_esbc_client_header(struct fsl_secboot_img_priv *img)
|
||||
if (memcmp(hdr->barker, barker_code, ESBC_BARKER_LEN))
|
||||
return ERROR_ESBC_CLIENT_HEADER_BARKER;
|
||||
|
||||
#ifdef CONFIG_ESBC_ADDR_64BIT
|
||||
sprintf(buf, "%llx", hdr->pimg64);
|
||||
#else
|
||||
sprintf(buf, "%x", hdr->pimg);
|
||||
#endif
|
||||
setenv("img_addr", buf);
|
||||
|
||||
if (!hdr->img_size)
|
||||
@@ -594,7 +604,7 @@ static int read_validate_esbc_client_header(struct fsl_secboot_img_priv *img)
|
||||
if (!key_found && check_ie(img)) {
|
||||
if (get_ie_info_addr(&img->ie_addr))
|
||||
return ERROR_IE_TABLE_NOT_FOUND;
|
||||
ie_info = (struct ie_key_info *)img->ie_addr;
|
||||
ie_info = (struct ie_key_info *)(uintptr_t)img->ie_addr;
|
||||
if (ie_info->num_keys == 0 || ie_info->num_keys > 32)
|
||||
return ERROR_ESBC_CLIENT_HEADER_INVALID_IE_NUM_ENTRY;
|
||||
|
||||
@@ -748,7 +758,7 @@ int fsl_secboot_validate(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
|
||||
hdr = &img->hdr;
|
||||
img->ehdrloc = addr;
|
||||
esbc = (u8 *)img->ehdrloc;
|
||||
esbc = (u8 *)(uintptr_t)img->ehdrloc;
|
||||
|
||||
memcpy(hdr, esbc, sizeof(struct fsl_secboot_img_hdr));
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/fsl_serdes.h>
|
||||
#include <asm/arch/ls102xa_stream_id.h>
|
||||
#include <asm/arch/ls102xa_soc.h>
|
||||
#include <asm/arch/ls102xa_devdis.h>
|
||||
#include <asm/arch/ls102xa_sata.h>
|
||||
#include <hwconfig.h>
|
||||
@@ -140,17 +141,6 @@ unsigned long get_board_ddr_clk(void)
|
||||
return 66666666;
|
||||
}
|
||||
|
||||
unsigned int get_soc_major_rev(void)
|
||||
{
|
||||
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
|
||||
unsigned int svr, major;
|
||||
|
||||
svr = in_be32(&gur->svr);
|
||||
major = SVR_MAJ(svr);
|
||||
|
||||
return major;
|
||||
}
|
||||
|
||||
int select_i2c_ch_pca9547(u8 ch)
|
||||
{
|
||||
int ret;
|
||||
@@ -193,8 +183,6 @@ int board_mmc_init(bd_t *bis)
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
|
||||
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
|
||||
unsigned int major;
|
||||
|
||||
#ifdef CONFIG_TSEC_ENET
|
||||
/* clear BD & FR bits for BE BD's and frame data */
|
||||
@@ -205,40 +193,7 @@ int board_early_init_f(void)
|
||||
init_early_memctl_regs();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FSL_QSPI
|
||||
out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FSL_DCU_FB
|
||||
out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN);
|
||||
#endif
|
||||
|
||||
/* Configure Little endian for SAI, ASRC and SPDIF */
|
||||
out_be32(&scfg->endiancr, SCFG_ENDIANCR_LE);
|
||||
|
||||
/*
|
||||
* Enable snoop requests and DVM message requests for
|
||||
* Slave insterface S4 (A7 core cluster)
|
||||
*/
|
||||
out_le32(&cci->slave[4].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
|
||||
major = get_soc_major_rev();
|
||||
if (major == SOC_MAJOR_VER_1_0) {
|
||||
/*
|
||||
* Set CCI-400 Slave interface S1, S2 Shareable Override
|
||||
* Register All transactions are treated as non-shareable
|
||||
*/
|
||||
out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
|
||||
/* Workaround for the issue that DDR could not respond to
|
||||
* barrier transaction which is generated by executing DSB/ISB
|
||||
* instruction. Set CCI-400 control override register to
|
||||
* terminate the barrier transaction. After DDR is initialized,
|
||||
* allow barrier transaction to DDR again */
|
||||
out_le32(&cci->ctrl_ord, CCI400_CTRLORD_TERM_BARRIER);
|
||||
}
|
||||
arch_soc_init();
|
||||
|
||||
#if defined(CONFIG_DEEP_SLEEP)
|
||||
if (is_warm_boot())
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <asm/arch/fsl_serdes.h>
|
||||
#include <asm/arch/ls102xa_stream_id.h>
|
||||
#include <asm/arch/ls102xa_devdis.h>
|
||||
#include <asm/arch/ls102xa_soc.h>
|
||||
#include <asm/arch/ls102xa_sata.h>
|
||||
#include <hwconfig.h>
|
||||
#include <mmc.h>
|
||||
@@ -138,17 +139,6 @@ int checkboard(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int get_soc_major_rev(void)
|
||||
{
|
||||
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
|
||||
unsigned int svr, major;
|
||||
|
||||
svr = in_be32(&gur->svr);
|
||||
major = SVR_MAJ(svr);
|
||||
|
||||
return major;
|
||||
}
|
||||
|
||||
void ddrmc_init(void)
|
||||
{
|
||||
struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR;
|
||||
@@ -394,8 +384,6 @@ conflict:
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
|
||||
struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
|
||||
unsigned int major;
|
||||
|
||||
#ifdef CONFIG_TSEC_ENET
|
||||
/* clear BD & FR bits for BE BD's and frame data */
|
||||
@@ -407,33 +395,7 @@ int board_early_init_f(void)
|
||||
init_early_memctl_regs();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FSL_DCU_FB
|
||||
out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FSL_QSPI
|
||||
out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
|
||||
#endif
|
||||
|
||||
/* Configure Little endian for SAI, ASRC and SPDIF */
|
||||
out_be32(&scfg->endiancr, SCFG_ENDIANCR_LE);
|
||||
|
||||
/*
|
||||
* Enable snoop requests and DVM message requests for
|
||||
* Slave insterface S4 (A7 core cluster)
|
||||
*/
|
||||
out_le32(&cci->slave[4].snoop_ctrl,
|
||||
CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
|
||||
|
||||
major = get_soc_major_rev();
|
||||
if (major == SOC_MAJOR_VER_1_0) {
|
||||
/*
|
||||
* Set CCI-400 Slave interface S1, S2 Shareable Override
|
||||
* Register All transactions are treated as non-shareable
|
||||
*/
|
||||
out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
|
||||
}
|
||||
arch_soc_init();
|
||||
|
||||
#if defined(CONFIG_DEEP_SLEEP)
|
||||
if (is_warm_boot()) {
|
||||
|
||||
@@ -126,6 +126,15 @@ phys_size_t initdram(int board_type)
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
/*
|
||||
* gd->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;
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#PBL preamble and RCW header
|
||||
aa55aa55 01ee0100
|
||||
# serdes protocol
|
||||
0810000f 0c000000 00000000 00000000
|
||||
14550002 80004012 e0106000 61002000
|
||||
08100010 0a000000 00000000 00000000
|
||||
14550002 80004012 e0106000 c1002000
|
||||
00000000 00000000 00000000 00038800
|
||||
00000000 00001100 00000096 00000001
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
aa55aa55 01ee0100
|
||||
# RCW
|
||||
# Enable IFC; disable QSPI
|
||||
0810000f 0c000000 00000000 00000000
|
||||
14550002 80004012 60040000 61002000
|
||||
08100010 0a000000 00000000 00000000
|
||||
14550002 80004012 60040000 c1002000
|
||||
00000000 00000000 00000000 00038800
|
||||
00000000 00001100 00000096 00000001
|
||||
|
||||
@@ -7,3 +7,8 @@ F: include/configs/ls1043ardb.h
|
||||
F: configs/ls1043ardb_defconfig
|
||||
F: configs/ls1043ardb_nand_defconfig
|
||||
F: configs/ls1043ardb_sdcard_defconfig
|
||||
|
||||
LS1043A_SECURE_BOOT BOARD
|
||||
M: Aneesh Bansal <aneesh.bansal@freescale.com>
|
||||
S: Maintained
|
||||
F: configs/ls1043ardb_SECURE_BOOT_defconfig
|
||||
|
||||
@@ -186,6 +186,28 @@ phys_size_t initdram(int board_type)
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
/*
|
||||
* gd->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;
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
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->secure_ram = gd->bd->bi_dram[1].start +
|
||||
gd->secure_ram -
|
||||
CONFIG_SYS_DDR_BLOCK1_SIZE;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
} else {
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include <fsl_csu.h>
|
||||
#include <fsl_esdhc.h>
|
||||
#include <fsl_ifc.h>
|
||||
#include <environment.h>
|
||||
#include <fsl_sec.h>
|
||||
#include "cpld.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -123,13 +125,37 @@ 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
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#PBL preamble and RCW header
|
||||
aa55aa55 01ee0100
|
||||
# serdes protocol
|
||||
0810000f 0c000000 00000000 00000000
|
||||
14550002 80004012 e0106000 61002000
|
||||
08100010 0a000000 00000000 00000000
|
||||
14550002 80004012 e0106000 c1002000
|
||||
00000000 00000000 00000000 00038800
|
||||
00000000 00001100 00000096 00000001
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#PBL preamble and RCW header
|
||||
aa55aa55 01ee0100
|
||||
# RCW
|
||||
0810000f 0c000000 00000000 00000000
|
||||
14550002 80004012 60040000 61002000
|
||||
08100010 0a000000 00000000 00000000
|
||||
14550002 80004012 60040000 c1002000
|
||||
00000000 00000000 00000000 00038800
|
||||
00000000 00001100 00000096 00000001
|
||||
|
||||
@@ -175,14 +175,29 @@ void dram_init_banksize(void)
|
||||
phys_size_t dp_ddr_size;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gd->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_LS2_DDR_BLOCK1_SIZE) {
|
||||
gd->bd->bi_dram[0].size = CONFIG_SYS_LS2_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_LS2_DDR_BLOCK1_SIZE;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[1].start +
|
||||
gd->secure_ram -
|
||||
CONFIG_SYS_LS2_DDR_BLOCK1_SIZE;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
} else {
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYS_DP_DDR_BASE_PHY
|
||||
|
||||
@@ -68,23 +68,6 @@ int arch_misc_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned long get_dram_size_to_hide(void)
|
||||
{
|
||||
unsigned long dram_to_hide = 0;
|
||||
|
||||
/* Carve the Debug Server private DRAM block from the end of DRAM */
|
||||
#ifdef CONFIG_FSL_DEBUG_SERVER
|
||||
dram_to_hide += debug_server_get_dram_block_size();
|
||||
#endif
|
||||
|
||||
/* Carve the MC private DRAM block from the end of DRAM */
|
||||
#ifdef CONFIG_FSL_MC_ENET
|
||||
dram_to_hide += mc_get_dram_block_size();
|
||||
#endif
|
||||
|
||||
return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN);
|
||||
}
|
||||
|
||||
int board_eth_init(bd_t *bis)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
@@ -134,10 +134,18 @@ found:
|
||||
popts->zq_en = 1;
|
||||
|
||||
if (ddr_freq < 2350) {
|
||||
popts->ddr_cdr1 = DDR_CDR1_DHC_EN |
|
||||
DDR_CDR1_ODT(DDR_CDR_ODT_60ohm);
|
||||
popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_60ohm) |
|
||||
DDR_CDR2_VREF_RANGE_2;
|
||||
if (pdimm[0].n_ranks == 2 && pdimm[1].n_ranks == 2) {
|
||||
/* four chip-selects */
|
||||
popts->ddr_cdr1 = DDR_CDR1_DHC_EN |
|
||||
DDR_CDR1_ODT(DDR_CDR_ODT_80ohm);
|
||||
popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_80ohm);
|
||||
popts->twot_en = 1; /* enable 2T timing */
|
||||
} else {
|
||||
popts->ddr_cdr1 = DDR_CDR1_DHC_EN |
|
||||
DDR_CDR1_ODT(DDR_CDR_ODT_60ohm);
|
||||
popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_60ohm) |
|
||||
DDR_CDR2_VREF_RANGE_2;
|
||||
}
|
||||
} else {
|
||||
popts->ddr_cdr1 = DDR_CDR1_DHC_EN |
|
||||
DDR_CDR1_ODT(DDR_CDR_ODT_100ohm);
|
||||
@@ -167,14 +175,29 @@ void dram_init_banksize(void)
|
||||
phys_size_t dp_ddr_size;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gd->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_LS2_DDR_BLOCK1_SIZE) {
|
||||
gd->bd->bi_dram[0].size = CONFIG_SYS_LS2_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_LS2_DDR_BLOCK1_SIZE;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[1].start +
|
||||
gd->secure_ram -
|
||||
CONFIG_SYS_LS2_DDR_BLOCK1_SIZE;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
} else {
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
|
||||
gd->secure_ram = gd->bd->bi_dram[0].start + gd->secure_ram;
|
||||
gd->secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SYS_DP_DDR_BASE_PHY
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user