mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-09 21:26:42 +03:00
Compare commits
171 Commits
v2014.10-r
...
v2014.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c43fd23cf6 | ||
|
|
74bf7961a0 | ||
|
|
c7ad5cbb1e | ||
|
|
e89d623f09 | ||
|
|
3d420cbd35 | ||
|
|
790af81543 | ||
|
|
5a1d0ad3ee | ||
|
|
d8540a1619 | ||
|
|
ed8271d11c | ||
|
|
d0b3723034 | ||
|
|
b2868187f4 | ||
|
|
b719a08863 | ||
|
|
476095772f | ||
|
|
4a74298c54 | ||
|
|
a79c911f35 | ||
|
|
f6c7c75482 | ||
|
|
db67801bf9 | ||
|
|
787011834e | ||
|
|
ae1a74ebe7 | ||
|
|
207828e215 | ||
|
|
703a08f2b3 | ||
|
|
16c429c9ea | ||
|
|
fbad4641fb | ||
|
|
cf7d4505e3 | ||
|
|
6c4c9a7c0f | ||
|
|
13bd4d8776 | ||
|
|
d3b88405e5 | ||
|
|
3f2b5bb674 | ||
|
|
2ea9103924 | ||
|
|
04e2a13336 | ||
|
|
af55e35d33 | ||
|
|
e7a565638a | ||
|
|
9ed3246e19 | ||
|
|
1521cdc530 | ||
|
|
dc9617e0ce | ||
|
|
717a23b871 | ||
|
|
026330af41 | ||
|
|
76300c0d2d | ||
|
|
d59baeb76f | ||
|
|
3160b1b986 | ||
|
|
02590aa31c | ||
|
|
115e71f7da | ||
|
|
fef3e25fc3 | ||
|
|
64a0c24726 | ||
|
|
ebf8644a11 | ||
|
|
ed3c980bee | ||
|
|
05968e7cfd | ||
|
|
7d2f669b94 | ||
|
|
88982893c4 | ||
|
|
237faf095f | ||
|
|
7d83580364 | ||
|
|
f212a8abf3 | ||
|
|
9f1c3beada | ||
|
|
96c434b17d | ||
|
|
4c216f556c | ||
|
|
83335bdc0c | ||
|
|
cc45a610b6 | ||
|
|
c252d64bdd | ||
|
|
c33e4f1182 | ||
|
|
4b19b7448e | ||
|
|
f885b84968 | ||
|
|
b219773957 | ||
|
|
de8f7705aa | ||
|
|
dab067c323 | ||
|
|
2ecd779742 | ||
|
|
93327f6976 | ||
|
|
311757be27 | ||
|
|
1d55110003 | ||
|
|
f94de733df | ||
|
|
7d15953619 | ||
|
|
87033d4d97 | ||
|
|
5ea01ab10d | ||
|
|
4c7bb1d2e0 | ||
|
|
f0d80fbcd7 | ||
|
|
98149d72f3 | ||
|
|
5b9c8cb6cb | ||
|
|
2c94611d5f | ||
|
|
83d937803a | ||
|
|
e4d761000a | ||
|
|
dd0204e48d | ||
|
|
c19a8bc571 | ||
|
|
3cc83f9d08 | ||
|
|
64f41212d8 | ||
|
|
1454ba8e56 | ||
|
|
5e3a388cdd | ||
|
|
e9feee6370 | ||
|
|
c0e7bd6661 | ||
|
|
54950e8215 | ||
|
|
3f5d964ea0 | ||
|
|
5dbdc3cf3c | ||
|
|
d3d70e6f9b | ||
|
|
c36c000828 | ||
|
|
8d97b3ad95 | ||
|
|
8145ccc3be | ||
|
|
43a3431c26 | ||
|
|
5b7103e0af | ||
|
|
84e2dc0c89 | ||
|
|
ce9507b793 | ||
|
|
c745de7174 | ||
|
|
865aa30bb3 | ||
|
|
135663061f | ||
|
|
04edda266d | ||
|
|
d6949e3f9d | ||
|
|
4adc1127f8 | ||
|
|
443d4d15d7 | ||
|
|
4328fb05bf | ||
|
|
84caf0b26b | ||
|
|
adc4a2bd03 | ||
|
|
9fc425278b | ||
|
|
693cccf412 | ||
|
|
a3b527a947 | ||
|
|
41612472b6 | ||
|
|
213e9e3348 | ||
|
|
c9c86bde3d | ||
|
|
39d0973300 | ||
|
|
252499e603 | ||
|
|
46f8a4b7e6 | ||
|
|
ba743ac5c1 | ||
|
|
fb6f86c411 | ||
|
|
45e60c25b5 | ||
|
|
6dd0e7c00b | ||
|
|
0fb63aa63c | ||
|
|
66cba041fe | ||
|
|
5894ca007d | ||
|
|
7f368553fc | ||
|
|
845034e6b2 | ||
|
|
4b0abf9f3c | ||
|
|
8ca21cbea2 | ||
|
|
1e3d640316 | ||
|
|
65ae9523d9 | ||
|
|
0f88a5a98e | ||
|
|
4dfb0e4d3e | ||
|
|
9f87640c03 | ||
|
|
1dd42e313b | ||
|
|
13bc86037e | ||
|
|
661139faf7 | ||
|
|
b357503f1c | ||
|
|
febae49a2b | ||
|
|
fc532a921a | ||
|
|
14b256e5c0 | ||
|
|
4ba9b1c2e3 | ||
|
|
5546ad0734 | ||
|
|
9293d7fd50 | ||
|
|
adca1875c8 | ||
|
|
e7380a1fdc | ||
|
|
1fb065feae | ||
|
|
ca11db2603 | ||
|
|
7c604e98c2 | ||
|
|
be0ecdbed5 | ||
|
|
dd24b57bb7 | ||
|
|
36c1ca4d46 | ||
|
|
4f797c4c1c | ||
|
|
3098ef429c | ||
|
|
7972913512 | ||
|
|
05d1c24517 | ||
|
|
42817eb85d | ||
|
|
7a56bddd7f | ||
|
|
9992792be0 | ||
|
|
e425436ca8 | ||
|
|
0fdfafd225 | ||
|
|
d4940fc521 | ||
|
|
067a659317 | ||
|
|
bcaa075a63 | ||
|
|
08129d618c | ||
|
|
95083b3a08 | ||
|
|
152adee1b6 | ||
|
|
d6d07a9bec | ||
|
|
72d7beabf7 | ||
|
|
816264fc66 | ||
|
|
93a0ea501e | ||
|
|
bd99e6d0e4 |
16
MAINTAINERS
16
MAINTAINERS
@@ -65,6 +65,13 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-arm.git
|
||||
F: arch/arm/
|
||||
|
||||
ARM ALTERA SOCFPGA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
S: Maintainted
|
||||
T: git git://git.denx.de/u-boot-socfpga.git
|
||||
F: arch/arm/cpu/armv7/socfpga/
|
||||
F: board/altera/socfpga/
|
||||
|
||||
ARM ATMEL AT91
|
||||
M: Andreas Bießmann <andreas.devel@googlemail.com>
|
||||
S: Maintained
|
||||
@@ -149,6 +156,15 @@ F: arch/arm/include/asm/arch-davinci/
|
||||
F: arch/arm/include/asm/arch-omap*/
|
||||
F: arch/arm/include/asm/ti-common/
|
||||
|
||||
ARM UNIPHIER
|
||||
M: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-uniphier.git
|
||||
F: arch/arm/cpu/armv7/uniphier/
|
||||
F: arch/arm/include/asm/arch-uniphier/
|
||||
F: configs/ph1_*_defconfig
|
||||
F: drivers/serial/serial_uniphier.c
|
||||
|
||||
ARM ZYNQ
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
|
||||
4
Makefile
4
Makefile
@@ -8,7 +8,7 @@
|
||||
VERSION = 2014
|
||||
PATCHLEVEL = 10
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION = -rc3
|
||||
EXTRAVERSION =
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
@@ -411,7 +411,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
|
||||
|
||||
no-dot-config-targets := clean clobber mrproper distclean \
|
||||
help %docs check% coccicheck \
|
||||
ubootversion backup tools-only
|
||||
ubootversion backup
|
||||
|
||||
config-targets := 0
|
||||
mixed-targets := 0
|
||||
|
||||
@@ -336,6 +336,9 @@ config TARGET_BCM958622HR
|
||||
config ARCH_EXYNOS
|
||||
bool "Samsung EXYNOS"
|
||||
|
||||
config ARCH_S5PC1XX
|
||||
bool "Samsung S5PC1XX"
|
||||
|
||||
config ARCH_HIGHBANK
|
||||
bool "Calxeda Highbank"
|
||||
|
||||
@@ -414,6 +417,9 @@ config TARGET_HUMMINGBOARD
|
||||
config TARGET_TQMA6
|
||||
bool "TQ Systems TQMa6 board"
|
||||
|
||||
config TARGET_OT1200
|
||||
bool "Bachmann OT1200"
|
||||
|
||||
config OMAP34XX
|
||||
bool "OMAP34XX SoC"
|
||||
|
||||
@@ -429,12 +435,6 @@ config RMOBILE
|
||||
config TARGET_CM_FX6
|
||||
bool "Support cm_fx6"
|
||||
|
||||
config TARGET_S5P_GONI
|
||||
bool "Support s5p_goni"
|
||||
|
||||
config TARGET_SMDKC100
|
||||
bool "Support smdkc100"
|
||||
|
||||
config TARGET_SOCFPGA_CYCLONE5
|
||||
bool "Support socfpga_cyclone5"
|
||||
|
||||
@@ -521,6 +521,9 @@ config TARGET_COLIBRI_PXA270
|
||||
config TARGET_JORNADA
|
||||
bool "Support jornada"
|
||||
|
||||
config ARCH_UNIPHIER
|
||||
bool "Panasonic UniPhier platform"
|
||||
|
||||
endchoice
|
||||
|
||||
source "arch/arm/cpu/armv8/Kconfig"
|
||||
@@ -547,8 +550,12 @@ source "arch/arm/cpu/arm926ejs/orion5x/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/rmobile/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/s5pc1xx/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/tegra-common/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/uniphier/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/versatile/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/zynq/Kconfig"
|
||||
@@ -578,6 +585,7 @@ source "board/atmel/at91sam9rlek/Kconfig"
|
||||
source "board/atmel/at91sam9x5ek/Kconfig"
|
||||
source "board/atmel/sama5d3_xplained/Kconfig"
|
||||
source "board/atmel/sama5d3xek/Kconfig"
|
||||
source "board/bachmann/ot1200/Kconfig"
|
||||
source "board/balloon3/Kconfig"
|
||||
source "board/barco/titanium/Kconfig"
|
||||
source "board/bluegiga/apx4devkit/Kconfig"
|
||||
@@ -652,9 +660,7 @@ source "board/raspberrypi/rpi_b/Kconfig"
|
||||
source "board/ronetix/pm9261/Kconfig"
|
||||
source "board/ronetix/pm9263/Kconfig"
|
||||
source "board/ronetix/pm9g45/Kconfig"
|
||||
source "board/samsung/goni/Kconfig"
|
||||
source "board/samsung/smdk2410/Kconfig"
|
||||
source "board/samsung/smdkc100/Kconfig"
|
||||
source "board/sandisk/sansa_fuze_plus/Kconfig"
|
||||
source "board/scb9328/Kconfig"
|
||||
source "board/schulercontrol/sc_sps_1/Kconfig"
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <div64.h>
|
||||
#include <watchdog.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define TIMER_BASE 0x53f90000 /* General purpose timer 1 */
|
||||
@@ -28,57 +25,6 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* "time" is measured in 1 / CONFIG_SYS_HZ seconds,
|
||||
* "tick" is internal timer period
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_MX31_TIMER_HIGH_PRECISION
|
||||
/* ~0.4% error - measured with stop-watch on 100s boot-delay */
|
||||
static inline unsigned long long tick_to_time(unsigned long long tick)
|
||||
{
|
||||
tick *= CONFIG_SYS_HZ;
|
||||
do_div(tick, MXC_CLK32);
|
||||
return tick;
|
||||
}
|
||||
|
||||
static inline unsigned long long time_to_tick(unsigned long long time)
|
||||
{
|
||||
time *= MXC_CLK32;
|
||||
do_div(time, CONFIG_SYS_HZ);
|
||||
return time;
|
||||
}
|
||||
|
||||
static inline unsigned long long us_to_tick(unsigned long long us)
|
||||
{
|
||||
us = us * MXC_CLK32 + 999999;
|
||||
do_div(us, 1000000);
|
||||
return us;
|
||||
}
|
||||
#else
|
||||
/* ~2% error */
|
||||
#define TICK_PER_TIME ((MXC_CLK32 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ)
|
||||
#define US_PER_TICK (1000000 / MXC_CLK32)
|
||||
|
||||
static inline unsigned long long tick_to_time(unsigned long long tick)
|
||||
{
|
||||
do_div(tick, TICK_PER_TIME);
|
||||
return tick;
|
||||
}
|
||||
|
||||
static inline unsigned long long time_to_tick(unsigned long long time)
|
||||
{
|
||||
return time * TICK_PER_TIME;
|
||||
}
|
||||
|
||||
static inline unsigned long long us_to_tick(unsigned long long us)
|
||||
{
|
||||
us += US_PER_TICK - 1;
|
||||
do_div(us, US_PER_TICK);
|
||||
return us;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The 32768Hz 32-bit timer overruns in 131072 seconds */
|
||||
int timer_init(void)
|
||||
{
|
||||
@@ -95,53 +41,7 @@ int timer_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long get_ticks(void)
|
||||
unsigned long timer_read_counter(void)
|
||||
{
|
||||
ulong now = GPTCNT; /* current tick value */
|
||||
|
||||
if (now >= gd->arch.lastinc) /* normal mode (non roll) */
|
||||
/* move stamp forward with absolut diff ticks */
|
||||
gd->arch.tbl += (now - gd->arch.lastinc);
|
||||
else /* we have rollover of incrementer */
|
||||
gd->arch.tbl += (0xFFFFFFFF - gd->arch.lastinc) + now;
|
||||
gd->arch.lastinc = now;
|
||||
return gd->arch.tbl;
|
||||
}
|
||||
|
||||
ulong get_timer_masked(void)
|
||||
{
|
||||
/*
|
||||
* get_ticks() returns a long long (64 bit), it wraps in
|
||||
* 2^64 / MXC_CLK32 = 2^64 / 2^15 = 2^49 ~ 5 * 10^14 (s) ~
|
||||
* 5 * 10^9 days... and get_ticks() * CONFIG_SYS_HZ wraps in
|
||||
* 5 * 10^6 days - long enough.
|
||||
*/
|
||||
return tick_to_time(get_ticks());
|
||||
}
|
||||
|
||||
ulong get_timer(ulong base)
|
||||
{
|
||||
return get_timer_masked() - base;
|
||||
}
|
||||
|
||||
/* delay x useconds AND preserve advance timestamp value */
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
unsigned long long tmp;
|
||||
ulong tmo;
|
||||
|
||||
tmo = us_to_tick(usec);
|
||||
tmp = get_ticks() + tmo; /* get current timestamp */
|
||||
|
||||
while (get_ticks() < tmp) /* loop till event */
|
||||
/*NOP*/;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
ulong get_tbclk(void)
|
||||
{
|
||||
return MXC_CLK32;
|
||||
return GPTCNT;
|
||||
}
|
||||
|
||||
@@ -9,43 +9,17 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <div64.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/arch/clock.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#define timestamp (gd->arch.tbl)
|
||||
#define lastinc (gd->arch.lastinc)
|
||||
|
||||
/* General purpose timers bitfields */
|
||||
#define GPTCR_SWR (1<<15) /* Software reset */
|
||||
#define GPTCR_FRR (1<<9) /* Freerun / restart */
|
||||
#define GPTCR_CLKSOURCE_32 (4<<6) /* Clock source */
|
||||
#define GPTCR_TEN (1) /* Timer enable */
|
||||
|
||||
/*
|
||||
* "time" is measured in 1 / CONFIG_SYS_HZ seconds,
|
||||
* "tick" is internal timer period
|
||||
*/
|
||||
/* ~0.4% error - measured with stop-watch on 100s boot-delay */
|
||||
static inline unsigned long long tick_to_time(unsigned long long tick)
|
||||
{
|
||||
tick *= CONFIG_SYS_HZ;
|
||||
do_div(tick, MXC_CLK32);
|
||||
|
||||
return tick;
|
||||
}
|
||||
|
||||
static inline unsigned long long us_to_tick(unsigned long long us)
|
||||
{
|
||||
us = us * MXC_CLK32 + 999999;
|
||||
do_div(us, 1000000);
|
||||
|
||||
return us;
|
||||
}
|
||||
|
||||
/*
|
||||
* nothing really to do with interrupts, just starts up a counter.
|
||||
* The 32KHz 32-bit timer overruns in 134217 seconds
|
||||
@@ -71,60 +45,3 @@ int timer_init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
struct gpt_regs *gpt = (struct gpt_regs *)GPT1_BASE_ADDR;
|
||||
ulong now = readl(&gpt->counter); /* current tick value */
|
||||
|
||||
if (now >= lastinc) {
|
||||
/*
|
||||
* normal mode (non roll)
|
||||
* move stamp forward with absolut diff ticks
|
||||
*/
|
||||
timestamp += (now - lastinc);
|
||||
} else {
|
||||
/* we have rollover of incrementer */
|
||||
timestamp += (0xFFFFFFFF - lastinc) + now;
|
||||
}
|
||||
lastinc = now;
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
ulong get_timer_masked(void)
|
||||
{
|
||||
/*
|
||||
* get_ticks() returns a long long (64 bit), it wraps in
|
||||
* 2^64 / MXC_CLK32 = 2^64 / 2^15 = 2^49 ~ 5 * 10^14 (s) ~
|
||||
* 5 * 10^9 days... and get_ticks() * CONFIG_SYS_HZ wraps in
|
||||
* 5 * 10^6 days - long enough.
|
||||
*/
|
||||
return tick_to_time(get_ticks());
|
||||
}
|
||||
|
||||
ulong get_timer(ulong base)
|
||||
{
|
||||
return get_timer_masked() - base;
|
||||
}
|
||||
|
||||
/* delay x useconds AND preserve advance timstamp value */
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
unsigned long long tmp;
|
||||
ulong tmo;
|
||||
|
||||
tmo = us_to_tick(usec);
|
||||
tmp = get_ticks() + tmo; /* get current timestamp */
|
||||
|
||||
while (get_ticks() < tmp) /* loop till event */
|
||||
/*NOP*/;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
ulong get_tbclk(void)
|
||||
{
|
||||
return MXC_CLK32;
|
||||
}
|
||||
|
||||
@@ -240,9 +240,14 @@ static void mx23_mem_setup_vddmem(void)
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
/* We must wait before and after disabling the current limiter! */
|
||||
early_delay(10000);
|
||||
|
||||
clrbits_le32(&power_regs->hw_power_vddmemctrl,
|
||||
POWER_VDDMEMCTRL_ENABLE_ILIMIT);
|
||||
|
||||
early_delay(10000);
|
||||
|
||||
}
|
||||
|
||||
static void mx23_mem_init(void)
|
||||
@@ -269,7 +274,13 @@ static void mx23_mem_init(void)
|
||||
setbits_le32(MXS_DRAM_BASE + 0x20, 1 << 16);
|
||||
|
||||
clrbits_le32(MXS_DRAM_BASE + 0x40, 1 << 17);
|
||||
early_delay(20000);
|
||||
|
||||
/* Wait for EMI_STAT bit DRAM_HALTED */
|
||||
for (;;) {
|
||||
if (!(readl(MXS_EMI_BASE + 0x10) & (1 << 1)))
|
||||
break;
|
||||
early_delay(1000);
|
||||
}
|
||||
|
||||
/* Adjust EMI port priority. */
|
||||
clrsetbits_le32(0x80020000, 0x1f << 16, 0x2);
|
||||
|
||||
@@ -5,6 +5,7 @@ choice
|
||||
|
||||
config TARGET_SMDKV310
|
||||
bool "Exynos4210 SMDKV310 board"
|
||||
select OF_CONTROL if !SPL_BUILD
|
||||
|
||||
config TARGET_TRATS
|
||||
bool "Exynos4210 Trats board"
|
||||
|
||||
@@ -642,6 +642,33 @@ int enable_pcie_clock(void)
|
||||
BM_ANADIG_PLL_ENET_ENABLE_PCIE);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SECURE_BOOT
|
||||
void hab_caam_clock_enable(unsigned char enable)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
/* CG4 ~ CG6, CAAM clocks */
|
||||
reg = __raw_readl(&imx_ccm->CCGR0);
|
||||
if (enable)
|
||||
reg |= (MXC_CCM_CCGR0_CAAM_WRAPPER_IPG_MASK |
|
||||
MXC_CCM_CCGR0_CAAM_WRAPPER_ACLK_MASK |
|
||||
MXC_CCM_CCGR0_CAAM_SECURE_MEM_MASK);
|
||||
else
|
||||
reg &= ~(MXC_CCM_CCGR0_CAAM_WRAPPER_IPG_MASK |
|
||||
MXC_CCM_CCGR0_CAAM_WRAPPER_ACLK_MASK |
|
||||
MXC_CCM_CCGR0_CAAM_SECURE_MEM_MASK);
|
||||
__raw_writel(reg, &imx_ccm->CCGR0);
|
||||
|
||||
/* EMI slow clk */
|
||||
reg = __raw_readl(&imx_ccm->CCGR6);
|
||||
if (enable)
|
||||
reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
|
||||
else
|
||||
reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
|
||||
__raw_writel(reg, &imx_ccm->CCGR6);
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned int mxc_get_clock(enum mxc_clock clk)
|
||||
{
|
||||
switch (clk) {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Freescale Semiconductor, Inc.
|
||||
* Copyright (C) 2010-2014 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/arch/hab.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
/* -------- start of HAB API updates ------------*/
|
||||
@@ -71,6 +73,44 @@
|
||||
((hab_rvt_exit_t *)HAB_RVT_EXIT) \
|
||||
)
|
||||
|
||||
#define IVT_SIZE 0x20
|
||||
#define ALIGN_SIZE 0x1000
|
||||
#define CSF_PAD_SIZE 0x2000
|
||||
#define MX6DQ_PU_IROM_MMU_EN_VAR 0x009024a8
|
||||
#define MX6DLS_PU_IROM_MMU_EN_VAR 0x00901dd0
|
||||
#define MX6SL_PU_IROM_MMU_EN_VAR 0x00900a18
|
||||
|
||||
/*
|
||||
* +------------+ 0x0 (DDR_UIMAGE_START) -
|
||||
* | Header | |
|
||||
* +------------+ 0x40 |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* | Image Data | |
|
||||
* . | |
|
||||
* . | > Stuff to be authenticated ----+
|
||||
* . | | |
|
||||
* | | | |
|
||||
* | | | |
|
||||
* +------------+ | |
|
||||
* | | | |
|
||||
* | Fill Data | | |
|
||||
* | | | |
|
||||
* +------------+ Align to ALIGN_SIZE | |
|
||||
* | IVT | | |
|
||||
* +------------+ + IVT_SIZE - |
|
||||
* | | |
|
||||
* | CSF DATA | <---------------------------------------------------------+
|
||||
* | |
|
||||
* +------------+
|
||||
* | |
|
||||
* | Fill Data |
|
||||
* | |
|
||||
* +------------+ + CSF_PAD_SIZE
|
||||
*/
|
||||
|
||||
bool is_hab_enabled(void)
|
||||
{
|
||||
struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
|
||||
@@ -144,6 +184,108 @@ int get_hab_status(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t authenticate_image(uint32_t ddr_start, uint32_t image_size)
|
||||
{
|
||||
uint32_t load_addr = 0;
|
||||
size_t bytes;
|
||||
ptrdiff_t ivt_offset = 0;
|
||||
int result = 0;
|
||||
ulong start;
|
||||
hab_rvt_authenticate_image_t *hab_rvt_authenticate_image;
|
||||
hab_rvt_entry_t *hab_rvt_entry;
|
||||
hab_rvt_exit_t *hab_rvt_exit;
|
||||
|
||||
hab_rvt_authenticate_image = hab_rvt_authenticate_image_p;
|
||||
hab_rvt_entry = hab_rvt_entry_p;
|
||||
hab_rvt_exit = hab_rvt_exit_p;
|
||||
|
||||
if (is_hab_enabled()) {
|
||||
printf("\nAuthenticate image from DDR location 0x%x...\n",
|
||||
ddr_start);
|
||||
|
||||
hab_caam_clock_enable(1);
|
||||
|
||||
if (hab_rvt_entry() == HAB_SUCCESS) {
|
||||
/* If not already aligned, Align to ALIGN_SIZE */
|
||||
ivt_offset = (image_size + ALIGN_SIZE - 1) &
|
||||
~(ALIGN_SIZE - 1);
|
||||
|
||||
start = ddr_start;
|
||||
bytes = ivt_offset + IVT_SIZE + CSF_PAD_SIZE;
|
||||
#ifdef DEBUG
|
||||
printf("\nivt_offset = 0x%x, ivt addr = 0x%x\n",
|
||||
ivt_offset, ddr_start + ivt_offset);
|
||||
puts("Dumping IVT\n");
|
||||
print_buffer(ddr_start + ivt_offset,
|
||||
(void *)(ddr_start + ivt_offset),
|
||||
4, 0x8, 0);
|
||||
|
||||
puts("Dumping CSF Header\n");
|
||||
print_buffer(ddr_start + ivt_offset+IVT_SIZE,
|
||||
(void *)(ddr_start + ivt_offset+IVT_SIZE),
|
||||
4, 0x10, 0);
|
||||
|
||||
get_hab_status();
|
||||
|
||||
puts("\nCalling authenticate_image in ROM\n");
|
||||
printf("\tivt_offset = 0x%x\n", ivt_offset);
|
||||
printf("\tstart = 0x%08lx\n", start);
|
||||
printf("\tbytes = 0x%x\n", bytes);
|
||||
#endif
|
||||
/*
|
||||
* If the MMU is enabled, we have to notify the ROM
|
||||
* code, or it won't flush the caches when needed.
|
||||
* This is done, by setting the "pu_irom_mmu_enabled"
|
||||
* word to 1. You can find its address by looking in
|
||||
* the ROM map. This is critical for
|
||||
* authenticate_image(). If MMU is enabled, without
|
||||
* setting this bit, authentication will fail and may
|
||||
* crash.
|
||||
*/
|
||||
/* Check MMU enabled */
|
||||
if (get_cr() & CR_M) {
|
||||
if (is_cpu_type(MXC_CPU_MX6Q) ||
|
||||
is_cpu_type(MXC_CPU_MX6D)) {
|
||||
/*
|
||||
* This won't work on Rev 1.0.0 of
|
||||
* i.MX6Q/D, since their ROM doesn't
|
||||
* do cache flushes. don't think any
|
||||
* exist, so we ignore them.
|
||||
*/
|
||||
writel(1, MX6DQ_PU_IROM_MMU_EN_VAR);
|
||||
} else if (is_cpu_type(MXC_CPU_MX6DL) ||
|
||||
is_cpu_type(MXC_CPU_MX6SOLO)) {
|
||||
writel(1, MX6DLS_PU_IROM_MMU_EN_VAR);
|
||||
} else if (is_cpu_type(MXC_CPU_MX6SL)) {
|
||||
writel(1, MX6SL_PU_IROM_MMU_EN_VAR);
|
||||
}
|
||||
}
|
||||
|
||||
load_addr = (uint32_t)hab_rvt_authenticate_image(
|
||||
HAB_CID_UBOOT,
|
||||
ivt_offset, (void **)&start,
|
||||
(size_t *)&bytes, NULL);
|
||||
if (hab_rvt_exit() != HAB_SUCCESS) {
|
||||
puts("hab exit function fail\n");
|
||||
load_addr = 0;
|
||||
}
|
||||
} else {
|
||||
puts("hab entry function fail\n");
|
||||
}
|
||||
|
||||
hab_caam_clock_enable(0);
|
||||
|
||||
get_hab_status();
|
||||
} else {
|
||||
puts("hab fuse not enabled\n");
|
||||
}
|
||||
|
||||
if ((!is_hab_enabled()) || (load_addr != 0))
|
||||
result = 1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int do_hab_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
if ((argc != 1)) {
|
||||
@@ -156,8 +298,33 @@ int do_hab_status(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||
char * const argv[])
|
||||
{
|
||||
ulong addr, ivt_offset;
|
||||
int rcode = 0;
|
||||
|
||||
if (argc < 3)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
addr = simple_strtoul(argv[1], NULL, 16);
|
||||
ivt_offset = simple_strtoul(argv[2], NULL, 16);
|
||||
|
||||
rcode = authenticate_image(addr, ivt_offset);
|
||||
|
||||
return rcode;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
hab_status, CONFIG_SYS_MAXARGS, 1, do_hab_status,
|
||||
"display HAB status",
|
||||
""
|
||||
);
|
||||
|
||||
U_BOOT_CMD(
|
||||
hab_auth_img, 3, 0, do_authenticate_image,
|
||||
"authenticate image via HAB",
|
||||
"addr ivt_offset\n"
|
||||
"addr - image hex address\n"
|
||||
"ivt_offset - hex offset of IVT in the image"
|
||||
);
|
||||
|
||||
@@ -273,10 +273,25 @@ int board_postclk_init(void)
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
void enable_caches(void)
|
||||
{
|
||||
#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
|
||||
enum dcache_option option = DCACHE_WRITETHROUGH;
|
||||
#else
|
||||
enum dcache_option option = DCACHE_WRITEBACK;
|
||||
#endif
|
||||
|
||||
/* Avoid random hang when download by usb */
|
||||
invalidate_dcache_all();
|
||||
|
||||
/* Enable D-cache. I-cache is already enabled in start.S */
|
||||
dcache_enable();
|
||||
|
||||
/* Enable caching on OCRAM and ROM */
|
||||
mmu_set_region_dcache_behaviour(ROMCP_ARB_BASE_ADDR,
|
||||
ROMCP_ARB_END_ADDR,
|
||||
option);
|
||||
mmu_set_region_dcache_behaviour(IRAM_BASE_ADDR,
|
||||
IRAM_SIZE,
|
||||
option);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -339,10 +354,10 @@ const struct boot_mode soc_boot_modes[] = {
|
||||
void s_init(void)
|
||||
{
|
||||
struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
|
||||
int is_6q = is_cpu_type(MXC_CPU_MX6Q);
|
||||
struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
|
||||
u32 mask480;
|
||||
u32 mask528;
|
||||
|
||||
u32 reg, periph1, periph2;
|
||||
|
||||
if (is_cpu_type(MXC_CPU_MX6SX))
|
||||
return;
|
||||
@@ -357,15 +372,23 @@ void s_init(void)
|
||||
ANATOP_PFD_CLKGATE_MASK(1) |
|
||||
ANATOP_PFD_CLKGATE_MASK(2) |
|
||||
ANATOP_PFD_CLKGATE_MASK(3);
|
||||
mask528 = ANATOP_PFD_CLKGATE_MASK(0) |
|
||||
ANATOP_PFD_CLKGATE_MASK(1) |
|
||||
mask528 = ANATOP_PFD_CLKGATE_MASK(1) |
|
||||
ANATOP_PFD_CLKGATE_MASK(3);
|
||||
|
||||
/*
|
||||
* Don't reset PFD2 on DL/S
|
||||
*/
|
||||
if (is_6q)
|
||||
reg = readl(&ccm->cbcmr);
|
||||
periph2 = ((reg & MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_MASK)
|
||||
>> MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_OFFSET);
|
||||
periph1 = ((reg & MXC_CCM_CBCMR_PRE_PERIPH_CLK_SEL_MASK)
|
||||
>> MXC_CCM_CBCMR_PRE_PERIPH_CLK_SEL_OFFSET);
|
||||
|
||||
/* Checking if PLL2 PFD0 or PLL2 PFD2 is using for periph clock */
|
||||
if ((periph2 != 0x2) && (periph1 != 0x2))
|
||||
mask528 |= ANATOP_PFD_CLKGATE_MASK(0);
|
||||
|
||||
if ((periph2 != 0x1) && (periph1 != 0x1) &&
|
||||
(periph2 != 0x3) && (periph1 != 0x3))
|
||||
mask528 |= ANATOP_PFD_CLKGATE_MASK(2);
|
||||
|
||||
writel(mask480, &anatop->pfd_480_set);
|
||||
writel(mask528, &anatop->pfd_528_set);
|
||||
writel(mask480, &anatop->pfd_480_clr);
|
||||
|
||||
@@ -70,7 +70,13 @@ int init_sata(int dev)
|
||||
writel(val, TI_SATA_WRAPPER_BASE + TI_SATA_SYSCONFIG);
|
||||
|
||||
ret = ahci_init(DWC_AHSATA_BASE);
|
||||
scsi_scan(1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* On OMAP platforms SATA provides the SCSI subsystem */
|
||||
void scsi_init(void)
|
||||
{
|
||||
init_sata(0);
|
||||
scsi_scan(1);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,13 @@ do_cpu_waiting:
|
||||
*/
|
||||
.align 4
|
||||
do_lowlevel_init:
|
||||
ldr r2, =0xFF000044 /* PRR */
|
||||
ldr r1, [r2]
|
||||
and r1, r1, #0x7F00
|
||||
lsrs r1, r1, #8
|
||||
cmp r1, #0x4C /* 0x4C is ID of r8a7794 */
|
||||
beq _exit_init_l2_a15
|
||||
|
||||
/* surpress wfe if ca15 */
|
||||
tst r4, #4
|
||||
mrceq p15, 0, r0, c1, c0, 1 /* actlr */
|
||||
@@ -42,11 +49,6 @@ do_lowlevel_init:
|
||||
mcreq p15, 0, r0, c1, c0, 1
|
||||
|
||||
/* and set l2 latency */
|
||||
mrceq p15, 1, r0, c9, c0, 2 /* l2ctlr */
|
||||
orreq r0, r0, #0x00000800
|
||||
orreq r0, r0, #0x00000003
|
||||
mcreq p15, 1, r0, c9, c0, 2
|
||||
|
||||
mrc p15, 0, r0, c0, c0, 5 /* r0 = MPIDR */
|
||||
and r0, r0, #0xf00
|
||||
lsr r0, r0, #8
|
||||
@@ -58,7 +60,15 @@ do_lowlevel_init:
|
||||
cmp r1, #3 /* has already been set up */
|
||||
bicne r0, r0, #0xe7
|
||||
orrne r0, r0, #0x83 /* L2CTLR[7:6] + L2CTLR[2:0] */
|
||||
orrne r0, r0, #0x20 /* L2CTLR[5] */
|
||||
|
||||
ldr r2, =0xFF000044 /* PRR */
|
||||
ldr r1, [r2]
|
||||
and r1, r1, #0x7F00
|
||||
lsrs r1, r1, #8
|
||||
cmp r1, #0x45 /* 0x45 is ID of r8a7790 */
|
||||
bne L2CTLR_5_SKIP
|
||||
orrne r0, r0, #0x20 /* L2CTLR[5] */
|
||||
L2CTLR_5_SKIP:
|
||||
mcrne p15, 1, r0, c9, c0, 2
|
||||
|
||||
_exit_init_l2_a15:
|
||||
|
||||
25
arch/arm/cpu/armv7/s5pc1xx/Kconfig
Normal file
25
arch/arm/cpu/armv7/s5pc1xx/Kconfig
Normal file
@@ -0,0 +1,25 @@
|
||||
if ARCH_S5PC1XX
|
||||
|
||||
choice
|
||||
prompt "S5PC1XX board select"
|
||||
|
||||
config TARGET_S5P_GONI
|
||||
bool "S5P Goni board"
|
||||
select OF_CONTROL if !SPL_BUILD
|
||||
|
||||
config TARGET_SMDKC100
|
||||
bool "Support smdkc100 board"
|
||||
select OF_CONTROL if !SPL_BUILD
|
||||
|
||||
endchoice
|
||||
|
||||
config SYS_CPU
|
||||
default "armv7"
|
||||
|
||||
config SYS_SOC
|
||||
default "s5pc1xx"
|
||||
|
||||
source "board/samsung/goni/Kconfig"
|
||||
source "board/samsung/smdkc100/Kconfig"
|
||||
|
||||
endif
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Samsung Electronics
|
||||
* Minkyu Kang <mk7.kang@samsung.com>
|
||||
*
|
||||
* based on arch/arm/cpu/armv7/omap3/cache.S
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
.align 5
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
||||
#ifndef CONFIG_SYS_L2CACHE_OFF
|
||||
ENTRY(v7_outer_cache_enable)
|
||||
push {r0, r1, r2, lr}
|
||||
mrc 15, 0, r3, cr1, cr0, 1
|
||||
orr r3, r3, #2
|
||||
mcr 15, 0, r3, cr1, cr0, 1
|
||||
pop {r1, r2, r3, pc}
|
||||
ENDPROC(v7_outer_cache_enable)
|
||||
|
||||
ENTRY(v7_outer_cache_disable)
|
||||
push {r0, r1, r2, lr}
|
||||
mrc 15, 0, r3, cr1, cr0, 1
|
||||
bic r3, r3, #2
|
||||
mcr 15, 0, r3, cr1, cr0, 1
|
||||
pop {r1, r2, r3, pc}
|
||||
ENDPROC(v7_outer_cache_disable)
|
||||
#endif
|
||||
47
arch/arm/cpu/armv7/s5pc1xx/cache.c
Normal file
47
arch/arm/cpu/armv7/s5pc1xx/cache.c
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Samsung Electronics
|
||||
* Minkyu Kang <mk7.kang@samsung.com>
|
||||
* Robert Baldyga <r.baldyga@samsung.com>
|
||||
*
|
||||
* based on arch/arm/cpu/armv7/omap3/cache.S
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
void enable_caches(void)
|
||||
{
|
||||
dcache_enable();
|
||||
}
|
||||
|
||||
void disable_caches(void)
|
||||
{
|
||||
dcache_disable();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_L2CACHE_OFF
|
||||
void v7_outer_cache_enable(void)
|
||||
{
|
||||
__asm(
|
||||
"push {r0, r1, r2, lr}\n\t"
|
||||
"mrc 15, 0, r3, cr1, cr0, 1\n\t"
|
||||
"orr r3, r3, #2\n\t"
|
||||
"mcr 15, 0, r3, cr1, cr0, 1\n\t"
|
||||
"pop {r1, r2, r3, pc}"
|
||||
);
|
||||
}
|
||||
|
||||
void v7_outer_cache_disable(void)
|
||||
{
|
||||
__asm(
|
||||
"push {r0, r1, r2, lr}\n\t"
|
||||
"mrc 15, 0, r3, cr1, cr0, 1\n\t"
|
||||
"bic r3, r3, #2\n\t"
|
||||
"mcr 15, 0, r3, cr1, cr0, 1\n\t"
|
||||
"pop {r1, r2, r3, pc}"
|
||||
);
|
||||
}
|
||||
#endif
|
||||
32
arch/arm/cpu/armv7/uniphier/Kconfig
Normal file
32
arch/arm/cpu/armv7/uniphier/Kconfig
Normal file
@@ -0,0 +1,32 @@
|
||||
menu "Panasonic UniPhier platform"
|
||||
depends on ARCH_UNIPHIER
|
||||
|
||||
config SYS_CPU
|
||||
string
|
||||
default "armv7"
|
||||
|
||||
config SYS_SOC
|
||||
string
|
||||
default "uniphier"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
string
|
||||
default "ph1_pro4" if MACH_PH1_PRO4
|
||||
default "ph1_ld4" if MACH_PH1_LD4
|
||||
default "ph1_sld8" if MACH_PH1_SLD8
|
||||
|
||||
choice
|
||||
prompt "UniPhier SoC select"
|
||||
|
||||
config MACH_PH1_PRO4
|
||||
bool "PH1-Pro4"
|
||||
|
||||
config MACH_PH1_LD4
|
||||
bool "PH1-LD4"
|
||||
|
||||
config MACH_PH1_SLD8
|
||||
bool "PH1-sLD8"
|
||||
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
23
arch/arm/cpu/armv7/uniphier/Makefile
Normal file
23
arch/arm/cpu/armv7/uniphier/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += lowlevel_init.o init_page_table.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
|
||||
obj-y += timer.o
|
||||
obj-y += reset.o
|
||||
obj-y += cache_uniphier.o
|
||||
obj-y += dram_init.o
|
||||
obj-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o
|
||||
obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o
|
||||
obj-$(CONFIG_UNIPHIER_SMP) += smp.o
|
||||
obj-$(if $(CONFIG_SPL_BUILD),,y) += cmd_pinmon.o
|
||||
|
||||
obj-y += board_common.o
|
||||
obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += support_card.o
|
||||
obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += support_card.o
|
||||
|
||||
obj-$(CONFIG_MACH_PH1_LD4) += ph1-ld4/
|
||||
obj-$(CONFIG_MACH_PH1_PRO4) += ph1-pro4/
|
||||
obj-$(CONFIG_MACH_PH1_SLD8) += ph1-sld8/
|
||||
32
arch/arm/cpu/armv7/uniphier/board_common.c
Normal file
32
arch/arm/cpu/armv7/uniphier/board_common.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/led.h>
|
||||
|
||||
/*
|
||||
* Routine: board_init
|
||||
* Description: Early hardware init.
|
||||
*/
|
||||
int board_init(void)
|
||||
{
|
||||
led_write(U, B, O, O);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_NR_DRAM_BANKS >= 2
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
gd->bd->bi_dram[0].start = CONFIG_SDRAM0_BASE;
|
||||
gd->bd->bi_dram[0].size = CONFIG_SDRAM0_SIZE;
|
||||
gd->bd->bi_dram[1].start = CONFIG_SDRAM1_BASE;
|
||||
gd->bd->bi_dram[1].size = CONFIG_SDRAM1_SIZE;
|
||||
}
|
||||
#endif
|
||||
91
arch/arm/cpu/armv7/uniphier/board_late_init.c
Normal file
91
arch/arm/cpu/armv7/uniphier/board_late_init.c
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
#include <nand.h>
|
||||
#include <asm/io.h>
|
||||
#include <../drivers/mtd/nand/denali.h>
|
||||
|
||||
static void nand_denali_wp_disable(void)
|
||||
{
|
||||
#ifdef CONFIG_NAND_DENALI
|
||||
/*
|
||||
* Since the boot rom enables the write protection for NAND boot mode,
|
||||
* it must be disabled somewhere for "nand write", "nand erase", etc.
|
||||
* The workaround is here to not disturb the Denali NAND controller
|
||||
* driver just for a really SoC-specific thing.
|
||||
*/
|
||||
void __iomem *denali_reg = (void __iomem *)CONFIG_SYS_NAND_REGS_BASE;
|
||||
|
||||
writel(WRITE_PROTECT__FLAG, denali_reg + WRITE_PROTECT);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void nand_denali_fixup(void)
|
||||
{
|
||||
#if defined(CONFIG_NAND_DENALI) && \
|
||||
(defined(CONFIG_MACH_PH1_SLD8) || defined(CONFIG_MACH_PH1_PRO4))
|
||||
/*
|
||||
* The Denali NAND controller on some of UniPhier SoCs does not
|
||||
* automatically query the device parameters. For those SoCs,
|
||||
* some registers must be set after the device is probed.
|
||||
*/
|
||||
void __iomem *denali_reg = (void __iomem *)CONFIG_SYS_NAND_REGS_BASE;
|
||||
struct mtd_info *mtd;
|
||||
struct nand_chip *chip;
|
||||
|
||||
if (nand_curr_device < 0 ||
|
||||
nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE) {
|
||||
/* NAND was not detected. Just return. */
|
||||
return;
|
||||
}
|
||||
|
||||
mtd = &nand_info[nand_curr_device];
|
||||
chip = mtd->priv;
|
||||
|
||||
writel(mtd->erasesize / mtd->writesize, denali_reg + PAGES_PER_BLOCK);
|
||||
writel(0, denali_reg + DEVICE_WIDTH);
|
||||
writel(mtd->writesize, denali_reg + DEVICE_MAIN_AREA_SIZE);
|
||||
writel(mtd->oobsize, denali_reg + DEVICE_SPARE_AREA_SIZE);
|
||||
writel(1, denali_reg + DEVICES_CONNECTED);
|
||||
|
||||
/*
|
||||
* chip->scan_bbt in nand_scan_tail() has been skipped.
|
||||
* It should be done in here.
|
||||
*/
|
||||
chip->scan_bbt(mtd);
|
||||
#endif
|
||||
}
|
||||
|
||||
int board_late_init(void)
|
||||
{
|
||||
puts("MODE: ");
|
||||
|
||||
switch (spl_boot_device()) {
|
||||
case BOOT_DEVICE_MMC1:
|
||||
printf("eMMC Boot\n");
|
||||
setenv("bootmode", "emmcboot");
|
||||
nand_denali_fixup();
|
||||
break;
|
||||
case BOOT_DEVICE_NAND:
|
||||
printf("NAND Boot\n");
|
||||
setenv("bootmode", "nandboot");
|
||||
nand_denali_wp_disable();
|
||||
break;
|
||||
case BOOT_DEVICE_NOR:
|
||||
printf("NOR Boot\n");
|
||||
setenv("bootmode", "norboot");
|
||||
nand_denali_fixup();
|
||||
break;
|
||||
default:
|
||||
printf("Unsupported Boot Mode\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
154
arch/arm/cpu/armv7/uniphier/cache_uniphier.c
Normal file
154
arch/arm/cpu/armv7/uniphier/cache_uniphier.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/armv7.h>
|
||||
#include <asm/arch/ssc-regs.h>
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_L2CACHE_ON
|
||||
static void uniphier_cache_maint_all(u32 operation)
|
||||
{
|
||||
/* try until the command is successfully set */
|
||||
do {
|
||||
writel(SSCOQM_S_ALL | SSCOQM_CE | operation, SSCOQM);
|
||||
} while (readl(SSCOPPQSEF) & (SSCOPPQSEF_FE | SSCOPPQSEF_OE));
|
||||
|
||||
/* wait until the operation is completed */
|
||||
while (readl(SSCOLPQS) != SSCOLPQS_EF)
|
||||
;
|
||||
|
||||
/* clear the complete notification flag */
|
||||
writel(SSCOLPQS_EF, SSCOLPQS);
|
||||
|
||||
writel(SSCOPE_CM_SYNC, SSCOPE); /* drain internal buffers */
|
||||
readl(SSCOPE); /* need a read back to confirm */
|
||||
}
|
||||
|
||||
void v7_outer_cache_flush_all(void)
|
||||
{
|
||||
uniphier_cache_maint_all(SSCOQM_CM_WB_INV);
|
||||
}
|
||||
|
||||
void v7_outer_cache_inval_all(void)
|
||||
{
|
||||
uniphier_cache_maint_all(SSCOQM_CM_INV);
|
||||
}
|
||||
|
||||
static void __uniphier_cache_maint_range(u32 start, u32 size, u32 operation)
|
||||
{
|
||||
/* try until the command is successfully set */
|
||||
do {
|
||||
writel(SSCOQM_S_ADDRESS | SSCOQM_CE | operation, SSCOQM);
|
||||
writel(start, SSCOQAD);
|
||||
writel(size, SSCOQSZ);
|
||||
|
||||
} while (readl(SSCOPPQSEF) & (SSCOPPQSEF_FE | SSCOPPQSEF_OE));
|
||||
|
||||
/* wait until the operation is completed */
|
||||
while (readl(SSCOLPQS) != SSCOLPQS_EF)
|
||||
;
|
||||
|
||||
/* clear the complete notification flag */
|
||||
writel(SSCOLPQS_EF, SSCOLPQS);
|
||||
}
|
||||
|
||||
static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
|
||||
{
|
||||
u32 size;
|
||||
|
||||
/*
|
||||
* If start address is not aligned to cache-line,
|
||||
* do cache operation for the first cache-line
|
||||
*/
|
||||
start = start & ~(SSC_LINE_SIZE - 1);
|
||||
|
||||
if (start == 0 && end >= (u32)(-SSC_LINE_SIZE)) {
|
||||
/* this means cache operation for all range */
|
||||
uniphier_cache_maint_all(operation);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If end address is not aligned to cache-line,
|
||||
* do cache operation for the last cache-line
|
||||
*/
|
||||
size = (end - start + SSC_LINE_SIZE - 1) & ~(SSC_LINE_SIZE - 1);
|
||||
|
||||
while (size) {
|
||||
u32 chunk_size = size > SSC_RANGE_OP_MAX_SIZE ?
|
||||
SSC_RANGE_OP_MAX_SIZE : size;
|
||||
__uniphier_cache_maint_range(start, chunk_size, operation);
|
||||
|
||||
start += chunk_size;
|
||||
size -= chunk_size;
|
||||
}
|
||||
|
||||
writel(SSCOPE_CM_SYNC, SSCOPE); /* drain internal buffers */
|
||||
readl(SSCOPE); /* need a read back to confirm */
|
||||
}
|
||||
|
||||
void v7_outer_cache_flush_range(u32 start, u32 end)
|
||||
{
|
||||
uniphier_cache_maint_range(start, end, SSCOQM_CM_WB_INV);
|
||||
}
|
||||
|
||||
void v7_outer_cache_inval_range(u32 start, u32 end)
|
||||
{
|
||||
uniphier_cache_maint_range(start, end, SSCOQM_CM_INV);
|
||||
}
|
||||
|
||||
void v7_outer_cache_enable(void)
|
||||
{
|
||||
u32 tmp;
|
||||
tmp = readl(SSCC);
|
||||
tmp |= SSCC_ON;
|
||||
writel(tmp, SSCC);
|
||||
}
|
||||
#endif
|
||||
|
||||
void v7_outer_cache_disable(void)
|
||||
{
|
||||
u32 tmp;
|
||||
tmp = readl(SSCC);
|
||||
tmp &= ~SSCC_ON;
|
||||
writel(tmp, SSCC);
|
||||
}
|
||||
|
||||
void wakeup_secondary(void);
|
||||
|
||||
void enable_caches(void)
|
||||
{
|
||||
uint32_t reg;
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_SMP
|
||||
/*
|
||||
* The secondary CPU must move to DDR,
|
||||
* before L2 disable.
|
||||
* On SPL, the Page Table is located on the L2.
|
||||
*/
|
||||
wakeup_secondary();
|
||||
#endif
|
||||
/*
|
||||
* UniPhier SoCs must use L2 cache for init stack pointer.
|
||||
* We disable L2 and L1 in this order.
|
||||
* If CONFIG_SYS_DCACHE_OFF is not defined,
|
||||
* caches are enabled again with a new page table.
|
||||
*/
|
||||
|
||||
/* L2 disable */
|
||||
v7_outer_cache_disable();
|
||||
|
||||
/* L1 disable */
|
||||
reg = get_cr();
|
||||
reg &= ~(CR_C | CR_M);
|
||||
set_cr(reg);
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
dcache_enable();
|
||||
#endif
|
||||
}
|
||||
33
arch/arm/cpu/armv7/uniphier/cmd_pinmon.c
Normal file
33
arch/arm/cpu/armv7/uniphier/cmd_pinmon.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/boot-device.h>
|
||||
|
||||
static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||
{
|
||||
struct boot_device_info *table;
|
||||
u32 mode_sel, n = 0;
|
||||
|
||||
mode_sel = get_boot_mode_sel();
|
||||
|
||||
puts("Boot Mode Pin:\n");
|
||||
|
||||
for (table = boot_device_table; strlen(table->info); table++) {
|
||||
printf(" %c %02x %s\n", n == mode_sel ? '*' : ' ', n,
|
||||
table->info);
|
||||
n++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
pinmon, 1, 1, do_pinmon,
|
||||
"pin monitor",
|
||||
""
|
||||
);
|
||||
59
arch/arm/cpu/armv7/uniphier/cpu_info.c
Normal file
59
arch/arm/cpu/armv7/uniphier/cpu_info.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
u32 revision, type, model, rev, required_model = 1, required_rev = 1;
|
||||
|
||||
revision = readl(SG_REVISION);
|
||||
type = (revision & SG_REVISION_TYPE_MASK) >> SG_REVISION_TYPE_SHIFT;
|
||||
model = (revision & SG_REVISION_MODEL_MASK) >> SG_REVISION_MODEL_SHIFT;
|
||||
rev = (revision & SG_REVISION_REV_MASK) >> SG_REVISION_REV_SHIFT;
|
||||
|
||||
puts("CPU: ");
|
||||
|
||||
switch (type) {
|
||||
case 0x25:
|
||||
puts("PH1-sLD3 (MN2WS0220)");
|
||||
required_model = 2;
|
||||
break;
|
||||
case 0x26:
|
||||
puts("PH1-LD4 (MN2WS0250)");
|
||||
required_rev = 2;
|
||||
break;
|
||||
case 0x28:
|
||||
puts("PH1-Pro4 (MN2WS0230)");
|
||||
break;
|
||||
case 0x29:
|
||||
puts("PH1-sLD8 (MN2WS0270)");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown Processor ID (0x%x)\n", revision);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (model > 1)
|
||||
printf(" model %d", model);
|
||||
|
||||
printf(" (rev. %d)\n", rev);
|
||||
|
||||
if (model < required_model) {
|
||||
printf("Sorry, this model is not supported.\n");
|
||||
printf("Required model is %d.", required_model);
|
||||
return -1;
|
||||
} else if (rev < required_rev) {
|
||||
printf("Sorry, this revision is not supported.\n");
|
||||
printf("Required revision is %d.", required_rev);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
37
arch/arm/cpu/armv7/uniphier/dram_init.c
Normal file
37
arch/arm/cpu/armv7/uniphier/dram_init.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/led.h>
|
||||
|
||||
int umc_init(void);
|
||||
void enable_dpll_ssc(void);
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
|
||||
|
||||
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
|
||||
led_write(B, 4, , );
|
||||
|
||||
{
|
||||
int res;
|
||||
|
||||
res = umc_init();
|
||||
if (res < 0)
|
||||
return res;
|
||||
}
|
||||
led_write(B, 5, , );
|
||||
|
||||
enable_dpll_ssc();
|
||||
#endif
|
||||
|
||||
led_write(B, 6, , );
|
||||
|
||||
return 0;
|
||||
}
|
||||
1068
arch/arm/cpu/armv7/uniphier/init_page_table.c
Normal file
1068
arch/arm/cpu/armv7/uniphier/init_page_table.c
Normal file
File diff suppressed because it is too large
Load Diff
159
arch/arm/cpu/armv7/uniphier/lowlevel_init.S
Normal file
159
arch/arm/cpu/armv7/uniphier/lowlevel_init.S
Normal file
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/arm-mpcore.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
|
||||
ENTRY(lowlevel_init)
|
||||
mov r8, lr @ persevere link reg across call
|
||||
|
||||
/*
|
||||
* The UniPhier Boot ROM loads SPL code to the L2 cache.
|
||||
* But CPUs can only do instruction fetch now because start.S has
|
||||
* cleared C and M bits.
|
||||
* First we need to turn on MMU and Dcache again to get back
|
||||
* data access to L2.
|
||||
*/
|
||||
mrc p15, 0, r0, c1, c0, 0 @ SCTLR (System Contrl Register)
|
||||
orr r0, r0, #(CR_C | CR_M) @ enable MMU and Dcache
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
/*
|
||||
* Now we are using the page table embedded in the Boot ROM.
|
||||
* It is not handy since it is not a straight mapped table for sLD3.
|
||||
* What we need to do next is to switch over to the page table in SPL.
|
||||
*/
|
||||
ldr r3, =init_page_table @ page table must be 16KB aligned
|
||||
|
||||
/* Disable MMU and Dcache before switching Page Table */
|
||||
mrc p15, 0, r0, c1, c0, 0 @ SCTLR (System Contrl Register)
|
||||
bic r0, r0, #(CR_C | CR_M) @ disable MMU and Dcache
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
bl enable_mmu
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_SMP
|
||||
/*
|
||||
* ACTLR (Auxiliary Control Register) for Cortex-A9
|
||||
* bit[9] Parity on
|
||||
* bit[8] Alloc in one way
|
||||
* bit[7] EXCL (Exclusive cache bit)
|
||||
* bit[6] SMP
|
||||
* bit[3] Write full line of zeros mode
|
||||
* bit[2] L1 Prefetch enable
|
||||
* bit[1] L2 prefetch enable
|
||||
* bit[0] FW (Cache and TLB maintenance broadcast)
|
||||
*/
|
||||
mrc p15, 0, r0, c1, c0, 1 @ ACTLR (Auxiliary Control Register)
|
||||
orr r0, r0, #0x41 @ enable SMP, FW bit
|
||||
mcr p15, 0, r0, c1, c0, 1
|
||||
|
||||
/* branch by CPU ID */
|
||||
mrc p15, 0, r0, c0, c0, 5 @ MPIDR (Multiprocessor Affinity Register)
|
||||
and r0, r0, #0x3
|
||||
cmp r0, #0x0
|
||||
beq primary_cpu
|
||||
ldr r1, =ROM_BOOT_ROMRSV2
|
||||
mov r0, #0
|
||||
str r0, [r1]
|
||||
0: wfe
|
||||
ldr r0, [r1]
|
||||
cmp r0, #0
|
||||
beq 0b
|
||||
bx r0 @ r0: entry point of U-Boot main for the secondary CPU
|
||||
primary_cpu:
|
||||
ldr r1, =ROM_BOOT_ROMRSV2
|
||||
ldr r0, =_start @ entry for the secondary CPU
|
||||
str r0, [r1]
|
||||
ldr r0, [r1] @ make sure str is complete before sev
|
||||
sev @ kick the sedoncary CPU
|
||||
mrc p15, 4, r1, c15, c0, 0 @ Configuration Base Address Register
|
||||
bfc r1, #0, #13 @ clear bit 12-0
|
||||
mov r0, #-1
|
||||
str r0, [r1, #SCU_INV_ALL] @ SCU Invalidate All Register
|
||||
mov r0, #1 @ SCU enable
|
||||
str r0, [r1, #SCU_CTRL] @ SCU Control Register
|
||||
#endif
|
||||
|
||||
bl setup_init_ram @ RAM area for temporary stack pointer
|
||||
|
||||
mov lr, r8 @ restore link
|
||||
mov pc, lr @ back to my caller
|
||||
ENDPROC(lowlevel_init)
|
||||
|
||||
ENTRY(enable_mmu)
|
||||
mrc p15, 0, r0, c2, c0, 2 @ TTBCR (Translation Table Base Control Register)
|
||||
bic r0, r0, #0x37
|
||||
orr r0, r0, #0x20 @ disable TTBR1
|
||||
mcr p15, 0, r0, c2, c0, 2
|
||||
|
||||
orr r0, r3, #0x8 @ Outer Cacheability for table walks: WBWA
|
||||
mcr p15, 0, r0, c2, c0, 0 @ TTBR0
|
||||
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs
|
||||
|
||||
mov r0, #-1 @ manager for all domains (No permission check)
|
||||
mcr p15, 0, r0, c3, c0, 0 @ DACR (Domain Access Control Register)
|
||||
|
||||
dsb
|
||||
isb
|
||||
/*
|
||||
* MMU on:
|
||||
* TLBs was already invalidated in "../start.S"
|
||||
* So, we don't need to invalidate it here.
|
||||
*/
|
||||
mrc p15, 0, r0, c1, c0, 0 @ SCTLR (System Contrl Register)
|
||||
orr r0, r0, #(CR_C | CR_M) @ MMU and Dcache enable
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
mov pc, lr
|
||||
ENDPROC(enable_mmu)
|
||||
|
||||
#include <asm/arch/ssc-regs.h>
|
||||
|
||||
#define BOOT_RAM_SIZE (SSC_WAY_SIZE)
|
||||
#define BOOT_WAY_BITS (0x00000100) /* way 8 */
|
||||
|
||||
ENTRY(setup_init_ram)
|
||||
/*
|
||||
* Touch to zero for the boot way
|
||||
*/
|
||||
0:
|
||||
/*
|
||||
* set SSCOQM, SSCOQAD, SSCOQSZ, SSCOQWN in this order
|
||||
*/
|
||||
ldr r0, = 0x00408006 @ touch to zero with address range
|
||||
ldr r1, = SSCOQM
|
||||
str r0, [r1]
|
||||
ldr r0, = (CONFIG_SYS_INIT_SP_ADDR - BOOT_RAM_SIZE) @ base address
|
||||
ldr r1, = SSCOQAD
|
||||
str r0, [r1]
|
||||
ldr r0, = BOOT_RAM_SIZE
|
||||
ldr r1, = SSCOQSZ
|
||||
str r0, [r1]
|
||||
ldr r0, = BOOT_WAY_BITS
|
||||
ldr r1, = SSCOQWN
|
||||
str r0, [r1]
|
||||
ldr r1, = SSCOPPQSEF
|
||||
ldr r0, [r1]
|
||||
cmp r0, #0 @ check if the command is successfully set
|
||||
bne 0b @ try again if an error occurres
|
||||
|
||||
ldr r1, = SSCOLPQS
|
||||
1:
|
||||
ldr r0, [r1]
|
||||
cmp r0, #0x4
|
||||
bne 1b @ wait until the operation is completed
|
||||
str r0, [r1] @ clear the complete notification flag
|
||||
|
||||
mov pc, lr
|
||||
ENDPROC(setup_init_ram)
|
||||
10
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
Normal file
10
arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-y += boot-mode.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
|
||||
sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
|
||||
obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
|
||||
umc_init.o
|
||||
33
arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c
Normal file
33
arch/arm/cpu/armv7/uniphier/ph1-ld4/bcu_init.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/bcu-regs.h>
|
||||
|
||||
#define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x11111111 : 0x11111111 << (x))
|
||||
|
||||
void bcu_init(void)
|
||||
{
|
||||
int shift;
|
||||
|
||||
writel(0x44444444, BCSCR0); /* 0x20000000-0x3fffffff: ASM bus */
|
||||
writel(0x11111111, BCSCR2); /* 0x80000000-0x9fffffff: IPPC/IPPD-bus */
|
||||
writel(0x11111111, BCSCR3); /* 0xa0000000-0xbfffffff: IPPC/IPPD-bus */
|
||||
writel(0x11111111, BCSCR4); /* 0xc0000000-0xdfffffff: IPPC/IPPD-bus */
|
||||
writel(0x11111111, BCSCR5); /* 0xe0000000-0Xffffffff: IPPC/IPPD-bus */
|
||||
|
||||
/* Specify DDR channel */
|
||||
shift = (CONFIG_SDRAM1_BASE - CONFIG_SDRAM0_BASE) / 0x04000000 * 4;
|
||||
writel(ch(shift), BCIPPCCHR2); /* 0x80000000-0x9fffffff */
|
||||
|
||||
shift -= 32;
|
||||
writel(ch(shift), BCIPPCCHR3); /* 0xa0000000-0xbfffffff */
|
||||
|
||||
shift -= 32;
|
||||
writel(ch(shift), BCIPPCCHR4); /* 0xc0000000-0xdfffffff */
|
||||
}
|
||||
16
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c
Normal file
16
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_info.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
puts("Board: PH1-LD4 Board\n");
|
||||
|
||||
return check_support_card();
|
||||
}
|
||||
42
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
Normal file
42
arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void bcu_init(void);
|
||||
void sbc_init(void);
|
||||
void sg_init(void);
|
||||
void pll_init(void);
|
||||
void pin_init(void);
|
||||
void clkrst_init(void);
|
||||
|
||||
int board_postclk_init(void)
|
||||
{
|
||||
bcu_init();
|
||||
|
||||
sbc_init();
|
||||
|
||||
sg_init();
|
||||
|
||||
pll_init();
|
||||
|
||||
uniphier_board_init();
|
||||
|
||||
led_write(B, 1, , );
|
||||
|
||||
clkrst_init();
|
||||
|
||||
led_write(B, 2, , );
|
||||
|
||||
pin_init();
|
||||
|
||||
led_write(B, 3, , );
|
||||
|
||||
return 0;
|
||||
}
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-ld4/boot-mode.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-pro4/boot-mode.c"
|
||||
29
arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c
Normal file
29
arch/arm/cpu/armv7/uniphier/ph1-ld4/clkrst_init.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
|
||||
void clkrst_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* deassert reset */
|
||||
tmp = readl(SC_RSTCTRL);
|
||||
tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
|
||||
| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
|
||||
writel(tmp, SC_RSTCTRL);
|
||||
readl(SC_RSTCTRL); /* dummy read */
|
||||
|
||||
/* privide clocks */
|
||||
tmp = readl(SC_CLKCTRL);
|
||||
tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
|
||||
| SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
|
||||
writel(tmp, SC_CLKCTRL);
|
||||
readl(SC_CLKCTRL); /* dummy read */
|
||||
}
|
||||
63
arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c
Normal file
63
arch/arm/cpu/armv7/uniphier/ph1-ld4/pinctrl.c
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void pin_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* Comment format: PAD Name -> Function Name */
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_SERIAL
|
||||
sg_set_pinsel(85, 1); /* HSDOUT3 -> RXD0 */
|
||||
sg_set_pinsel(88, 1); /* HDDOUT6 -> TXD0 */
|
||||
|
||||
sg_set_pinsel(69, 23); /* PCIOWR -> TXD1 */
|
||||
sg_set_pinsel(70, 23); /* PCIORD -> RXD1 */
|
||||
|
||||
sg_set_pinsel(128, 13); /* XIRQ6 -> TXD2 */
|
||||
sg_set_pinsel(129, 13); /* XIRQ7 -> RXD2 */
|
||||
|
||||
sg_set_pinsel(110, 1); /* SBO0 -> TXD3 */
|
||||
sg_set_pinsel(111, 1); /* SBI0 -> RXD3 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NAND_DENALI
|
||||
sg_set_pinsel(158, 0); /* XNFRE -> XNFRE_GB */
|
||||
sg_set_pinsel(159, 0); /* XNFWE -> XNFWE_GB */
|
||||
sg_set_pinsel(160, 0); /* XFALE -> NFALE_GB */
|
||||
sg_set_pinsel(161, 0); /* XFCLE -> NFCLE_GB */
|
||||
sg_set_pinsel(162, 0); /* XNFWP -> XFNWP_GB */
|
||||
sg_set_pinsel(163, 0); /* XNFCE0 -> XNFCE0_GB */
|
||||
sg_set_pinsel(164, 0); /* NANDRYBY0 -> NANDRYBY0_GB */
|
||||
sg_set_pinsel(22, 0); /* MMCCLK -> XFNCE1_GB */
|
||||
sg_set_pinsel(23, 0); /* MMCCMD -> NANDRYBY1_GB */
|
||||
sg_set_pinsel(24, 0); /* MMCDAT0 -> NFD0_GB */
|
||||
sg_set_pinsel(25, 0); /* MMCDAT1 -> NFD1_GB */
|
||||
sg_set_pinsel(26, 0); /* MMCDAT2 -> NFD2_GB */
|
||||
sg_set_pinsel(27, 0); /* MMCDAT3 -> NFD3_GB */
|
||||
sg_set_pinsel(28, 0); /* MMCDAT4 -> NFD4_GB */
|
||||
sg_set_pinsel(29, 0); /* MMCDAT5 -> NFD5_GB */
|
||||
sg_set_pinsel(30, 0); /* MMCDAT6 -> NFD6_GB */
|
||||
sg_set_pinsel(31, 0); /* MMCDAT7 -> NFD7_GB */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_EHCI_UNIPHIER
|
||||
sg_set_pinsel(53, 0); /* USB0VBUS -> USB0VBUS */
|
||||
sg_set_pinsel(54, 0); /* USB0OD -> USB0OD */
|
||||
sg_set_pinsel(55, 0); /* USB1VBUS -> USB1VBUS */
|
||||
sg_set_pinsel(56, 0); /* USB1OD -> USB1OD */
|
||||
/* sg_set_pinsel(67, 23); */ /* PCOE -> USB2VBUS */
|
||||
/* sg_set_pinsel(68, 23); */ /* PCWAIT -> USB2OD */
|
||||
#endif
|
||||
|
||||
tmp = readl(SG_IECTRL);
|
||||
tmp |= 0x41;
|
||||
writel(tmp, SG_IECTRL);
|
||||
}
|
||||
189
arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c
Normal file
189
arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_init.c
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
#undef DPLL_SSC_RATE_1PER
|
||||
|
||||
void dpll_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/*
|
||||
* Set Frequency
|
||||
* Set 0xc(1600MHz)/0xd(1333MHz)/0xe(1066MHz)
|
||||
* to FOUT (DPLLCTRL.bit[29:20])
|
||||
*/
|
||||
tmp = readl(SC_DPLLCTRL);
|
||||
tmp &= ~0x000f0000;
|
||||
#if CONFIG_DDR_FREQ == 1600
|
||||
tmp |= 0x000c0000;
|
||||
#elif CONFIG_DDR_FREQ == 1333
|
||||
tmp |= 0x000d0000;
|
||||
#else
|
||||
# error "Unknown frequency"
|
||||
#endif
|
||||
|
||||
#if defined(DPLL_SSC_RATE_1PER)
|
||||
tmp &= ~SC_DPLLCTRL_SSC_RATE;
|
||||
#else
|
||||
tmp |= SC_DPLLCTRL_SSC_RATE;
|
||||
#endif
|
||||
writel(tmp, SC_DPLLCTRL);
|
||||
|
||||
tmp = readl(SC_DPLLCTRL2);
|
||||
tmp |= SC_DPLLCTRL2_NRSTDS;
|
||||
writel(tmp, SC_DPLLCTRL2);
|
||||
}
|
||||
|
||||
void upll_init(void)
|
||||
{
|
||||
u32 tmp, clk_mode_upll, clk_mode_axosel;
|
||||
|
||||
tmp = readl(SG_PINMON0);
|
||||
clk_mode_upll = tmp & SG_PINMON0_CLK_MODE_UPLLSRC_MASK;
|
||||
clk_mode_axosel = tmp & SG_PINMON0_CLK_MODE_AXOSEL_MASK;
|
||||
|
||||
/* set 0 to SNRT(UPLLCTRL.bit28) and K_LD(UPLLCTRL.bit[27]) */
|
||||
tmp = readl(SC_UPLLCTRL);
|
||||
tmp &= ~0x18000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
if (clk_mode_upll == SG_PINMON0_CLK_MODE_UPLLSRC_DEFAULT) {
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A) {
|
||||
/* AXO: 25MHz */
|
||||
tmp &= ~0x07ffffff;
|
||||
tmp |= 0x0228f5c0;
|
||||
} else {
|
||||
/* AXO: default 24.576MHz */
|
||||
tmp &= ~0x07ffffff;
|
||||
tmp |= 0x02328000;
|
||||
}
|
||||
}
|
||||
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
/* set 1 to K_LD(UPLLCTRL.bit[27]) */
|
||||
tmp |= 0x08000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
/* wait 10 usec */
|
||||
udelay(10);
|
||||
|
||||
/* set 1 to SNRT(UPLLCTRL.bit[28]) */
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
}
|
||||
|
||||
void vpll_init(void)
|
||||
{
|
||||
u32 tmp, clk_mode_axosel;
|
||||
|
||||
tmp = readl(SG_PINMON0);
|
||||
clk_mode_axosel = tmp & SG_PINMON0_CLK_MODE_AXOSEL_MASK;
|
||||
|
||||
/* set 1 to VPLA27WP and VPLA27WP */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
|
||||
/* Set 0 to VPLA_K_LD and VPLB_K_LD */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* Set 0 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
/* Set 0x20 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A) {
|
||||
/* AXO: 25MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066664;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066664;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
} else {
|
||||
/* AXO: default 24.576MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
}
|
||||
|
||||
/* Set 1 to VPLA_K_LD and VPLB_K_LD */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* wait 10 usec */
|
||||
udelay(10);
|
||||
|
||||
/* Set 0 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
/* set 0 to VPLA27WP and VPLA27WP */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp &= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp |= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
}
|
||||
|
||||
void pll_init(void)
|
||||
{
|
||||
dpll_init();
|
||||
upll_init();
|
||||
vpll_init();
|
||||
|
||||
/*
|
||||
* Wait 500 usec until dpll get stable
|
||||
* We wait 10 usec in upll_init() and vpll_init()
|
||||
* so 20 usec can be saved here.
|
||||
*/
|
||||
udelay(480);
|
||||
}
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-ld4/pll_spectrum.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-pro4/pll_spectrum.c"
|
||||
44
arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c
Normal file
44
arch/arm/cpu/armv7/uniphier/ph1-ld4/sbc_init.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void sbc_init(void)
|
||||
{
|
||||
/* XECS1: sub/boot memory (boot swap = off/on) */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL10);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL11);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL12);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL14);
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
/* XECS0: boot/sub memory (boot swap = off/on) */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL00);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL01);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL02);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL04);
|
||||
#endif
|
||||
/* XECS3: peripherals */
|
||||
writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL30);
|
||||
writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL31);
|
||||
writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL32);
|
||||
writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL34);
|
||||
|
||||
/* base address regsiters */
|
||||
writel(0x0000bc01, SBBASE0);
|
||||
writel(0x0400bc01, SBBASE1);
|
||||
writel(0x0800bf01, SBBASE3);
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
/* enable access to sub memory when boot swap is on */
|
||||
sg_set_pinsel(155, 1); /* PORT24 -> XECS0 */
|
||||
#endif
|
||||
sg_set_pinsel(156, 1); /* PORT25 -> XECS3 */
|
||||
}
|
||||
28
arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
Normal file
28
arch/arm/cpu/armv7/uniphier/ph1-ld4/sg_init.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void sg_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* Set DDR size */
|
||||
tmp = sg_memconf_val_ch0(CONFIG_SDRAM0_SIZE, CONFIG_DDR_NUM_CH0);
|
||||
tmp |= sg_memconf_val_ch1(CONFIG_SDRAM1_SIZE, CONFIG_DDR_NUM_CH1);
|
||||
#if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE < CONFIG_SDRAM1_BASE
|
||||
tmp |= SG_MEMCONF_SPARSEMEM;
|
||||
#endif
|
||||
writel(tmp, SG_MEMCONF);
|
||||
|
||||
/* Input ports must be enabled deasserting reset of cores */
|
||||
tmp = readl(SG_IECTRL);
|
||||
tmp |= 0x1;
|
||||
writel(tmp, SG_IECTRL);
|
||||
}
|
||||
162
arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
Normal file
162
arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/umc-regs.h>
|
||||
|
||||
static inline void umc_start_ssif(void __iomem *ssif_base)
|
||||
{
|
||||
writel(0x00000000, ssif_base + 0x0000b004);
|
||||
writel(0xffffffff, ssif_base + 0x0000c004);
|
||||
writel(0x000fffcf, ssif_base + 0x0000c008);
|
||||
writel(0x00000001, ssif_base + 0x0000b000);
|
||||
writel(0x00000001, ssif_base + 0x0000c000);
|
||||
writel(0x03010101, ssif_base + UMC_MDMCHSEL);
|
||||
writel(0x03010100, ssif_base + UMC_DMDCHSEL);
|
||||
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_FETCH);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_WC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_RC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_DST);
|
||||
|
||||
writel(0x00000001, ssif_base + UMC_CPURST);
|
||||
writel(0x00000001, ssif_base + UMC_IDSRST);
|
||||
writel(0x00000001, ssif_base + UMC_IXMRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDMRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDDRST);
|
||||
writel(0x00000001, ssif_base + UMC_SIORST);
|
||||
writel(0x00000001, ssif_base + UMC_VIORST);
|
||||
writel(0x00000001, ssif_base + UMC_FRCRST);
|
||||
writel(0x00000001, ssif_base + UMC_RGLRST);
|
||||
writel(0x00000001, ssif_base + UMC_AIORST);
|
||||
writel(0x00000001, ssif_base + UMC_DMDRST);
|
||||
}
|
||||
|
||||
void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
|
||||
int size, int freq)
|
||||
{
|
||||
if (freq == 1333) {
|
||||
writel(0x45990b11, dramcont + UMC_CMDCTLA);
|
||||
writel(0x16958924, dramcont + UMC_CMDCTLB);
|
||||
writel(0x5101046A, dramcont + UMC_INITCTLA);
|
||||
|
||||
if (size == 1)
|
||||
writel(0x27028B0A, dramcont + UMC_INITCTLB);
|
||||
else if (size == 2)
|
||||
writel(0x38028B0A, dramcont + UMC_INITCTLB);
|
||||
|
||||
writel(0x000FF0FF, dramcont + UMC_INITCTLC);
|
||||
writel(0x00000b51, dramcont + UMC_DRMMR0);
|
||||
} else if (freq == 1600) {
|
||||
writel(0x36BB0F17, dramcont + UMC_CMDCTLA);
|
||||
writel(0x18C6AA24, dramcont + UMC_CMDCTLB);
|
||||
writel(0x5101387F, dramcont + UMC_INITCTLA);
|
||||
|
||||
if (size == 1)
|
||||
writel(0x2F030D3F, dramcont + UMC_INITCTLB);
|
||||
else if (size == 2)
|
||||
writel(0x43030D3F, dramcont + UMC_INITCTLB);
|
||||
|
||||
writel(0x00FF00FF, dramcont + UMC_INITCTLC);
|
||||
writel(0x00000d71, dramcont + UMC_DRMMR0);
|
||||
}
|
||||
|
||||
writel(0x00000006, dramcont + UMC_DRMMR1);
|
||||
|
||||
if (freq == 1333)
|
||||
writel(0x00000290, dramcont + UMC_DRMMR2);
|
||||
else if (freq == 1600)
|
||||
writel(0x00000298, dramcont + UMC_DRMMR2);
|
||||
|
||||
writel(0x00000800, dramcont + UMC_DRMMR3);
|
||||
|
||||
if (freq == 1333) {
|
||||
if (size == 1)
|
||||
writel(0x00240512, dramcont + UMC_SPCCTLA);
|
||||
else if (size == 2)
|
||||
writel(0x00350512, dramcont + UMC_SPCCTLA);
|
||||
|
||||
writel(0x00ff0006, dramcont + UMC_SPCCTLB);
|
||||
writel(0x000a00ac, dramcont + UMC_RDATACTL_D0);
|
||||
} else if (freq == 1600) {
|
||||
if (size == 1)
|
||||
writel(0x002B0617, dramcont + UMC_SPCCTLA);
|
||||
else if (size == 2)
|
||||
writel(0x003F0617, dramcont + UMC_SPCCTLA);
|
||||
|
||||
writel(0x00ff0008, dramcont + UMC_SPCCTLB);
|
||||
writel(0x000c00ae, dramcont + UMC_RDATACTL_D0);
|
||||
}
|
||||
|
||||
writel(0x04060806, dramcont + UMC_WDATACTL_D0);
|
||||
writel(0x04a02000, dramcont + UMC_DATASET);
|
||||
writel(0x00000000, ca_base + 0x2300);
|
||||
writel(0x00400020, dramcont + UMC_DCCGCTL);
|
||||
writel(0x00000003, dramcont + 0x7000);
|
||||
writel(0x0000000f, dramcont + 0x8000);
|
||||
writel(0x000000c3, dramcont + 0x8004);
|
||||
writel(0x00000071, dramcont + 0x8008);
|
||||
writel(0x0000003b, dramcont + UMC_DICGCTLA);
|
||||
writel(0x020a0808, dramcont + UMC_DICGCTLB);
|
||||
writel(0x00000004, dramcont + UMC_FLOWCTLG);
|
||||
writel(0x80000201, ca_base + 0xc20);
|
||||
writel(0x0801e01e, dramcont + UMC_FLOWCTLA);
|
||||
writel(0x00200000, dramcont + UMC_FLOWCTLB);
|
||||
writel(0x00004444, dramcont + UMC_FLOWCTLC);
|
||||
writel(0x200a0a00, dramcont + UMC_SPCSETB);
|
||||
writel(0x00000000, dramcont + UMC_SPCSETD);
|
||||
writel(0x00000520, dramcont + UMC_DFICUPDCTLA);
|
||||
}
|
||||
|
||||
static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
|
||||
{
|
||||
void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
|
||||
void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
|
||||
void __iomem *ca_base1 = (void __iomem *)UMC_CA_BASE(1);
|
||||
void __iomem *dramcont0 = (void __iomem *)UMC_DRAMCONT_BASE(0);
|
||||
void __iomem *dramcont1 = (void __iomem *)UMC_DRAMCONT_BASE(1);
|
||||
|
||||
umc_dram_init_start(dramcont0);
|
||||
umc_dram_init_start(dramcont1);
|
||||
umc_dram_init_poll(dramcont0);
|
||||
umc_dram_init_poll(dramcont1);
|
||||
|
||||
writel(0x00000101, dramcont0 + UMC_DIOCTLA);
|
||||
|
||||
writel(0x00000101, dramcont1 + UMC_DIOCTLA);
|
||||
|
||||
umc_dramcont_init(dramcont0, ca_base0, size_ch0, freq);
|
||||
umc_dramcont_init(dramcont1, ca_base1, size_ch1, freq);
|
||||
|
||||
umc_start_ssif(ssif_base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int umc_init(void)
|
||||
{
|
||||
return umc_init_sub(CONFIG_DDR_FREQ, CONFIG_SDRAM0_SIZE / 0x08000000,
|
||||
CONFIG_SDRAM1_SIZE / 0x08000000);
|
||||
}
|
||||
|
||||
#if CONFIG_DDR_FREQ != 1333 && CONFIG_DDR_FREQ != 1600
|
||||
#error Unsupported DDR Frequency.
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SDRAM0_SIZE == 0x08000000 || CONFIG_SDRAM0_SIZE == 0x10000000) && \
|
||||
(CONFIG_SDRAM1_SIZE == 0x08000000 || CONFIG_SDRAM1_SIZE == 0x10000000) && \
|
||||
CONFIG_DDR_NUM_CH0 == 1 && CONFIG_DDR_NUM_CH1 == 1
|
||||
/* OK */
|
||||
#else
|
||||
#error Unsupported DDR configuration.
|
||||
#endif
|
||||
10
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
Normal file
10
arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-y += boot-mode.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o sbc_init.o \
|
||||
sg_init.o pll_init.o clkrst_init.o pinctrl.o
|
||||
obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
|
||||
umc_init.o
|
||||
16
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c
Normal file
16
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_info.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
puts("Board: PH1-Pro4 Board\n");
|
||||
|
||||
return check_support_card();
|
||||
}
|
||||
39
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
Normal file
39
arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void sbc_init(void);
|
||||
void sg_init(void);
|
||||
void pll_init(void);
|
||||
void pin_init(void);
|
||||
void clkrst_init(void);
|
||||
|
||||
int board_postclk_init(void)
|
||||
{
|
||||
sbc_init();
|
||||
|
||||
sg_init();
|
||||
|
||||
pll_init();
|
||||
|
||||
uniphier_board_init();
|
||||
|
||||
led_write(B, 1, , );
|
||||
|
||||
clkrst_init();
|
||||
|
||||
led_write(B, 2, , );
|
||||
|
||||
pin_init();
|
||||
|
||||
led_write(B, 3, , );
|
||||
|
||||
return 0;
|
||||
}
|
||||
66
arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c
Normal file
66
arch/arm/cpu/armv7/uniphier/ph1-pro4/boot-mode.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/boot-device.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
|
||||
struct boot_device_info boot_device_table[] = {
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 128KB, Addr 4)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 128KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 128KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 256KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 256KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, EraseSize 512KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, EraseSize 512KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 24, EraseSize 1MB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 4, ECC 24, EraseSize 1MB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 128KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 128KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 256KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 256KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, EraseSize 512KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, EraseSize 512KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 24, EraseSize 512KB, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, ONFI, Addr 4)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 8, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 16, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 8, ECC 24, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 4, ECC 24, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 8, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 16, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_NAND, "NAND (Mirror 1, ECC 24, ONFI, Addr 5)"},
|
||||
{BOOT_DEVICE_MMC1, "eMMC Boot (3.3V)"},
|
||||
{BOOT_DEVICE_MMC1, "eMMC Boot (1.8V)"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, ""}
|
||||
};
|
||||
|
||||
u32 get_boot_mode_sel(void)
|
||||
{
|
||||
return (readl(SG_PINMON0) >> 1) & 0x1f;
|
||||
}
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
u32 boot_mode;
|
||||
|
||||
if (boot_is_swapped())
|
||||
return BOOT_DEVICE_NOR;
|
||||
|
||||
boot_mode = get_boot_mode_sel();
|
||||
|
||||
return boot_device_table[boot_mode].type;
|
||||
}
|
||||
29
arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c
Normal file
29
arch/arm/cpu/armv7/uniphier/ph1-pro4/clkrst_init.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
|
||||
void clkrst_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* deassert reset */
|
||||
tmp = readl(SC_RSTCTRL);
|
||||
tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
|
||||
| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
|
||||
writel(tmp, SC_RSTCTRL);
|
||||
readl(SC_RSTCTRL); /* dummy read */
|
||||
|
||||
/* privide clocks */
|
||||
tmp = readl(SC_CLKCTRL);
|
||||
tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
|
||||
| SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
|
||||
writel(tmp, SC_CLKCTRL);
|
||||
readl(SC_CLKCTRL); /* dummy read */
|
||||
}
|
||||
45
arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c
Normal file
45
arch/arm/cpu/armv7/uniphier/ph1-pro4/pinctrl.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void pin_init(void)
|
||||
{
|
||||
/* Comment format: PAD Name -> Function Name */
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_SERIAL
|
||||
sg_set_pinsel(127, 0); /* RXD0 -> RXD0 */
|
||||
sg_set_pinsel(128, 0); /* TXD0 -> TXD0 */
|
||||
sg_set_pinsel(129, 0); /* RXD1 -> RXD1 */
|
||||
sg_set_pinsel(130, 0); /* TXD1 -> TXD1 */
|
||||
sg_set_pinsel(131, 0); /* RXD2 -> RXD2 */
|
||||
sg_set_pinsel(132, 0); /* TXD2 -> TXD2 */
|
||||
sg_set_pinsel(88, 2); /* CH6CLK -> RXD3 */
|
||||
sg_set_pinsel(89, 2); /* CH6VAL -> TXD3 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NAND_DENALI
|
||||
sg_set_pinsel(40, 0); /* NFD0 -> NFD0 */
|
||||
sg_set_pinsel(41, 0); /* NFD1 -> NFD1 */
|
||||
sg_set_pinsel(42, 0); /* NFD2 -> NFD2 */
|
||||
sg_set_pinsel(43, 0); /* NFD3 -> NFD3 */
|
||||
sg_set_pinsel(44, 0); /* NFD4 -> NFD4 */
|
||||
sg_set_pinsel(45, 0); /* NFD5 -> NFD5 */
|
||||
sg_set_pinsel(46, 0); /* NFD6 -> NFD6 */
|
||||
sg_set_pinsel(47, 0); /* NFD7 -> NFD7 */
|
||||
sg_set_pinsel(48, 0); /* NFALE -> NFALE */
|
||||
sg_set_pinsel(49, 0); /* NFCLE -> NFCLE */
|
||||
sg_set_pinsel(50, 0); /* XNFRE -> XNFRE */
|
||||
sg_set_pinsel(51, 0); /* XNFWE -> XNFWE */
|
||||
sg_set_pinsel(52, 0); /* XNFWP -> XNFWP */
|
||||
sg_set_pinsel(53, 0); /* XNFCE0 -> XNFCE0 */
|
||||
sg_set_pinsel(54, 0); /* NRYBY0 -> NRYBY0 */
|
||||
#endif
|
||||
|
||||
writel(1, SG_LOADPINCTRL);
|
||||
}
|
||||
168
arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c
Normal file
168
arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_init.c
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
#undef DPLL_SSC_RATE_1PER
|
||||
|
||||
void dpll_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/*
|
||||
* Set Frequency
|
||||
* Set 0xc(1600MHz)/0xd(1333MHz)/0xe(1066MHz)
|
||||
* to FOUT ( DPLLCTRL.bit[29:20] )
|
||||
*/
|
||||
tmp = readl(SC_DPLLCTRL);
|
||||
tmp &= ~(0x000f0000);
|
||||
#if CONFIG_DDR_FREQ == 1600
|
||||
tmp |= 0x000c0000;
|
||||
#elif CONFIG_DDR_FREQ == 1333
|
||||
tmp |= 0x000d0000;
|
||||
#else
|
||||
# error "Unsupported frequency"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set Moduration rate
|
||||
* Set 0x0(1%)/0x1(2%) to SSC_RATE(DPLLCTRL.bit[15])
|
||||
*/
|
||||
#if defined(DPLL_SSC_RATE_1PER)
|
||||
tmp &= ~0x00008000;
|
||||
#else
|
||||
tmp |= 0x00008000;
|
||||
#endif
|
||||
writel(tmp, SC_DPLLCTRL);
|
||||
|
||||
tmp = readl(SC_DPLLCTRL2);
|
||||
tmp |= SC_DPLLCTRL2_NRSTDS;
|
||||
writel(tmp, SC_DPLLCTRL2);
|
||||
}
|
||||
|
||||
void stop_mpll(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
tmp = readl(SC_MPLLOSCCTL);
|
||||
|
||||
if (!(tmp & SC_MPLLOSCCTL_MPLLST))
|
||||
return; /* already stopped */
|
||||
|
||||
tmp &= ~SC_MPLLOSCCTL_MPLLEN;
|
||||
writel(tmp, SC_MPLLOSCCTL);
|
||||
|
||||
while (readl(SC_MPLLOSCCTL) & SC_MPLLOSCCTL_MPLLST)
|
||||
;
|
||||
}
|
||||
|
||||
void vpll_init(void)
|
||||
{
|
||||
u32 tmp, clk_mode_axosel;
|
||||
|
||||
/* Set VPLL27A & VPLL27B */
|
||||
tmp = readl(SG_PINMON0);
|
||||
clk_mode_axosel = tmp & SG_PINMON0_CLK_MODE_AXOSEL_MASK;
|
||||
|
||||
#if defined(CONFIG_MACH_PH1_PRO4)
|
||||
/* 25MHz or 6.25MHz is default for Pro4R, no need to set VPLLA/B */
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_6250KHZ)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* Disable write protect of VPLL27ACTRL[2-7]*, VPLL27BCTRL[2-8] */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
|
||||
/* Unset VPLA_K_LD and VPLB_K_LD bit */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* Set VPLA_M and VPLB_M to 0x20 */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_6250KHZ) {
|
||||
/* Set VPLA_K and VPLB_K for AXO: 25MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066666;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066666;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
} else {
|
||||
/* Set VPLA_K and VPLB_K for AXO: 24.576 MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
}
|
||||
|
||||
/* wait 1 usec */
|
||||
udelay(1);
|
||||
|
||||
/* Set VPLA_K_LD and VPLB_K_LD to load K parameters */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* Unset VPLA_SNRST and VPLB_SNRST bit */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
/* Enable write protect of VPLL27ACTRL[2-7]*, VPLL27BCTRL[2-8] */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp &= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp &= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
}
|
||||
|
||||
void pll_init(void)
|
||||
{
|
||||
dpll_init();
|
||||
stop_mpll();
|
||||
vpll_init();
|
||||
|
||||
/*
|
||||
* Wait 500 usec until dpll get stable
|
||||
* We wait 1 usec in vpll_init() so 1 usec can be saved here.
|
||||
*/
|
||||
udelay(499);
|
||||
}
|
||||
18
arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c
Normal file
18
arch/arm/cpu/armv7/uniphier/ph1-pro4/pll_spectrum.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
|
||||
void enable_dpll_ssc(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
tmp = readl(SC_DPLLCTRL);
|
||||
tmp |= SC_DPLLCTRL_SSC_EN;
|
||||
writel(tmp, SC_DPLLCTRL);
|
||||
}
|
||||
75
arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c
Normal file
75
arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void sbc_init(void)
|
||||
{
|
||||
#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD)
|
||||
/*
|
||||
* Only CS1 is connected to support card.
|
||||
* BKSZ[1:0] should be set to "01".
|
||||
*/
|
||||
writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL10);
|
||||
writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL11);
|
||||
writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL12);
|
||||
writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL14);
|
||||
|
||||
if (readl(SBBASE0) & 0x1) {
|
||||
/*
|
||||
* Boot Swap Off: boot from mask ROM
|
||||
* 0x00000000-0x01ffffff: mask ROM
|
||||
* 0x02000000-0x3effffff: memory bank (31MB)
|
||||
* 0x03f00000-0x3fffffff: peripherals (1MB)
|
||||
*/
|
||||
writel(0x0000be01, SBBASE0); /* dummy */
|
||||
writel(0x0200be01, SBBASE1);
|
||||
} else {
|
||||
/*
|
||||
* Boot Swap On: boot from external NOR/SRAM
|
||||
* 0x02000000-0x03ffffff is a mirror of 0x00000000-0x01ffffff.
|
||||
*
|
||||
* 0x00000000-0x01efffff, 0x02000000-0x03efffff: memory bank
|
||||
* 0x01f00000-0x01ffffff, 0x03f00000-0x03ffffff: peripherals
|
||||
*/
|
||||
writel(0x0000bc01, SBBASE0);
|
||||
}
|
||||
#elif defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
/* XECS0: boot/sub memory (boot swap = off/on) */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL00);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL01);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL02);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL04);
|
||||
#endif
|
||||
/* XECS1: sub/boot memory (boot swap = off/on) */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL10);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL11);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL12);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL14);
|
||||
|
||||
/* XECS3: peripherals */
|
||||
writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL30);
|
||||
writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL31);
|
||||
writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL32);
|
||||
writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL34);
|
||||
|
||||
writel(0x0000bc01, SBBASE0); /* boot memory */
|
||||
writel(0x0400bc01, SBBASE1); /* sub memory */
|
||||
writel(0x0800bf01, SBBASE3); /* peripherals */
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
sg_set_pinsel(318, 5); /* PORT22 -> XECS0 */
|
||||
#endif
|
||||
sg_set_pinsel(313, 5); /* PORT15 -> XECS3 */
|
||||
writel(0x00000001, SG_LOADPINCTRL);
|
||||
|
||||
#endif /* CONFIG_XXX_MICRO_SUPPORT_CARD */
|
||||
}
|
||||
28
arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c
Normal file
28
arch/arm/cpu/armv7/uniphier/ph1-pro4/sg_init.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void sg_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* Set DDR size */
|
||||
tmp = sg_memconf_val_ch0(CONFIG_SDRAM0_SIZE, CONFIG_DDR_NUM_CH0);
|
||||
tmp |= sg_memconf_val_ch1(CONFIG_SDRAM1_SIZE, CONFIG_DDR_NUM_CH1);
|
||||
#if CONFIG_SDRAM0_BASE + CONFIG_SDRAM0_SIZE < CONFIG_SDRAM1_BASE
|
||||
tmp |= SG_MEMCONF_SPARSEMEM;
|
||||
#endif
|
||||
writel(tmp, SG_MEMCONF);
|
||||
|
||||
/* Input ports must be enabled deasserting reset of cores */
|
||||
tmp = readl(SG_IECTRL);
|
||||
tmp |= 0x1;
|
||||
writel(tmp, SG_IECTRL);
|
||||
}
|
||||
136
arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
Normal file
136
arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/umc-regs.h>
|
||||
|
||||
static inline void umc_start_ssif(void __iomem *ssif_base)
|
||||
{
|
||||
writel(0x00000001, ssif_base + 0x0000b004);
|
||||
writel(0xffffffff, ssif_base + 0x0000c004);
|
||||
writel(0x07ffffff, ssif_base + 0x0000c008);
|
||||
writel(0x00000001, ssif_base + 0x0000b000);
|
||||
writel(0x00000001, ssif_base + 0x0000c000);
|
||||
|
||||
writel(0x03010100, ssif_base + UMC_HDMCHSEL);
|
||||
writel(0x03010101, ssif_base + UMC_MDMCHSEL);
|
||||
writel(0x03010100, ssif_base + UMC_DVCCHSEL);
|
||||
writel(0x03010100, ssif_base + UMC_DMDCHSEL);
|
||||
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_FETCH);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_WC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_RC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_DST);
|
||||
writel(0x00000000, ssif_base + 0x0000c044); /* DCGIV_SSIF_REG */
|
||||
|
||||
writel(0x00000001, ssif_base + UMC_CPURST);
|
||||
writel(0x00000001, ssif_base + UMC_IDSRST);
|
||||
writel(0x00000001, ssif_base + UMC_IXMRST);
|
||||
writel(0x00000001, ssif_base + UMC_HDMRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDMRST);
|
||||
writel(0x00000001, ssif_base + UMC_HDDRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDDRST);
|
||||
writel(0x00000001, ssif_base + UMC_SIORST);
|
||||
writel(0x00000001, ssif_base + UMC_GIORST);
|
||||
writel(0x00000001, ssif_base + UMC_HD2RST);
|
||||
writel(0x00000001, ssif_base + UMC_VIORST);
|
||||
writel(0x00000001, ssif_base + UMC_DVCRST);
|
||||
writel(0x00000001, ssif_base + UMC_RGLRST);
|
||||
writel(0x00000001, ssif_base + UMC_VPERST);
|
||||
writel(0x00000001, ssif_base + UMC_AIORST);
|
||||
writel(0x00000001, ssif_base + UMC_DMDRST);
|
||||
}
|
||||
|
||||
void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
|
||||
int size, int freq)
|
||||
{
|
||||
writel(0x66bb0f17, dramcont + UMC_CMDCTLA);
|
||||
writel(0x18c6aa44, dramcont + UMC_CMDCTLB);
|
||||
writel(0x5101387f, dramcont + UMC_INITCTLA);
|
||||
writel(0x43030d3f, dramcont + UMC_INITCTLB);
|
||||
writel(0x00ff00ff, dramcont + UMC_INITCTLC);
|
||||
writel(0x00000d71, dramcont + UMC_DRMMR0);
|
||||
writel(0x00000006, dramcont + UMC_DRMMR1);
|
||||
writel(0x00000298, dramcont + UMC_DRMMR2);
|
||||
writel(0x00000000, dramcont + UMC_DRMMR3);
|
||||
writel(0x003f0617, dramcont + UMC_SPCCTLA);
|
||||
writel(0x00ff0008, dramcont + UMC_SPCCTLB);
|
||||
writel(0x000c00ae, dramcont + UMC_RDATACTL_D0);
|
||||
writel(0x000c00ae, dramcont + UMC_RDATACTL_D1);
|
||||
writel(0x04060802, dramcont + UMC_WDATACTL_D0);
|
||||
writel(0x04060802, dramcont + UMC_WDATACTL_D1);
|
||||
writel(0x04a02000, dramcont + UMC_DATASET);
|
||||
writel(0x00000000, ca_base + 0x2300);
|
||||
writel(0x00400020, dramcont + UMC_DCCGCTL);
|
||||
writel(0x0000000f, dramcont + 0x7000);
|
||||
writel(0x0000000f, dramcont + 0x8000);
|
||||
writel(0x000000c3, dramcont + 0x8004);
|
||||
writel(0x00000071, dramcont + 0x8008);
|
||||
writel(0x00000004, dramcont + UMC_FLOWCTLG);
|
||||
writel(0x00000000, dramcont + 0x0060);
|
||||
writel(0x80000201, ca_base + 0xc20);
|
||||
writel(0x0801e01e, dramcont + UMC_FLOWCTLA);
|
||||
writel(0x00200000, dramcont + UMC_FLOWCTLB);
|
||||
writel(0x00004444, dramcont + UMC_FLOWCTLC);
|
||||
writel(0x200a0a00, dramcont + UMC_SPCSETB);
|
||||
writel(0x00010000, dramcont + UMC_SPCSETD);
|
||||
writel(0x80000020, dramcont + UMC_DFICUPDCTLA);
|
||||
}
|
||||
|
||||
static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
|
||||
{
|
||||
void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
|
||||
void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
|
||||
void __iomem *ca_base1 = (void __iomem *)UMC_CA_BASE(1);
|
||||
void __iomem *dramcont0 = (void __iomem *)UMC_DRAMCONT_BASE(0);
|
||||
void __iomem *dramcont1 = (void __iomem *)UMC_DRAMCONT_BASE(1);
|
||||
|
||||
umc_dram_init_start(dramcont0);
|
||||
umc_dram_init_start(dramcont1);
|
||||
umc_dram_init_poll(dramcont0);
|
||||
umc_dram_init_poll(dramcont1);
|
||||
|
||||
writel(0x00000101, dramcont0 + UMC_DIOCTLA);
|
||||
|
||||
writel(0x00000103, dramcont0 + UMC_DIOCTLA);
|
||||
|
||||
writel(0x00000101, dramcont1 + UMC_DIOCTLA);
|
||||
|
||||
writel(0x00000103, dramcont1 + UMC_DIOCTLA);
|
||||
|
||||
umc_dramcont_init(dramcont0, ca_base0, size_ch0, freq);
|
||||
umc_dramcont_init(dramcont1, ca_base1, size_ch1, freq);
|
||||
|
||||
umc_start_ssif(ssif_base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int umc_init(void)
|
||||
{
|
||||
return umc_init_sub(CONFIG_DDR_FREQ, CONFIG_SDRAM0_SIZE / 0x08000000,
|
||||
CONFIG_SDRAM1_SIZE / 0x08000000);
|
||||
}
|
||||
|
||||
#if CONFIG_DDR_FREQ != 1600
|
||||
#error Unsupported DDR frequency.
|
||||
#endif
|
||||
|
||||
#if ((CONFIG_SDRAM0_SIZE == 0x20000000 && CONFIG_DDR_NUM_CH0 == 2) || \
|
||||
(CONFIG_SDRAM0_SIZE == 0x10000000 && CONFIG_DDR_NUM_CH0 == 1)) && \
|
||||
((CONFIG_SDRAM1_SIZE == 0x20000000 && CONFIG_DDR_NUM_CH1 == 2) || \
|
||||
(CONFIG_SDRAM1_SIZE == 0x10000000 && CONFIG_DDR_NUM_CH1 == 1))
|
||||
/* OK */
|
||||
#else
|
||||
#error Unsupported DDR configuration.
|
||||
#endif
|
||||
10
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
Normal file
10
arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-y += boot-mode.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \
|
||||
sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o
|
||||
obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \
|
||||
umc_init.o
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/bcu_init.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-ld4/bcu_init.c"
|
||||
16
arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c
Normal file
16
arch/arm/cpu/armv7/uniphier/ph1-sld8/board_info.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
puts("Board: PH1-sLD8 Board\n");
|
||||
|
||||
return check_support_card();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
#include "../ph1-ld4/board_postclk_init.c"
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/boot-mode.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-pro4/boot-mode.c"
|
||||
29
arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c
Normal file
29
arch/arm/cpu/armv7/uniphier/ph1-sld8/clkrst_init.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
|
||||
void clkrst_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
/* deassert reset */
|
||||
tmp = readl(SC_RSTCTRL);
|
||||
tmp |= SC_RSTCTRL_NRST_ETHER | SC_RSTCTRL_NRST_UMC1
|
||||
| SC_RSTCTRL_NRST_UMC0 | SC_RSTCTRL_NRST_NAND;
|
||||
writel(tmp, SC_RSTCTRL);
|
||||
readl(SC_RSTCTRL); /* dummy read */
|
||||
|
||||
/* privide clocks */
|
||||
tmp = readl(SC_CLKCTRL);
|
||||
tmp |= SC_CLKCTRL_CLK_ETHER | SC_CLKCTRL_CLK_MIO | SC_CLKCTRL_CLK_UMC
|
||||
| SC_CLKCTRL_CLK_NAND | SC_CLKCTRL_CLK_SBC | SC_CLKCTRL_CLK_PERI;
|
||||
writel(tmp, SC_CLKCTRL);
|
||||
readl(SC_CLKCTRL); /* dummy read */
|
||||
}
|
||||
57
arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c
Normal file
57
arch/arm/cpu/armv7/uniphier/ph1-sld8/pinctrl.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void pin_init(void)
|
||||
{
|
||||
/* Comment format: PAD Name -> Function Name */
|
||||
|
||||
#ifdef CONFIG_UNIPHIER_SERIAL
|
||||
sg_set_pinsel(70, 3); /* HDDOUT0 -> TXD0 */
|
||||
sg_set_pinsel(71, 3); /* HSDOUT1 -> RXD0 */
|
||||
|
||||
sg_set_pinsel(114, 0); /* TXD1 -> TXD1 */
|
||||
sg_set_pinsel(115, 0); /* RXD1 -> RXD1 */
|
||||
|
||||
sg_set_pinsel(112, 1); /* SBO1 -> TXD2 */
|
||||
sg_set_pinsel(113, 1); /* SBI1 -> RXD2 */
|
||||
|
||||
sg_set_pinsel(110, 1); /* SBO0 -> TXD3 */
|
||||
sg_set_pinsel(111, 1); /* SBI0 -> RXD3 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NAND_DENALI
|
||||
sg_set_pinsel(15, 0); /* XNFRE_GB -> XNFRE_GB */
|
||||
sg_set_pinsel(16, 0); /* XNFWE_GB -> XNFWE_GB */
|
||||
sg_set_pinsel(17, 0); /* XFALE_GB -> NFALE_GB */
|
||||
sg_set_pinsel(18, 0); /* XFCLE_GB -> NFCLE_GB */
|
||||
sg_set_pinsel(19, 0); /* XNFWP_GB -> XFNWP_GB */
|
||||
sg_set_pinsel(20, 0); /* XNFCE0_GB -> XNFCE0_GB */
|
||||
sg_set_pinsel(21, 0); /* NANDRYBY0_GB -> NANDRYBY0_GB */
|
||||
sg_set_pinsel(22, 0); /* XFNCE1_GB -> XFNCE1_GB */
|
||||
sg_set_pinsel(23, 0); /* NANDRYBY1_GB -> NANDRYBY1_GB */
|
||||
sg_set_pinsel(24, 0); /* NFD0_GB -> NFD0_GB */
|
||||
sg_set_pinsel(25, 0); /* NFD1_GB -> NFD1_GB */
|
||||
sg_set_pinsel(26, 0); /* NFD2_GB -> NFD2_GB */
|
||||
sg_set_pinsel(27, 0); /* NFD3_GB -> NFD3_GB */
|
||||
sg_set_pinsel(28, 0); /* NFD4_GB -> NFD4_GB */
|
||||
sg_set_pinsel(29, 0); /* NFD5_GB -> NFD5_GB */
|
||||
sg_set_pinsel(30, 0); /* NFD6_GB -> NFD6_GB */
|
||||
sg_set_pinsel(31, 0); /* NFD7_GB -> NFD7_GB */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_EHCI_UNIPHIER
|
||||
sg_set_pinsel(41, 0); /* USB0VBUS -> USB0VBUS */
|
||||
sg_set_pinsel(42, 0); /* USB0OD -> USB0OD */
|
||||
sg_set_pinsel(43, 0); /* USB1VBUS -> USB1VBUS */
|
||||
sg_set_pinsel(44, 0); /* USB1OD -> USB1OD */
|
||||
/* sg_set_pinsel(114, 4); */ /* TXD1 -> USB2VBUS (shared with UART) */
|
||||
/* sg_set_pinsel(115, 4); */ /* RXD1 -> USB2OD */
|
||||
#endif
|
||||
}
|
||||
201
arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c
Normal file
201
arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_init.c
Normal file
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void dpll_init(void)
|
||||
{
|
||||
u32 tmp;
|
||||
/*
|
||||
* Set DPLL SSC parameters for DPLLCTRL3
|
||||
* [23] DIVN_TEST 0x1
|
||||
* [22:16] DIVN 0x50
|
||||
* [10] FREFSEL_TEST 0x1
|
||||
* [9:8] FREFSEL 0x2
|
||||
* [4] ICPD_TEST 0x1
|
||||
* [3:0] ICPD 0xb
|
||||
*/
|
||||
tmp = readl(SC_DPLLCTRL3);
|
||||
tmp &= ~0x00ff0717;
|
||||
tmp |= 0x00d0061b;
|
||||
writel(tmp, SC_DPLLCTRL3);
|
||||
|
||||
/*
|
||||
* Set DPLL SSC parameters for DPLLCTRL
|
||||
* <-1%> <-2%>
|
||||
* [29:20] SSC_UPCNT 132 (0x084) 132 (0x084)
|
||||
* [14:0] SSC_dK 6335(0x18bf) 12710(0x31a6)
|
||||
*/
|
||||
tmp = readl(SC_DPLLCTRL);
|
||||
tmp &= ~0x3ff07fff;
|
||||
#ifdef CONFIG_DPLL_SSC_RATE_1PER
|
||||
tmp |= 0x084018bf;
|
||||
#else
|
||||
tmp |= 0x084031a6;
|
||||
#endif
|
||||
writel(tmp, SC_DPLLCTRL);
|
||||
|
||||
/*
|
||||
* Set DPLL SSC parameters for DPLLCTRL2
|
||||
* [31:29] SSC_STEP 0
|
||||
* [27] SSC_REG_REF 1
|
||||
* [26:20] SSC_M 79 (0x4f)
|
||||
* [19:0] SSC_K 964689 (0xeb851)
|
||||
*/
|
||||
tmp = readl(SC_DPLLCTRL2);
|
||||
tmp &= ~0xefffffff;
|
||||
tmp |= 0x0cfeb851;
|
||||
writel(tmp, SC_DPLLCTRL2);
|
||||
}
|
||||
|
||||
void upll_init(void)
|
||||
{
|
||||
u32 tmp, clk_mode_upll, clk_mode_axosel;
|
||||
|
||||
tmp = readl(SG_PINMON0);
|
||||
clk_mode_upll = tmp & SG_PINMON0_CLK_MODE_UPLLSRC_MASK;
|
||||
clk_mode_axosel = tmp & SG_PINMON0_CLK_MODE_AXOSEL_MASK;
|
||||
|
||||
/* set 0 to SNRT(UPLLCTRL.bit28) and K_LD(UPLLCTRL.bit[27]) */
|
||||
tmp = readl(SC_UPLLCTRL);
|
||||
tmp &= ~0x18000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
if (clk_mode_upll == SG_PINMON0_CLK_MODE_UPLLSRC_DEFAULT) {
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A) {
|
||||
/* AXO: 25MHz */
|
||||
tmp &= ~0x07ffffff;
|
||||
tmp |= 0x0228f5c0;
|
||||
} else {
|
||||
/* AXO: default 24.576MHz */
|
||||
tmp &= ~0x07ffffff;
|
||||
tmp |= 0x02328000;
|
||||
}
|
||||
}
|
||||
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
/* set 1 to K_LD(UPLLCTRL.bit[27]) */
|
||||
tmp |= 0x08000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
|
||||
/* wait 10 usec */
|
||||
udelay(10);
|
||||
|
||||
/* set 1 to SNRT(UPLLCTRL.bit[28]) */
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_UPLLCTRL);
|
||||
}
|
||||
|
||||
void vpll_init(void)
|
||||
{
|
||||
u32 tmp, clk_mode_axosel;
|
||||
|
||||
tmp = readl(SG_PINMON0);
|
||||
clk_mode_axosel = tmp & SG_PINMON0_CLK_MODE_AXOSEL_MASK;
|
||||
|
||||
/* set 1 to VPLA27WP and VPLA27WP */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp |= 0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
|
||||
/* Set 0 to VPLA_K_LD and VPLB_K_LD */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* Set 0 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp &= ~0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
/* Set 0x20 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp &= ~0x0000007f;
|
||||
tmp |= 0x00000020;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
if (clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U ||
|
||||
clk_mode_axosel == SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A) {
|
||||
/* AXO: 25MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066664;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x00066664;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
} else {
|
||||
/* AXO: default 24.576MHz */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp &= ~0x000fffff;
|
||||
tmp |= 0x000f5800;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
}
|
||||
|
||||
/* Set 1 to VPLA_K_LD and VPLB_K_LD */
|
||||
tmp = readl(SC_VPLL27ACTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL3);
|
||||
tmp = readl(SC_VPLL27BCTRL3);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL3);
|
||||
|
||||
/* wait 10 usec */
|
||||
udelay(10);
|
||||
|
||||
/* Set 0 to VPLA_SNRST and VPLB_SNRST */
|
||||
tmp = readl(SC_VPLL27ACTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27ACTRL2);
|
||||
tmp = readl(SC_VPLL27BCTRL2);
|
||||
tmp |= 0x10000000;
|
||||
writel(tmp, SC_VPLL27BCTRL2);
|
||||
|
||||
/* set 0 to VPLA27WP and VPLA27WP */
|
||||
tmp = readl(SC_VPLL27ACTRL);
|
||||
tmp &= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27ACTRL);
|
||||
tmp = readl(SC_VPLL27BCTRL);
|
||||
tmp |= ~0x00000001;
|
||||
writel(tmp, SC_VPLL27BCTRL);
|
||||
}
|
||||
|
||||
void pll_init(void)
|
||||
{
|
||||
dpll_init();
|
||||
upll_init();
|
||||
vpll_init();
|
||||
|
||||
/*
|
||||
* Wait 500 usec until dpll get stable
|
||||
* We wait 10 usec in upll_init() and vpll_init()
|
||||
* so 20 usec can be saved here.
|
||||
*/
|
||||
udelay(480);
|
||||
}
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/pll_spectrum.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-ld4/pll_spectrum.c"
|
||||
51
arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c
Normal file
51
arch/arm/cpu/armv7/uniphier/ph1-sld8/sbc_init.c
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
#include <asm/arch/sg-regs.h>
|
||||
|
||||
void sbc_init(void)
|
||||
{
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
/* XECS0 : dummy */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL00);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL01);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL02);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL04);
|
||||
#endif
|
||||
/* XECS1 : boot memory (always boot swap = on) */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL10);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL11);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL12);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL14);
|
||||
|
||||
/* XECS4 : sub memory */
|
||||
writel(SBCTRL0_SAVEPIN_MEM_VALUE, SBCTRL40);
|
||||
writel(SBCTRL1_SAVEPIN_MEM_VALUE, SBCTRL41);
|
||||
writel(SBCTRL2_SAVEPIN_MEM_VALUE, SBCTRL42);
|
||||
writel(SBCTRL4_SAVEPIN_MEM_VALUE, SBCTRL44);
|
||||
|
||||
/* XECS5 : peripherals */
|
||||
writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL50);
|
||||
writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL51);
|
||||
writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL52);
|
||||
writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL54);
|
||||
|
||||
/* base address regsiters */
|
||||
writel(0x0000bc01, SBBASE0); /* boot memory */
|
||||
writel(0x0900bfff, SBBASE1); /* dummy */
|
||||
writel(0x0400bc01, SBBASE4); /* sub memory */
|
||||
writel(0x0800bf01, SBBASE5); /* peripherals */
|
||||
|
||||
sg_set_pinsel(134, 16); /* XIRQ6 -> XECS4 */
|
||||
sg_set_pinsel(135, 16); /* XIRQ7 -> XECS5 */
|
||||
|
||||
/* dummy read to assure write process */
|
||||
readl(SG_PINCTRL(33));
|
||||
}
|
||||
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c
Normal file
1
arch/arm/cpu/armv7/uniphier/ph1-sld8/sg_init.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "../ph1-ld4/sg_init.c"
|
||||
142
arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
Normal file
142
arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/umc-regs.h>
|
||||
|
||||
static inline void umc_start_ssif(void __iomem *ssif_base)
|
||||
{
|
||||
writel(0x00000000, ssif_base + 0x0000b004);
|
||||
writel(0xffffffff, ssif_base + 0x0000c004);
|
||||
writel(0x000fffcf, ssif_base + 0x0000c008);
|
||||
writel(0x00000001, ssif_base + 0x0000b000);
|
||||
writel(0x00000001, ssif_base + 0x0000c000);
|
||||
writel(0x03010101, ssif_base + UMC_MDMCHSEL);
|
||||
writel(0x03010100, ssif_base + UMC_DMDCHSEL);
|
||||
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_FETCH);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC0);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMQUE1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMWC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_COMRC1);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_WC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_RC);
|
||||
writel(0x00000000, ssif_base + UMC_CLKEN_SSIF_DST);
|
||||
|
||||
writel(0x00000001, ssif_base + UMC_CPURST);
|
||||
writel(0x00000001, ssif_base + UMC_IDSRST);
|
||||
writel(0x00000001, ssif_base + UMC_IXMRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDMRST);
|
||||
writel(0x00000001, ssif_base + UMC_MDDRST);
|
||||
writel(0x00000001, ssif_base + UMC_SIORST);
|
||||
writel(0x00000001, ssif_base + UMC_VIORST);
|
||||
writel(0x00000001, ssif_base + UMC_FRCRST);
|
||||
writel(0x00000001, ssif_base + UMC_RGLRST);
|
||||
writel(0x00000001, ssif_base + UMC_AIORST);
|
||||
writel(0x00000001, ssif_base + UMC_DMDRST);
|
||||
}
|
||||
|
||||
void umc_dramcont_init(void __iomem *dramcont, void __iomem *ca_base,
|
||||
int size, int freq)
|
||||
{
|
||||
#ifdef CONFIG_DDR_STANDARD
|
||||
writel(0x55990b11, dramcont + UMC_CMDCTLA);
|
||||
writel(0x16958944, dramcont + UMC_CMDCTLB);
|
||||
#else
|
||||
writel(0x45990b11, dramcont + UMC_CMDCTLA);
|
||||
writel(0x16958924, dramcont + UMC_CMDCTLB);
|
||||
#endif
|
||||
|
||||
writel(0x5101046A, dramcont + UMC_INITCTLA);
|
||||
|
||||
if (size == 1)
|
||||
writel(0x27028B0A, dramcont + UMC_INITCTLB);
|
||||
else if (size == 2)
|
||||
writel(0x38028B0A, dramcont + UMC_INITCTLB);
|
||||
|
||||
writel(0x00FF00FF, dramcont + UMC_INITCTLC);
|
||||
writel(0x00000b51, dramcont + UMC_DRMMR0);
|
||||
writel(0x00000006, dramcont + UMC_DRMMR1);
|
||||
writel(0x00000290, dramcont + UMC_DRMMR2);
|
||||
|
||||
#ifdef CONFIG_DDR_STANDARD
|
||||
writel(0x00000000, dramcont + UMC_DRMMR3);
|
||||
#else
|
||||
writel(0x00000800, dramcont + UMC_DRMMR3);
|
||||
#endif
|
||||
|
||||
if (size == 1)
|
||||
writel(0x00240512, dramcont + UMC_SPCCTLA);
|
||||
else if (size == 2)
|
||||
writel(0x00350512, dramcont + UMC_SPCCTLA);
|
||||
|
||||
writel(0x00ff0006, dramcont + UMC_SPCCTLB);
|
||||
writel(0x000a00ac, dramcont + UMC_RDATACTL_D0);
|
||||
writel(0x04060806, dramcont + UMC_WDATACTL_D0);
|
||||
writel(0x04a02000, dramcont + UMC_DATASET);
|
||||
writel(0x00000000, ca_base + 0x2300);
|
||||
writel(0x00400020, dramcont + UMC_DCCGCTL);
|
||||
writel(0x00000003, dramcont + 0x7000);
|
||||
writel(0x0000004f, dramcont + 0x8000);
|
||||
writel(0x000000c3, dramcont + 0x8004);
|
||||
writel(0x00000077, dramcont + 0x8008);
|
||||
writel(0x0000003b, dramcont + UMC_DICGCTLA);
|
||||
writel(0x020a0808, dramcont + UMC_DICGCTLB);
|
||||
writel(0x00000004, dramcont + UMC_FLOWCTLG);
|
||||
writel(0x80000201, ca_base + 0xc20);
|
||||
writel(0x0801e01e, dramcont + UMC_FLOWCTLA);
|
||||
writel(0x00200000, dramcont + UMC_FLOWCTLB);
|
||||
writel(0x00004444, dramcont + UMC_FLOWCTLC);
|
||||
writel(0x200a0a00, dramcont + UMC_SPCSETB);
|
||||
writel(0x00000000, dramcont + UMC_SPCSETD);
|
||||
writel(0x00000520, dramcont + UMC_DFICUPDCTLA);
|
||||
}
|
||||
|
||||
static inline int umc_init_sub(int freq, int size_ch0, int size_ch1)
|
||||
{
|
||||
void __iomem *ssif_base = (void __iomem *)UMC_SSIF_BASE;
|
||||
void __iomem *ca_base0 = (void __iomem *)UMC_CA_BASE(0);
|
||||
void __iomem *ca_base1 = (void __iomem *)UMC_CA_BASE(1);
|
||||
void __iomem *dramcont0 = (void __iomem *)UMC_DRAMCONT_BASE(0);
|
||||
void __iomem *dramcont1 = (void __iomem *)UMC_DRAMCONT_BASE(1);
|
||||
|
||||
umc_dram_init_start(dramcont0);
|
||||
umc_dram_init_start(dramcont1);
|
||||
umc_dram_init_poll(dramcont0);
|
||||
umc_dram_init_poll(dramcont1);
|
||||
|
||||
writel(0x00000101, dramcont0 + UMC_DIOCTLA);
|
||||
|
||||
writel(0x00000101, dramcont1 + UMC_DIOCTLA);
|
||||
|
||||
umc_dramcont_init(dramcont0, ca_base0, size_ch0, freq);
|
||||
umc_dramcont_init(dramcont1, ca_base1, size_ch1, freq);
|
||||
|
||||
umc_start_ssif(ssif_base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int umc_init(void)
|
||||
{
|
||||
return umc_init_sub(CONFIG_DDR_FREQ, CONFIG_SDRAM0_SIZE / 0x08000000,
|
||||
CONFIG_SDRAM1_SIZE / 0x08000000);
|
||||
}
|
||||
|
||||
#if CONFIG_DDR_FREQ != 1333
|
||||
#error Unsupported DDR frequency.
|
||||
#endif
|
||||
|
||||
#if (CONFIG_SDRAM0_SIZE == 0x08000000 || CONFIG_SDRAM0_SIZE == 0x10000000) && \
|
||||
(CONFIG_SDRAM1_SIZE == 0x08000000 || CONFIG_SDRAM1_SIZE == 0x10000000) && \
|
||||
CONFIG_DDR_NUM_CH0 == 1 && CONFIG_DDR_NUM_CH1 == 1
|
||||
/* OK */
|
||||
#else
|
||||
#error Unsupported DDR configuration.
|
||||
#endif
|
||||
29
arch/arm/cpu/armv7/uniphier/reset.c
Normal file
29
arch/arm/cpu/armv7/uniphier/reset.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/sc-regs.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void reset_cpu(unsigned long ignored)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
uniphier_board_reset();
|
||||
|
||||
writel(5, SC_IRQTIMSET); /* default value */
|
||||
|
||||
tmp = readl(SC_SLFRSTSEL);
|
||||
tmp &= ~0x3; /* mask [1:0] */
|
||||
tmp |= 0x0; /* XRST reboot */
|
||||
writel(tmp, SC_SLFRSTSEL);
|
||||
|
||||
tmp = readl(SC_SLFRSTCTL);
|
||||
tmp |= 0x1;
|
||||
writel(tmp, SC_SLFRSTCTL);
|
||||
}
|
||||
54
arch/arm/cpu/armv7/uniphier/smp.S
Normal file
54
arch/arm/cpu/armv7/uniphier/smp.S
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/sbc-regs.h>
|
||||
|
||||
/* Entry point of U-Boot main program for the secondary CPU */
|
||||
LENTRY(secondary_entry)
|
||||
mrc p15, 0, r0, c1, c0, 0 @ SCTLR (System Contrl Register)
|
||||
bic r0, r0, #(CR_C | CR_M) @ MMU and Dcache disable
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
mcr p15, 0, r0, c8, c7, 0 @ invalidate TLBs
|
||||
mcr p15, 0, r0, c7, c5, 0 @ invalidate icache
|
||||
dsb
|
||||
led_write(C,0,,)
|
||||
ldr r1, =ROM_BOOT_ROMRSV2
|
||||
mov r0, #0
|
||||
str r0, [r1]
|
||||
0: wfe
|
||||
ldr r4, [r1] @ r4: entry point for secondary CPUs
|
||||
cmp r4, #0
|
||||
beq 0b
|
||||
led_write(C, P, U, 1)
|
||||
bx r4 @ secondary CPUs jump to linux
|
||||
ENDPROC(secondary_entry)
|
||||
|
||||
ENTRY(wakeup_secondary)
|
||||
ldr r1, =ROM_BOOT_ROMRSV2
|
||||
0: ldr r0, [r1]
|
||||
cmp r0, #0
|
||||
bne 0b
|
||||
|
||||
/* set entry address and send event to the secondary CPU */
|
||||
ldr r0, =secondary_entry
|
||||
str r0, [r1]
|
||||
ldr r0, [r1] @ make sure store is complete
|
||||
mov r0, #0x100
|
||||
0: subs r0, r0, #1 @ I don't know the reason, but without this wait
|
||||
bne 0b @ fails to wake up the secondary CPU
|
||||
sev
|
||||
|
||||
/* wait until the secondary CPU reach to secondary_entry */
|
||||
0: ldr r0, [r1]
|
||||
cmp r0, #0
|
||||
bne 0b
|
||||
bx lr
|
||||
ENDPROC(wakeup_secondary)
|
||||
17
arch/arm/cpu/armv7/uniphier/spl.c
Normal file
17
arch/arm/cpu/armv7/uniphier/spl.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
#if defined(CONFIG_BOARD_POSTCLK_INIT)
|
||||
board_postclk_init();
|
||||
#endif
|
||||
dram_init();
|
||||
}
|
||||
180
arch/arm/cpu/armv7/uniphier/support_card.c
Normal file
180
arch/arm/cpu/armv7/uniphier/support_card.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD)
|
||||
|
||||
#define PFC_MICRO_SUPPORT_CARD_RESET \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x000D0034)
|
||||
#define PFC_MICRO_SUPPORT_CARD_REVISION \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x000D00E0)
|
||||
/*
|
||||
* 0: reset deassert, 1: reset
|
||||
*
|
||||
* bit[0]: LAN, I2C, LED
|
||||
* bit[1]: UART
|
||||
*/
|
||||
void support_card_reset_deassert(void)
|
||||
{
|
||||
writel(0, PFC_MICRO_SUPPORT_CARD_RESET);
|
||||
}
|
||||
|
||||
void support_card_reset(void)
|
||||
{
|
||||
writel(3, PFC_MICRO_SUPPORT_CARD_RESET);
|
||||
}
|
||||
|
||||
static int support_card_show_revision(void)
|
||||
{
|
||||
u32 revision;
|
||||
|
||||
revision = readl(PFC_MICRO_SUPPORT_CARD_REVISION);
|
||||
printf("(PFC CPLD version %d.%d)\n", revision >> 4, revision & 0xf);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
|
||||
|
||||
#define DCC_MICRO_SUPPORT_CARD_RESET_LAN \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x00401300)
|
||||
#define DCC_MICRO_SUPPORT_CARD_RESET_UART \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x00401304)
|
||||
#define DCC_MICRO_SUPPORT_CARD_RESET_I2C \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x00401308)
|
||||
#define DCC_MICRO_SUPPORT_CARD_REVISION \
|
||||
((CONFIG_SUPPORT_CARD_BASE) + 0x005000E0)
|
||||
|
||||
void support_card_reset_deassert(void)
|
||||
{
|
||||
writel(1, DCC_MICRO_SUPPORT_CARD_RESET_LAN); /* LAN and LED */
|
||||
writel(1, DCC_MICRO_SUPPORT_CARD_RESET_UART); /* UART */
|
||||
writel(1, DCC_MICRO_SUPPORT_CARD_RESET_I2C); /* I2C */
|
||||
}
|
||||
|
||||
void support_card_reset(void)
|
||||
{
|
||||
writel(0, DCC_MICRO_SUPPORT_CARD_RESET_LAN); /* LAN and LED */
|
||||
writel(0, DCC_MICRO_SUPPORT_CARD_RESET_UART); /* UART */
|
||||
writel(0, DCC_MICRO_SUPPORT_CARD_RESET_I2C); /* I2C */
|
||||
}
|
||||
|
||||
static int support_card_show_revision(void)
|
||||
{
|
||||
u32 revision;
|
||||
|
||||
revision = readl(DCC_MICRO_SUPPORT_CARD_REVISION);
|
||||
|
||||
if (revision >= 0x67) {
|
||||
printf("(DCC CPLD version 3.%d.%d)\n",
|
||||
revision >> 4, revision & 0xf);
|
||||
return 0;
|
||||
} else {
|
||||
printf("(DCC CPLD unknown version)\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void support_card_init(void)
|
||||
{
|
||||
/*
|
||||
* After power on, we need to keep the LAN controller in reset state
|
||||
* for a while. (200 usec)
|
||||
* Fortunatelly, enough wait time is already inserted in pll_init()
|
||||
* function. So we do not have to wait here.
|
||||
*/
|
||||
support_card_reset_deassert();
|
||||
}
|
||||
|
||||
int check_support_card(void)
|
||||
{
|
||||
printf("SC: Micro Support Card ");
|
||||
return support_card_show_revision();
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SMC911X)
|
||||
#include <netdev.h>
|
||||
|
||||
int board_eth_init(bd_t *bis)
|
||||
{
|
||||
return smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SYS_NO_FLASH)
|
||||
|
||||
#include <mtd/cfi_flash.h>
|
||||
|
||||
#if CONFIG_SYS_MAX_FLASH_BANKS > 1
|
||||
static phys_addr_t flash_banks_list[CONFIG_SYS_MAX_FLASH_BANKS] =
|
||||
CONFIG_SYS_FLASH_BANKS_LIST;
|
||||
|
||||
phys_addr_t cfi_flash_bank_addr(int i)
|
||||
{
|
||||
return flash_banks_list[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
int mem_is_flash(phys_addr_t base)
|
||||
{
|
||||
const int loop = 128;
|
||||
u32 *scratch_addr;
|
||||
u32 saved_value;
|
||||
int ret = 1;
|
||||
int i;
|
||||
|
||||
scratch_addr = map_physmem(base + 0x01e00000,
|
||||
sizeof(u32) * loop, MAP_NOCACHE);
|
||||
|
||||
for (i = 0; i < loop; i++, scratch_addr++) {
|
||||
saved_value = readl(scratch_addr);
|
||||
writel(~saved_value, scratch_addr);
|
||||
if (readl(scratch_addr) != saved_value) {
|
||||
/* We assume no memory or SRAM here. */
|
||||
writel(saved_value, scratch_addr);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unmap_physmem(scratch_addr, MAP_NOCACHE);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int board_flash_wp_on(void)
|
||||
{
|
||||
int i;
|
||||
int ret = 1;
|
||||
|
||||
for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
|
||||
if (mem_is_flash(cfi_flash_bank_addr(i))) {
|
||||
/*
|
||||
* We found at least one flash.
|
||||
* We need to return 0 and call flash_init().
|
||||
*/
|
||||
ret = 0;
|
||||
}
|
||||
#if CONFIG_SYS_MAX_FLASH_BANKS > 1
|
||||
else {
|
||||
/*
|
||||
* We might have a SRAM here.
|
||||
* To prevent SRAM data from being destroyed,
|
||||
* we set dummy address (SDRAM).
|
||||
*/
|
||||
flash_banks_list[i] = 0x80000000 + 0x10000 * i;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
39
arch/arm/cpu/armv7/uniphier/timer.c
Normal file
39
arch/arm/cpu/armv7/uniphier/timer.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/arm-mpcore.h>
|
||||
|
||||
#define PERIPHCLK (50 * 1000 * 1000) /* 50 MHz */
|
||||
#define PRESCALER ((PERIPHCLK) / (CONFIG_SYS_TIMER_RATE) - 1)
|
||||
|
||||
static void *get_global_timer_base(void)
|
||||
{
|
||||
void *val;
|
||||
|
||||
asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (val) : : "memory");
|
||||
|
||||
return val + GLOBAL_TIMER_OFFSET;
|
||||
}
|
||||
|
||||
unsigned long timer_read_counter(void)
|
||||
{
|
||||
/*
|
||||
* ARM 64bit Global Timer is too much for our purpose.
|
||||
* We use only lower 32 bit of the timer counter.
|
||||
*/
|
||||
return readl(get_global_timer_base() + GTIMER_CNT_L);
|
||||
}
|
||||
|
||||
int timer_init(void)
|
||||
{
|
||||
/* enable timer */
|
||||
writel(PRESCALER << 8 | 1, get_global_timer_base() + GTIMER_CTRL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
|
||||
dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
|
||||
dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
|
||||
exynos4210-smdkv310.dtb \
|
||||
exynos4210-universal_c210.dtb \
|
||||
exynos4210-trats.dtb \
|
||||
exynos4412-trats2.dtb \
|
||||
|
||||
21
arch/arm/dts/exynos4210-smdkv310.dts
Normal file
21
arch/arm/dts/exynos4210-smdkv310.dts
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Samsung's Exynos4210-based SMDKV310 board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "exynos4.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung SMDKV310 on Exynos4210";
|
||||
compatible = "samsung,smdkv310", "samsung,exynos4210";
|
||||
|
||||
aliases {
|
||||
serial0 = "/serial@13800000";
|
||||
console = "/serial@13820000";
|
||||
};
|
||||
|
||||
};
|
||||
@@ -28,11 +28,66 @@
|
||||
pmic = "/i2c@12ca0000";
|
||||
};
|
||||
|
||||
cros-ec-keyb {
|
||||
compatible = "google,cros-ec-keyb";
|
||||
google,key-rows = <8>;
|
||||
google,key-columns = <13>;
|
||||
google,repeat-delay-ms = <240>;
|
||||
google,repeat-rate-ms = <30>;
|
||||
google,ghost-filter;
|
||||
/*
|
||||
* Keymap entries take the form of 0xRRCCKKKK where
|
||||
* RR=Row CC=Column KKKK=Key Code
|
||||
* The values below are for a US keyboard layout and
|
||||
* are taken from the Linux driver. Note that the
|
||||
* 102ND key is not used for US keyboards.
|
||||
*/
|
||||
linux,keymap = <
|
||||
/* CAPSLCK F1 B F10 */
|
||||
0x0001003a 0x0002003b 0x00030030 0x00040044
|
||||
/* N = R_ALT ESC */
|
||||
0x00060031 0x0008000d 0x000a0064 0x01010001
|
||||
/* F4 G F7 H */
|
||||
0x0102003e 0x01030022 0x01040041 0x01060023
|
||||
/* ' F9 BKSPACE L_CTRL */
|
||||
0x01080028 0x01090043 0x010b000e 0x0200001d
|
||||
/* TAB F3 T F6 */
|
||||
0x0201000f 0x0202003d 0x02030014 0x02040040
|
||||
/* ] Y 102ND [ */
|
||||
0x0205001b 0x02060015 0x02070056 0x0208001a
|
||||
/* F8 GRAVE F2 5 */
|
||||
0x02090042 0x03010029 0x0302003c 0x03030006
|
||||
/* F5 6 - \ */
|
||||
0x0304003f 0x03060007 0x0308000c 0x030b002b
|
||||
/* R_CTRL A D F */
|
||||
0x04000061 0x0401001e 0x04020020 0x04030021
|
||||
/* S K J ; */
|
||||
0x0404001f 0x04050025 0x04060024 0x04080027
|
||||
/* L ENTER Z C */
|
||||
0x04090026 0x040b001c 0x0501002c 0x0502002e
|
||||
/* V X , M */
|
||||
0x0503002f 0x0504002d 0x05050033 0x05060032
|
||||
/* L_SHIFT / . SPACE */
|
||||
0x0507002a 0x05080035 0x05090034 0x050B0039
|
||||
/* 1 3 4 2 */
|
||||
0x06010002 0x06020004 0x06030005 0x06040003
|
||||
/* 8 7 0 9 */
|
||||
0x06050009 0x06060008 0x0608000b 0x0609000a
|
||||
/* L_ALT DOWN RIGHT Q */
|
||||
0x060a0038 0x060b006c 0x060c006a 0x07010010
|
||||
/* E R W I */
|
||||
0x07020012 0x07030013 0x07040011 0x07050017
|
||||
/* U R_SHIFT P O */
|
||||
0x07060016 0x07070036 0x07080019 0x07090018
|
||||
/* UP LEFT */
|
||||
0x070b0067 0x070c0069>;
|
||||
};
|
||||
|
||||
dmc {
|
||||
mem-manuf = "samsung";
|
||||
mem-type = "ddr3";
|
||||
clock-frequency = <800000000>;
|
||||
arm-frequency = <1700000000>;
|
||||
arm-frequency = <900000000>;
|
||||
};
|
||||
|
||||
tmu@10060000 {
|
||||
|
||||
28
arch/arm/dts/s5pc1xx-goni.dts
Normal file
28
arch/arm/dts/s5pc1xx-goni.dts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Samsung's S5PC110-based Goni board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung Goni based on S5PC110";
|
||||
compatible = "samsung,goni", "samsung,s5pc110";
|
||||
|
||||
aliases {
|
||||
serial2 = "/serial@e2900800";
|
||||
console = "/serial@e2900800";
|
||||
};
|
||||
|
||||
serial@e2900800 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0xe2900800 0x400>;
|
||||
id = <2>;
|
||||
};
|
||||
|
||||
};
|
||||
29
arch/arm/dts/s5pc1xx-smdkc100.dts
Normal file
29
arch/arm/dts/s5pc1xx-smdkc100.dts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Samsung's Exynos4210-based SMDKV310 board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung SMDKC100 based on S5PC100";
|
||||
compatible = "samsung,smdkc100", "samsung,s5pc100";
|
||||
|
||||
aliases {
|
||||
serial0 = "/serial@ec000000";
|
||||
console = "/serial@ec000000";
|
||||
};
|
||||
|
||||
serial@ec000000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0xec000000 0x100>;
|
||||
interrupts = <0 51 0>;
|
||||
id = <0>;
|
||||
};
|
||||
|
||||
};
|
||||
@@ -102,10 +102,10 @@ static struct pllctl_regs *pllctl_regs[] = {
|
||||
#define PLL_BWADJ_LO_SMASK (PLL_BWADJ_LO_MASK << PLL_BWADJ_LO_SHIFT)
|
||||
#define PLL_BWADJ_HI_MASK 0xf
|
||||
|
||||
#define PLLM_RATIO_DIV1 (PLLDIV_ENABLE | 0)
|
||||
#define PLLM_RATIO_DIV2 (PLLDIV_ENABLE | 0)
|
||||
#define PLLM_RATIO_DIV3 (PLLDIV_ENABLE | 1)
|
||||
#define PLLM_RATIO_DIV4 (PLLDIV_ENABLE | 4)
|
||||
#define PLLM_RATIO_DIV5 (PLLDIV_ENABLE | 17)
|
||||
#define PLLM_RATIO_DIV1 (PLLDIV_ENABLE | 0x0)
|
||||
#define PLLM_RATIO_DIV2 (PLLDIV_ENABLE | 0x0)
|
||||
#define PLLM_RATIO_DIV3 (PLLDIV_ENABLE | 0x1)
|
||||
#define PLLM_RATIO_DIV4 (PLLDIV_ENABLE | 0x4)
|
||||
#define PLLM_RATIO_DIV5 (PLLDIV_ENABLE | 0x17)
|
||||
|
||||
#endif /* _CLOCK_DEFS_H_ */
|
||||
|
||||
@@ -909,9 +909,19 @@ struct esdc_regs {
|
||||
#define MXC_CSPIPERIOD_32KHZ (1 << 15)
|
||||
#define MAX_SPI_BYTES 4
|
||||
|
||||
|
||||
#define MXC_SPI_BASE_ADDRESSES \
|
||||
0x43fa4000, \
|
||||
0x50010000, \
|
||||
0x53f84000,
|
||||
|
||||
/*
|
||||
* Generic timer support
|
||||
*/
|
||||
#ifdef CONFIG_MX31_CLK32
|
||||
#define CONFIG_SYS_TIMER_RATE CONFIG_MX31_CLK32
|
||||
#else
|
||||
#define CONFIG_SYS_TIMER_RATE 32768
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_ARCH_MX31_IMX_REGS_H */
|
||||
|
||||
@@ -372,4 +372,16 @@ struct aips_regs {
|
||||
#define CCM_RCSR_NF_16BIT_SEL (1 << 14)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generic timer support
|
||||
*/
|
||||
#ifdef CONFIG_MX35_CLK32
|
||||
#define CONFIG_SYS_TIMER_RATE CONFIG_MX35_CLK32
|
||||
#else
|
||||
#define CONFIG_SYS_TIMER_RATE 32768
|
||||
#endif
|
||||
|
||||
#define CONFIG_SYS_TIMER_COUNTER (GPT1_BASE_ADDR+36)
|
||||
|
||||
#endif /* __ASM_ARCH_MX35_H */
|
||||
|
||||
@@ -53,6 +53,7 @@ u32 imx_get_uartclk(void);
|
||||
u32 imx_get_fecclk(void);
|
||||
unsigned int mxc_get_clock(enum mxc_clock clk);
|
||||
void setup_gpmi_io_clk(u32 cfg);
|
||||
void hab_caam_clock_enable(unsigned char enable);
|
||||
void enable_ocotp_clk(unsigned char enable);
|
||||
void enable_usboh3_clk(unsigned char enable);
|
||||
void enable_uart_clk(unsigned char enable);
|
||||
|
||||
@@ -53,11 +53,17 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, ptrdiff_t,
|
||||
void **, size_t *, hab_loader_callback_f_t);
|
||||
typedef void hapi_clock_init_t(void);
|
||||
|
||||
#define HAB_RVT_REPORT_EVENT (*(uint32_t *)0x000000B4)
|
||||
#define HAB_RVT_REPORT_STATUS (*(uint32_t *)0x000000B8)
|
||||
#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)0x000000A4)
|
||||
#define HAB_RVT_ENTRY (*(uint32_t *)0x00000098)
|
||||
#define HAB_RVT_EXIT (*(uint32_t *)0x0000009C)
|
||||
#ifdef CONFIG_MX6SX
|
||||
#define HAB_RVT_BASE 0x00000100
|
||||
#else
|
||||
#define HAB_RVT_BASE 0x00000094
|
||||
#endif
|
||||
|
||||
#define HAB_RVT_ENTRY (*(uint32_t *)(HAB_RVT_BASE + 0x04))
|
||||
#define HAB_RVT_EXIT (*(uint32_t *)(HAB_RVT_BASE + 0x08))
|
||||
#define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10))
|
||||
#define HAB_RVT_REPORT_EVENT (*(uint32_t *)(HAB_RVT_BASE + 0x20))
|
||||
#define HAB_RVT_REPORT_STATUS (*(uint32_t *)(HAB_RVT_BASE + 0x24))
|
||||
|
||||
#define HAB_RVT_REPORT_EVENT_NEW (*(uint32_t *)0x000000B8)
|
||||
#define HAB_RVT_REPORT_STATUS_NEW (*(uint32_t *)0x000000BC)
|
||||
|
||||
@@ -215,13 +215,8 @@
|
||||
#define AIPS2_OFF_BASE_ADDR (ATZ2_BASE_ADDR + 0x80000)
|
||||
#define CAAM_BASE_ADDR (ATZ2_BASE_ADDR)
|
||||
#define ARM_BASE_ADDR (ATZ2_BASE_ADDR + 0x40000)
|
||||
#ifdef CONFIG_MX6SL
|
||||
#define USBO2H_PL301_IPS_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x0000)
|
||||
#define USBO2H_USB_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4000)
|
||||
#else
|
||||
#define USBOH3_PL301_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x0000)
|
||||
#define USBOH3_USB_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4000)
|
||||
#endif
|
||||
#define USB_PL301_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x0000)
|
||||
#define USB_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x4000)
|
||||
|
||||
#define ENET_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x8000)
|
||||
#ifdef CONFIG_MX6SL
|
||||
|
||||
61
arch/arm/include/asm/arch-s5pc1xx/periph.h
Normal file
61
arch/arm/include/asm/arch-s5pc1xx/periph.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics
|
||||
* Rajeshwari Shinde <rajeshwari.s@samsung.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARM_ARCH_PERIPH_H
|
||||
#define __ASM_ARM_ARCH_PERIPH_H
|
||||
|
||||
/*
|
||||
* Peripherals required for pinmux configuration. List will
|
||||
* grow with support for more devices getting added.
|
||||
* Numbering based on interrupt table.
|
||||
*
|
||||
*/
|
||||
enum periph_id {
|
||||
PERIPH_ID_UART0 = 51,
|
||||
PERIPH_ID_UART1,
|
||||
PERIPH_ID_UART2,
|
||||
PERIPH_ID_UART3,
|
||||
PERIPH_ID_I2C0 = 56,
|
||||
PERIPH_ID_I2C1,
|
||||
PERIPH_ID_I2C2,
|
||||
PERIPH_ID_I2C3,
|
||||
PERIPH_ID_I2C4,
|
||||
PERIPH_ID_I2C5,
|
||||
PERIPH_ID_I2C6,
|
||||
PERIPH_ID_I2C7,
|
||||
PERIPH_ID_SPI0 = 68,
|
||||
PERIPH_ID_SPI1,
|
||||
PERIPH_ID_SPI2,
|
||||
PERIPH_ID_SDMMC0 = 75,
|
||||
PERIPH_ID_SDMMC1,
|
||||
PERIPH_ID_SDMMC2,
|
||||
PERIPH_ID_SDMMC3,
|
||||
PERIPH_ID_I2C8 = 87,
|
||||
PERIPH_ID_I2C9,
|
||||
PERIPH_ID_I2S0 = 98,
|
||||
PERIPH_ID_I2S1 = 99,
|
||||
|
||||
/* Since following peripherals do
|
||||
* not have shared peripheral interrupts (SPIs)
|
||||
* they are numbered arbitiraly after the maximum
|
||||
* SPIs Exynos has (128)
|
||||
*/
|
||||
PERIPH_ID_SROMC = 128,
|
||||
PERIPH_ID_SPI3,
|
||||
PERIPH_ID_SPI4,
|
||||
PERIPH_ID_SDMMC4,
|
||||
PERIPH_ID_PWM0,
|
||||
PERIPH_ID_PWM1,
|
||||
PERIPH_ID_PWM2,
|
||||
PERIPH_ID_PWM3,
|
||||
PERIPH_ID_PWM4,
|
||||
PERIPH_ID_I2C10 = 203,
|
||||
|
||||
PERIPH_ID_NONE = -1,
|
||||
};
|
||||
|
||||
#endif /* __ASM_ARM_ARCH_PERIPH_H */
|
||||
50
arch/arm/include/asm/arch-s5pc1xx/pinmux.h
Normal file
50
arch/arm/include/asm/arch-s5pc1xx/pinmux.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Samsung Electronics
|
||||
* Abhilash Kesavan <a.kesavan@samsung.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARM_ARCH_PINMUX_H
|
||||
#define __ASM_ARM_ARCH_PINMUX_H
|
||||
|
||||
#include "periph.h"
|
||||
|
||||
/*
|
||||
* Flags for setting specific configarations of peripherals.
|
||||
* List will grow with support for more devices getting added.
|
||||
*/
|
||||
enum {
|
||||
PINMUX_FLAG_NONE = 0x00000000,
|
||||
|
||||
/* Flags for eMMC */
|
||||
PINMUX_FLAG_8BIT_MODE = 1 << 0, /* SDMMC 8-bit mode */
|
||||
|
||||
/* Flags for SROM controller */
|
||||
PINMUX_FLAG_BANK = 3 << 0, /* bank number (0-3) */
|
||||
PINMUX_FLAG_16BIT = 1 << 2, /* 16-bit width */
|
||||
};
|
||||
|
||||
/**
|
||||
* Configures the pinmux for a particular peripheral.
|
||||
*
|
||||
* Each gpio can be configured in many different ways (4 bits on exynos)
|
||||
* such as "input", "output", "special function", "external interrupt"
|
||||
* etc. This function will configure the peripheral pinmux along with
|
||||
* pull-up/down and drive strength.
|
||||
*
|
||||
* @param peripheral peripheral to be configured
|
||||
* @param flags configure flags
|
||||
* @return 0 if ok, -1 on error (e.g. unsupported peripheral)
|
||||
*/
|
||||
int exynos_pinmux_config(int peripheral, int flags);
|
||||
|
||||
/**
|
||||
* Decode the peripheral id using the interrpt numbers.
|
||||
*
|
||||
* @param blob Device tree blob
|
||||
* @param node FDT I2C node to find
|
||||
* @return peripheral id if ok, PERIPH_ID_NONE on error
|
||||
*/
|
||||
int pinmux_decode_periph_id(const void *blob, int node);
|
||||
#endif
|
||||
46
arch/arm/include/asm/arch-uniphier/arm-mpcore.h
Normal file
46
arch/arm/include/asm/arch-uniphier/arm-mpcore.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_ARM_MPCORE_H
|
||||
#define ARCH_ARM_MPCORE_H
|
||||
|
||||
/* Snoop Control Unit */
|
||||
#define SCU_OFFSET 0x00
|
||||
|
||||
/* SCU Control Register */
|
||||
#define SCU_CTRL 0x00
|
||||
/* SCU Configuration Register */
|
||||
#define SCU_CONF 0x04
|
||||
/* SCU CPU Power Status Register */
|
||||
#define SCU_PWR_STATUS 0x08
|
||||
/* SCU Invalidate All Registers in Secure State */
|
||||
#define SCU_INV_ALL 0x0C
|
||||
/* SCU Filtering Start Address Register */
|
||||
#define SCU_FILTER_START 0x40
|
||||
/* SCU Filtering End Address Register */
|
||||
#define SCU_FILTER_END 0x44
|
||||
/* SCU Access Control Register */
|
||||
#define SCU_SAC 0x50
|
||||
/* SCU Non-secure Access Control Register */
|
||||
#define SCU_SNSAC 0x54
|
||||
|
||||
/* Global Timer */
|
||||
#define GLOBAL_TIMER_OFFSET 0x200
|
||||
|
||||
/* Global Timer Counter Registers */
|
||||
#define GTIMER_CNT_L 0x00
|
||||
#define GTIMER_CNT_H 0x04
|
||||
/* Global Timer Control Register */
|
||||
#define GTIMER_CTRL 0x08
|
||||
/* Global Timer Interrupt Status Register */
|
||||
#define GTIMER_STAT 0x0C
|
||||
/* Comparator Value Registers */
|
||||
#define GTIMER_CMP_L 0x10
|
||||
#define GTIMER_CMP_H 0x14
|
||||
/* Auto-increment Register */
|
||||
#define GTIMER_INC 0x18
|
||||
|
||||
#endif /* ARCH_ARM_MPCORE_H */
|
||||
30
arch/arm/include/asm/arch-uniphier/bcu-regs.h
Normal file
30
arch/arm/include/asm/arch-uniphier/bcu-regs.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* UniPhier BCU (Bus Control Unit) registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_BCU_REGS_H
|
||||
#define ARCH_BCU_REGS_H
|
||||
|
||||
#define BCU_BASE 0x50080000
|
||||
|
||||
#define BCSCR(x) (BCU_BASE + 0x180 + (x) * 4)
|
||||
#define BCSCR0 (BCSCR(0))
|
||||
#define BCSCR1 (BCSCR(1))
|
||||
#define BCSCR2 (BCSCR(2))
|
||||
#define BCSCR3 (BCSCR(3))
|
||||
#define BCSCR4 (BCSCR(4))
|
||||
#define BCSCR5 (BCSCR(5))
|
||||
|
||||
#define BCIPPCCHR(x) (BCU_BASE + 0x0280 + (x) * 4)
|
||||
#define BCIPPCCHR0 (BCIPPCCHR(0))
|
||||
#define BCIPPCCHR1 (BCIPPCCHR(1))
|
||||
#define BCIPPCCHR2 (BCIPPCCHR(2))
|
||||
#define BCIPPCCHR3 (BCIPPCCHR(3))
|
||||
#define BCIPPCCHR4 (BCIPPCCHR(4))
|
||||
#define BCIPPCCHR5 (BCIPPCCHR(5))
|
||||
|
||||
#endif /* ARCH_BCU_REGS_H */
|
||||
35
arch/arm/include/asm/arch-uniphier/board.h
Normal file
35
arch/arm/include/asm/arch-uniphier/board.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_BOARD_H
|
||||
#define ARCH_BOARD_H
|
||||
|
||||
#if defined(CONFIG_PFC_MICRO_SUPPORT_CARD) || \
|
||||
defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
|
||||
void support_card_reset(void);
|
||||
void support_card_init(void);
|
||||
int check_support_card(void);
|
||||
#else
|
||||
#define support_card_reset() do {} while (0)
|
||||
#define support_card_init() do {} while (0)
|
||||
static inline int check_support_card(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void uniphier_board_reset(void)
|
||||
{
|
||||
support_card_reset();
|
||||
}
|
||||
|
||||
static inline void uniphier_board_init(void)
|
||||
{
|
||||
support_card_init();
|
||||
}
|
||||
|
||||
#endif /* ARCH_BOARD_H */
|
||||
20
arch/arm/include/asm/arch-uniphier/boot-device.h
Normal file
20
arch/arm/include/asm/arch-uniphier/boot-device.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _ASM_BOOT_DEVICE_H_
|
||||
#define _ASM_BOOT_DEVICE_H_
|
||||
|
||||
u32 get_boot_mode_sel(void);
|
||||
|
||||
struct boot_device_info {
|
||||
u32 type;
|
||||
char *info;
|
||||
};
|
||||
|
||||
extern struct boot_device_info boot_device_table[];
|
||||
|
||||
#endif /* _ASM_BOOT_DEVICE_H_ */
|
||||
101
arch/arm/include/asm/arch-uniphier/led.h
Normal file
101
arch/arm/include/asm/arch-uniphier/led.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_LED_H
|
||||
#define ARCH_LED_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define LED_CHAR_0 0x7e
|
||||
#define LED_CHAR_1 0x0c
|
||||
#define LED_CHAR_2 0xb6
|
||||
#define LED_CHAR_3 0x9e
|
||||
#define LED_CHAR_4 0xcc
|
||||
#define LED_CHAR_5 0xda
|
||||
#define LED_CHAR_6 0xfa
|
||||
#define LED_CHAR_7 0x4e
|
||||
#define LED_CHAR_8 0xfe
|
||||
#define LED_CHAR_9 0xde
|
||||
|
||||
#define LED_CHAR_A 0xee
|
||||
#define LED_CHAR_B 0xf8
|
||||
#define LED_CHAR_C 0x72
|
||||
#define LED_CHAR_D 0xbc
|
||||
#define LED_CHAR_E 0xf2
|
||||
#define LED_CHAR_F 0xe2
|
||||
#define LED_CHAR_G 0x7a
|
||||
#define LED_CHAR_H 0xe8
|
||||
#define LED_CHAR_I 0x08
|
||||
#define LED_CHAR_J 0x3c
|
||||
#define LED_CHAR_K 0xea
|
||||
#define LED_CHAR_L 0x70
|
||||
#define LED_CHAR_M 0x6e
|
||||
#define LED_CHAR_N 0xa8
|
||||
#define LED_CHAR_O 0xb8
|
||||
#define LED_CHAR_P 0xe6
|
||||
#define LED_CHAR_Q 0xce
|
||||
#define LED_CHAR_R 0xa0
|
||||
#define LED_CHAR_S 0xc8
|
||||
#define LED_CHAR_T 0x8c
|
||||
#define LED_CHAR_U 0x7c
|
||||
#define LED_CHAR_V 0x54
|
||||
#define LED_CHAR_W 0xfc
|
||||
#define LED_CHAR_X 0xec
|
||||
#define LED_CHAR_Y 0xdc
|
||||
#define LED_CHAR_Z 0xa4
|
||||
|
||||
#define LED_CHAR_SPACE 0x00
|
||||
#define LED_CHAR_DOT 0x01
|
||||
|
||||
#define LED_CHAR_ (LED_CHAR_SPACE)
|
||||
|
||||
/** Macro to translate 4 characters into integer to display led */
|
||||
#define LED_C2I(C0, C1, C2, C3) \
|
||||
(~( \
|
||||
(LED_CHAR_##C0 << 24) | \
|
||||
(LED_CHAR_##C1 << 16) | \
|
||||
(LED_CHAR_##C2 << 8) | \
|
||||
(LED_CHAR_##C3) \
|
||||
))
|
||||
|
||||
#if defined(CONFIG_SUPPORT_CARD_LED_BASE)
|
||||
|
||||
#define LED_ADDR CONFIG_SUPPORT_CARD_LED_BASE
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#define led_write(C0, C1, C2, C3) raw_led_write LED_C2I(C0, C1, C2, C3)
|
||||
.macro raw_led_write data
|
||||
ldr r0, =\data
|
||||
ldr r1, =LED_ADDR
|
||||
str r0, [r1]
|
||||
.endm
|
||||
|
||||
#else /* __ASSEMBLY__ */
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
#define led_write(C0, C1, C2, C3) \
|
||||
do { \
|
||||
raw_led_write(LED_C2I(C0, C1, C2, C3)); \
|
||||
} while (0)
|
||||
|
||||
static inline void raw_led_write(u32 data)
|
||||
{
|
||||
writel(data, LED_ADDR);
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#else /* CONFIG_SUPPORT_CARD_LED_BASE */
|
||||
|
||||
#define led_write(C0, C1, C2, C3)
|
||||
#define raw_led_write(x)
|
||||
|
||||
#endif /* CONFIG_SUPPORT_CARD_LED_BASE */
|
||||
|
||||
#endif /* ARCH_LED_H */
|
||||
108
arch/arm/include/asm/arch-uniphier/sbc-regs.h
Normal file
108
arch/arm/include/asm/arch-uniphier/sbc-regs.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* UniPhier SBC (System Bus Controller) registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_SBC_REGS_H
|
||||
#define ARCH_SBC_REGS_H
|
||||
|
||||
#define SBBASE_BASE 0x58c00100
|
||||
#define SBBASE(x) (SBBASE_BASE + (x) * 0x10)
|
||||
|
||||
#define SBBASE0 (SBBASE(0))
|
||||
#define SBBASE1 (SBBASE(1))
|
||||
#define SBBASE2 (SBBASE(2))
|
||||
#define SBBASE3 (SBBASE(3))
|
||||
#define SBBASE4 (SBBASE(4))
|
||||
#define SBBASE5 (SBBASE(5))
|
||||
#define SBBASE6 (SBBASE(6))
|
||||
#define SBBASE7 (SBBASE(7))
|
||||
|
||||
#define SBBASE_BANK_ENABLE (0x00000001)
|
||||
|
||||
#define SBCTRL_BASE 0x58c00200
|
||||
#define SBCTRL(x, y) (SBCTRL_BASE + (x) * 0x10 + (y) * 4)
|
||||
|
||||
#define SBCTRL00 SBCTRL(0, 0)
|
||||
#define SBCTRL01 SBCTRL(0, 1)
|
||||
#define SBCTRL02 SBCTRL(0, 2)
|
||||
#define SBCTRL03 SBCTRL(0, 3)
|
||||
#define SBCTRL04 (SBCTRL_BASE + 0x100)
|
||||
|
||||
#define SBCTRL10 SBCTRL(1, 0)
|
||||
#define SBCTRL11 SBCTRL(1, 1)
|
||||
#define SBCTRL12 SBCTRL(1, 2)
|
||||
#define SBCTRL13 SBCTRL(1, 3)
|
||||
#define SBCTRL14 (SBCTRL_BASE + 0x110)
|
||||
|
||||
#define SBCTRL20 SBCTRL(2, 0)
|
||||
#define SBCTRL21 SBCTRL(2, 1)
|
||||
#define SBCTRL22 SBCTRL(2, 2)
|
||||
#define SBCTRL23 SBCTRL(2, 3)
|
||||
#define SBCTRL24 (SBCTRL_BASE + 0x120)
|
||||
|
||||
#define SBCTRL30 SBCTRL(3, 0)
|
||||
#define SBCTRL31 SBCTRL(3, 1)
|
||||
#define SBCTRL32 SBCTRL(3, 2)
|
||||
#define SBCTRL33 SBCTRL(3, 3)
|
||||
#define SBCTRL34 (SBCTRL_BASE + 0x130)
|
||||
|
||||
#define SBCTRL40 SBCTRL(4, 0)
|
||||
#define SBCTRL41 SBCTRL(4, 1)
|
||||
#define SBCTRL42 SBCTRL(4, 2)
|
||||
#define SBCTRL43 SBCTRL(4, 3)
|
||||
#define SBCTRL44 (SBCTRL_BASE + 0x140)
|
||||
|
||||
#define SBCTRL50 SBCTRL(5, 0)
|
||||
#define SBCTRL51 SBCTRL(5, 1)
|
||||
#define SBCTRL52 SBCTRL(5, 2)
|
||||
#define SBCTRL53 SBCTRL(5, 3)
|
||||
#define SBCTRL54 (SBCTRL_BASE + 0x150)
|
||||
|
||||
#define SBCTRL60 SBCTRL(6, 0)
|
||||
#define SBCTRL61 SBCTRL(6, 1)
|
||||
#define SBCTRL62 SBCTRL(6, 2)
|
||||
#define SBCTRL63 SBCTRL(6, 3)
|
||||
#define SBCTRL64 (SBCTRL_BASE + 0x160)
|
||||
|
||||
#define SBCTRL70 SBCTRL(7, 0)
|
||||
#define SBCTRL71 SBCTRL(7, 1)
|
||||
#define SBCTRL72 SBCTRL(7, 2)
|
||||
#define SBCTRL73 SBCTRL(7, 3)
|
||||
#define SBCTRL74 (SBCTRL_BASE + 0x170)
|
||||
|
||||
/* slower but LED works */
|
||||
#define SBCTRL0_SAVEPIN_PERI_VALUE 0x55450000
|
||||
#define SBCTRL1_SAVEPIN_PERI_VALUE 0x07168d00
|
||||
#define SBCTRL2_SAVEPIN_PERI_VALUE 0x34000009
|
||||
#define SBCTRL4_SAVEPIN_PERI_VALUE 0x02110110
|
||||
|
||||
/* faster but LED does not work */
|
||||
#define SBCTRL0_SAVEPIN_MEM_VALUE 0x55450000
|
||||
#define SBCTRL1_SAVEPIN_MEM_VALUE 0x06057700
|
||||
/* NOR flash needs more wait counts than SRAM */
|
||||
#define SBCTRL2_SAVEPIN_MEM_VALUE 0x34000009
|
||||
#define SBCTRL4_SAVEPIN_MEM_VALUE 0x02110210
|
||||
|
||||
#define SBCTRL0_ADMULTIPLX_PERI_VALUE 0x33120000
|
||||
#define SBCTRL1_ADMULTIPLX_PERI_VALUE 0x03005500
|
||||
#define SBCTRL2_ADMULTIPLX_PERI_VALUE 0x14000020
|
||||
|
||||
#define SBCTRL0_ADMULTIPLX_MEM_VALUE 0x33120000
|
||||
#define SBCTRL1_ADMULTIPLX_MEM_VALUE 0x03005500
|
||||
#define SBCTRL2_ADMULTIPLX_MEM_VALUE 0x14000010
|
||||
|
||||
#define ROM_BOOT_ROMRSV2 0x59801208
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <asm/io.h>
|
||||
static inline int boot_is_swapped(void)
|
||||
{
|
||||
return !(readl(SBBASE0) & SBBASE_BANK_ENABLE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ARCH_SBC_REGS_H */
|
||||
62
arch/arm/include/asm/arch-uniphier/sc-regs.h
Normal file
62
arch/arm/include/asm/arch-uniphier/sc-regs.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* UniPhier SC (System Control) block registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_SC_REGS_H
|
||||
#define ARCH_SC_REGS_H
|
||||
|
||||
#define SC_BASE_ADDR 0x61840000
|
||||
|
||||
#define SC_MPLLOSCCTL (SC_BASE_ADDR | 0x1184)
|
||||
#define SC_MPLLOSCCTL_MPLLEN (0x1 << 0)
|
||||
#define SC_MPLLOSCCTL_MPLLST (0x1 << 1)
|
||||
|
||||
#define SC_DPLLCTRL (SC_BASE_ADDR | 0x1200)
|
||||
#define SC_DPLLCTRL_SSC_EN (0x1 << 31)
|
||||
#define SC_DPLLCTRL_FOUTMODE_MASK (0xf << 16)
|
||||
#define SC_DPLLCTRL_SSC_RATE (0x1 << 15)
|
||||
|
||||
#define SC_DPLLCTRL2 (SC_BASE_ADDR | 0x1204)
|
||||
#define SC_DPLLCTRL2_NRSTDS (0x1 << 28)
|
||||
|
||||
#define SC_DPLLCTRL3 (SC_BASE_ADDR | 0x1208)
|
||||
#define SC_DPLLCTRL3_LPFSEL_COEF2 (0x0 << 31)
|
||||
#define SC_DPLLCTRL3_LPFSEL_COEF3 (0x1 << 31)
|
||||
|
||||
#define SC_UPLLCTRL (SC_BASE_ADDR | 0x1210)
|
||||
|
||||
#define SC_VPLL27ACTRL (SC_BASE_ADDR | 0x1270)
|
||||
#define SC_VPLL27ACTRL2 (SC_BASE_ADDR | 0x1274)
|
||||
#define SC_VPLL27ACTRL3 (SC_BASE_ADDR | 0x1278)
|
||||
|
||||
#define SC_VPLL27BCTRL (SC_BASE_ADDR | 0x1290)
|
||||
#define SC_VPLL27BCTRL2 (SC_BASE_ADDR | 0x1294)
|
||||
#define SC_VPLL27BCTRL3 (SC_BASE_ADDR | 0x1298)
|
||||
|
||||
#define SC_RSTCTRL (SC_BASE_ADDR | 0x2000)
|
||||
#define SC_RSTCTRL_NRST_ETHER (0x1 << 12)
|
||||
#define SC_RSTCTRL_NRST_UMC1 (0x1 << 5)
|
||||
#define SC_RSTCTRL_NRST_UMC0 (0x1 << 4)
|
||||
#define SC_RSTCTRL_NRST_NAND (0x1 << 2)
|
||||
|
||||
#define SC_RSTCTRL2 (SC_BASE_ADDR | 0x2004)
|
||||
#define SC_RSTCTRL3 (SC_BASE_ADDR | 0x2008)
|
||||
|
||||
#define SC_CLKCTRL (SC_BASE_ADDR | 0x2104)
|
||||
#define SC_CLKCTRL_CLK_ETHER (0x1 << 12)
|
||||
#define SC_CLKCTRL_CLK_MIO (0x1 << 11)
|
||||
#define SC_CLKCTRL_CLK_UMC (0x1 << 4)
|
||||
#define SC_CLKCTRL_CLK_NAND (0x1 << 2)
|
||||
#define SC_CLKCTRL_CLK_SBC (0x1 << 1)
|
||||
#define SC_CLKCTRL_CLK_PERI (0x1 << 0)
|
||||
|
||||
/* System reset control register */
|
||||
#define SC_IRQTIMSET (SC_BASE_ADDR | 0x3000)
|
||||
#define SC_SLFRSTSEL (SC_BASE_ADDR | 0x3010)
|
||||
#define SC_SLFRSTCTL (SC_BASE_ADDR | 0x3014)
|
||||
|
||||
#endif /* ARCH_SC_REGS_H */
|
||||
182
arch/arm/include/asm/arch-uniphier/sg-regs.h
Normal file
182
arch/arm/include/asm/arch-uniphier/sg-regs.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* UniPhier SG (SoC Glue) block registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_SG_REGS_H
|
||||
#define ARCH_SG_REGS_H
|
||||
|
||||
/* Base Address */
|
||||
#define SG_CTRL_BASE 0x5f800000
|
||||
#define SG_DBG_BASE 0x5f900000
|
||||
|
||||
/* Revision */
|
||||
#define SG_REVISION (SG_CTRL_BASE | 0x0000)
|
||||
#define SG_REVISION_TYPE_SHIFT 16
|
||||
#define SG_REVISION_TYPE_MASK (0xff << SG_REVISION_TYPE_SHIFT)
|
||||
#define SG_REVISION_MODEL_SHIFT 8
|
||||
#define SG_REVISION_MODEL_MASK (0x3 << SG_REVISION_MODEL_SHIFT)
|
||||
#define SG_REVISION_REV_SHIFT 0
|
||||
#define SG_REVISION_REV_MASK (0x1f << SG_REVISION_REV_SHIFT)
|
||||
|
||||
/* Memory Configuration */
|
||||
#define SG_MEMCONF (SG_CTRL_BASE | 0x0400)
|
||||
|
||||
#define SG_MEMCONF_CH0_SIZE_64MB ((0x0 << 10) | (0x01 << 0))
|
||||
#define SG_MEMCONF_CH0_SIZE_128MB ((0x0 << 10) | (0x02 << 0))
|
||||
#define SG_MEMCONF_CH0_SIZE_256MB ((0x0 << 10) | (0x03 << 0))
|
||||
#define SG_MEMCONF_CH0_SIZE_512MB ((0x1 << 10) | (0x00 << 0))
|
||||
#define SG_MEMCONF_CH0_SIZE_1024MB ((0x1 << 10) | (0x01 << 0))
|
||||
#define SG_MEMCONF_CH0_NUM_1 (0x1 << 8)
|
||||
#define SG_MEMCONF_CH0_NUM_2 (0x0 << 8)
|
||||
|
||||
#define SG_MEMCONF_CH1_SIZE_64MB ((0x0 << 11) | (0x01 << 2))
|
||||
#define SG_MEMCONF_CH1_SIZE_128MB ((0x0 << 11) | (0x02 << 2))
|
||||
#define SG_MEMCONF_CH1_SIZE_256MB ((0x0 << 11) | (0x03 << 2))
|
||||
#define SG_MEMCONF_CH1_SIZE_512MB ((0x1 << 11) | (0x00 << 2))
|
||||
#define SG_MEMCONF_CH1_SIZE_1024MB ((0x1 << 11) | (0x01 << 2))
|
||||
#define SG_MEMCONF_CH1_NUM_1 (0x1 << 9)
|
||||
#define SG_MEMCONF_CH1_NUM_2 (0x0 << 9)
|
||||
|
||||
#define SG_MEMCONF_SPARSEMEM (0x1 << 4)
|
||||
|
||||
/* Pin Control */
|
||||
#define SG_PINCTRL_BASE (SG_CTRL_BASE | 0x1000)
|
||||
|
||||
#if defined(CONFIG_MACH_PH1_PRO4)
|
||||
# define SG_PINCTRL(n) (SG_PINCTRL_BASE + (n) * 8)
|
||||
#elif defined(CONFIG_MACH_PH1_LD4) || defined(CONFIG_MACH_PH1_SLD8)
|
||||
# define SG_PINCTRL(n) (SG_PINCTRL_BASE + (n) * 4)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MACH_PH1_PRO4)
|
||||
#define SG_PINSELBITS 4
|
||||
#elif defined(CONFIG_MACH_PH1_LD4) || defined(CONFIG_MACH_PH1_SLD8)
|
||||
#define SG_PINSELBITS 8
|
||||
#endif
|
||||
|
||||
#define SG_PINSEL_ADDR(n) (SG_PINCTRL((n) * (SG_PINSELBITS) / 32))
|
||||
#define SG_PINSEL_MASK(n) (~(((1 << (SG_PINSELBITS)) - 1) << \
|
||||
((n) * (SG_PINSELBITS) % 32)))
|
||||
#define SG_PINSEL_MODE(n, mode) ((mode) << ((n) * (SG_PINSELBITS) % 32))
|
||||
|
||||
/* Only for PH1-Pro4 */
|
||||
#define SG_LOADPINCTRL (SG_CTRL_BASE | 0x1700)
|
||||
|
||||
/* Input Enable */
|
||||
#define SG_IECTRL (SG_CTRL_BASE | 0x1d00)
|
||||
|
||||
/* Pin Monitor */
|
||||
#define SG_PINMON0 (SG_DBG_BASE | 0x0100)
|
||||
|
||||
#define SG_PINMON0_CLK_MODE_UPLLSRC_MASK (0x3 << 19)
|
||||
#define SG_PINMON0_CLK_MODE_UPLLSRC_DEFAULT (0x0 << 19)
|
||||
#define SG_PINMON0_CLK_MODE_UPLLSRC_VPLL27A (0x2 << 19)
|
||||
#define SG_PINMON0_CLK_MODE_UPLLSRC_VPLL27B (0x3 << 19)
|
||||
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_MASK (0x3 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_24576KHZ (0x0 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ (0x1 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_6144KHZ (0x2 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_6250KHZ (0x3 << 16)
|
||||
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_DEFAULT (0x0 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_U (0x1 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_20480KHZ (0x2 << 16)
|
||||
#define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A (0x3 << 16)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <linux/types.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
static inline void sg_set_pinsel(int n, int value)
|
||||
{
|
||||
writel((readl(SG_PINSEL_ADDR(n)) & SG_PINSEL_MASK(n))
|
||||
| SG_PINSEL_MODE(n, value), SG_PINSEL_ADDR(n));
|
||||
}
|
||||
|
||||
static inline u32 sg_memconf_val_ch0(unsigned long size, int num)
|
||||
{
|
||||
int size_mb = (size >> 20) / num;
|
||||
u32 ret;
|
||||
|
||||
switch (size_mb) {
|
||||
case 64:
|
||||
ret = SG_MEMCONF_CH0_SIZE_64MB;
|
||||
break;
|
||||
case 128:
|
||||
ret = SG_MEMCONF_CH0_SIZE_128MB;
|
||||
break;
|
||||
case 256:
|
||||
ret = SG_MEMCONF_CH0_SIZE_256MB;
|
||||
break;
|
||||
case 512:
|
||||
ret = SG_MEMCONF_CH0_SIZE_512MB;
|
||||
break;
|
||||
case 1024:
|
||||
ret = SG_MEMCONF_CH0_SIZE_1024MB;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (num) {
|
||||
case 1:
|
||||
ret |= SG_MEMCONF_CH0_NUM_1;
|
||||
break;
|
||||
case 2:
|
||||
ret |= SG_MEMCONF_CH0_NUM_2;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline u32 sg_memconf_val_ch1(unsigned long size, int num)
|
||||
{
|
||||
int size_mb = (size >> 20) / num;
|
||||
u32 ret;
|
||||
|
||||
switch (size_mb) {
|
||||
case 64:
|
||||
ret = SG_MEMCONF_CH1_SIZE_64MB;
|
||||
break;
|
||||
case 128:
|
||||
ret = SG_MEMCONF_CH1_SIZE_128MB;
|
||||
break;
|
||||
case 256:
|
||||
ret = SG_MEMCONF_CH1_SIZE_256MB;
|
||||
break;
|
||||
case 512:
|
||||
ret = SG_MEMCONF_CH1_SIZE_512MB;
|
||||
break;
|
||||
case 1024:
|
||||
ret = SG_MEMCONF_CH1_SIZE_1024MB;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (num) {
|
||||
case 1:
|
||||
ret |= SG_MEMCONF_CH1_NUM_1;
|
||||
break;
|
||||
case 2:
|
||||
ret |= SG_MEMCONF_CH1_NUM_2;
|
||||
break;
|
||||
default:
|
||||
BUG();
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* ARCH_SG_REGS_H */
|
||||
67
arch/arm/include/asm/arch-uniphier/ssc-regs.h
Normal file
67
arch/arm/include/asm/arch-uniphier/ssc-regs.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* UniPhier System Cache (L2 Cache) registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_SSC_REGS_H
|
||||
#define ARCH_SSC_REGS_H
|
||||
|
||||
#define SSCC 0x500c0000
|
||||
#define SSCC_BST (0x1 << 20)
|
||||
#define SSCC_ACT (0x1 << 19)
|
||||
#define SSCC_WTG (0x1 << 18)
|
||||
#define SSCC_PRD (0x1 << 17)
|
||||
#define SSCC_WBWA (0x1 << 16)
|
||||
#define SSCC_EX (0x1 << 13)
|
||||
#define SSCC_ON (0x1 << 0)
|
||||
|
||||
#define SSCLPDAWCR 0x500c0030
|
||||
|
||||
#define SSCOPE 0x506c0244
|
||||
#define SSCOPE_CM_SYNC 0x00000008
|
||||
|
||||
#define SSCOQM 0x506c0248
|
||||
#define SSCOQM_TID_MASK (0x3 << 21)
|
||||
#define SSCOQM_TID_BY_WAY (0x2 << 21)
|
||||
#define SSCOQM_TID_BY_INST_WAY (0x1 << 21)
|
||||
#define SSCOQM_TID_BY_DATA_WAY (0x0 << 21)
|
||||
#define SSCOQM_S_MASK (0x3 << 17)
|
||||
#define SSCOQM_S_WAY (0x2 << 17)
|
||||
#define SSCOQM_S_ALL (0x1 << 17)
|
||||
#define SSCOQM_S_ADDRESS (0x0 << 17)
|
||||
#define SSCOQM_CE (0x1 << 15)
|
||||
#define SSCOQM_CW (0x1 << 14)
|
||||
#define SSCOQM_CM_MASK (0x7)
|
||||
#define SSCOQM_CM_DIRT_TOUCH (0x7)
|
||||
#define SSCOQM_CM_ZERO_TOUCH (0x6)
|
||||
#define SSCOQM_CM_NORM_TOUCH (0x5)
|
||||
#define SSCOQM_CM_PREF_FETCH (0x4)
|
||||
#define SSCOQM_CM_SSC_FETCH (0x3)
|
||||
#define SSCOQM_CM_WB_INV (0x2)
|
||||
#define SSCOQM_CM_WB (0x1)
|
||||
#define SSCOQM_CM_INV (0x0)
|
||||
|
||||
#define SSCOQAD 0x506c024c
|
||||
#define SSCOQSZ 0x506c0250
|
||||
#define SSCOQWN 0x506c0258
|
||||
|
||||
#define SSCOPPQSEF 0x506c025c
|
||||
#define SSCOPPQSEF_FE (0x1 << 1)
|
||||
#define SSCOPPQSEF_OE (0x1 << 0)
|
||||
|
||||
#define SSCOLPQS 0x506c0260
|
||||
#define SSCOLPQS_EF (0x1 << 2)
|
||||
#define SSCOLPQS_EST (0x1 << 1)
|
||||
#define SSCOLPQS_QST (0x1 << 0)
|
||||
|
||||
#define SSCOQCE0 0x506c0270
|
||||
|
||||
#define SSC_LINE_SIZE 128
|
||||
#define SSC_NUM_ENTRIES 256
|
||||
#define SSC_WAY_SIZE ((SSC_LINE_SIZE) * (SSC_NUM_ENTRIES))
|
||||
#define SSC_RANGE_OP_MAX_SIZE (0x00400000 - (SSC_LINE_SIZE))
|
||||
|
||||
#endif /* ARCH_SSC_REGS_H */
|
||||
119
arch/arm/include/asm/arch-uniphier/umc-regs.h
Normal file
119
arch/arm/include/asm/arch-uniphier/umc-regs.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* UniPhier UMC (Universal Memory Controller) registers
|
||||
*
|
||||
* Copyright (C) 2011-2014 Panasonic Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef ARCH_UMC_REGS_H
|
||||
#define ARCH_UMC_REGS_H
|
||||
|
||||
#define UMC_BASE 0x5b800000
|
||||
|
||||
/* SSIF registers */
|
||||
#define UMC_SSIF_BASE UMC_BASE
|
||||
|
||||
#define UMC_CPURST 0x00000700
|
||||
#define UMC_IDSRST 0x0000070C
|
||||
#define UMC_IXMRST 0x00000714
|
||||
#define UMC_HDMRST 0x00000718
|
||||
#define UMC_MDMRST 0x0000071C
|
||||
#define UMC_HDDRST 0x00000720
|
||||
#define UMC_MDDRST 0x00000724
|
||||
#define UMC_SIORST 0x00000728
|
||||
#define UMC_GIORST 0x0000072C
|
||||
#define UMC_HD2RST 0x00000734
|
||||
#define UMC_VIORST 0x0000073C
|
||||
#define UMC_FRCRST 0x00000748 /* LD4/sLD8 */
|
||||
#define UMC_DVCRST 0x00000748 /* Pro4 */
|
||||
#define UMC_RGLRST 0x00000750
|
||||
#define UMC_VPERST 0x00000758
|
||||
#define UMC_AIORST 0x00000764
|
||||
#define UMC_DMDRST 0x00000770
|
||||
|
||||
#define UMC_HDMCHSEL 0x00000898
|
||||
#define UMC_MDMCHSEL 0x0000089C
|
||||
#define UMC_DVCCHSEL 0x000008C8
|
||||
#define UMC_DMDCHSEL 0x000008F0
|
||||
|
||||
#define UMC_CLKEN_SSIF_FETCH 0x0000C060
|
||||
#define UMC_CLKEN_SSIF_COMQUE0 0x0000C064
|
||||
#define UMC_CLKEN_SSIF_COMWC0 0x0000C068
|
||||
#define UMC_CLKEN_SSIF_COMRC0 0x0000C06C
|
||||
#define UMC_CLKEN_SSIF_COMQUE1 0x0000C070
|
||||
#define UMC_CLKEN_SSIF_COMWC1 0x0000C074
|
||||
#define UMC_CLKEN_SSIF_COMRC1 0x0000C078
|
||||
#define UMC_CLKEN_SSIF_WC 0x0000C07C
|
||||
#define UMC_CLKEN_SSIF_RC 0x0000C080
|
||||
#define UMC_CLKEN_SSIF_DST 0x0000C084
|
||||
|
||||
/* CA registers */
|
||||
#define UMC_CA_BASE(ch) (UMC_BASE + 0x00001000 + 0x00001000 * (ch))
|
||||
|
||||
/* DRAM controller registers */
|
||||
#define UMC_DRAMCONT_BASE(ch) (UMC_BASE + 0x00400000 + 0x00200000 * (ch))
|
||||
|
||||
#define UMC_CMDCTLA 0x00000000
|
||||
#define UMC_CMDCTLB 0x00000004
|
||||
#define UMC_INITCTLA 0x00000008
|
||||
#define UMC_INITCTLB 0x0000000C
|
||||
#define UMC_INITCTLC 0x00000010
|
||||
#define UMC_INITSET 0x00000014
|
||||
#define UMC_INITSTAT 0x00000018
|
||||
#define UMC_DRMMR0 0x0000001C
|
||||
#define UMC_DRMMR1 0x00000020
|
||||
#define UMC_DRMMR2 0x00000024
|
||||
#define UMC_DRMMR3 0x00000028
|
||||
#define UMC_SPCCTLA 0x00000030
|
||||
#define UMC_SPCCTLB 0x00000034
|
||||
#define UMC_SPCSETA 0x00000038
|
||||
#define UMC_SPCSETB 0x0000003C
|
||||
#define UMC_SPCSETC 0x00000040
|
||||
#define UMC_SPCSETD 0x00000044
|
||||
#define UMC_SPCSTATA 0x00000050
|
||||
#define UMC_SPCSTATB 0x00000054
|
||||
#define UMC_SPCSTATC 0x00000058
|
||||
#define UMC_ACSSETA 0x00000060
|
||||
#define UMC_FLOWCTLA 0x00000400
|
||||
#define UMC_FLOWCTLB 0x00000404
|
||||
#define UMC_FLOWCTLC 0x00000408
|
||||
#define UMC_FLOWCTLG 0x00000508
|
||||
#define UMC_RDATACTL_D0 0x00000600
|
||||
#define UMC_WDATACTL_D0 0x00000604
|
||||
#define UMC_RDATACTL_D1 0x00000608
|
||||
#define UMC_WDATACTL_D1 0x0000060C
|
||||
#define UMC_DATASET 0x00000610
|
||||
#define UMC_DCCGCTL 0x00000720
|
||||
#define UMC_DICGCTLA 0x00000724
|
||||
#define UMC_DICGCTLB 0x00000728
|
||||
#define UMC_DIOCTLA 0x00000C00
|
||||
#define UMC_DFICUPDCTLA 0x00000C20
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
static inline void umc_polling(u32 address, u32 expval, u32 mask)
|
||||
{
|
||||
u32 nmask = ~mask;
|
||||
u32 data;
|
||||
do {
|
||||
data = readl(address) & nmask;
|
||||
} while (data != expval);
|
||||
}
|
||||
|
||||
static inline void umc_dram_init_start(void __iomem *dramcont)
|
||||
{
|
||||
writel(0x00000002, dramcont + UMC_INITSET);
|
||||
}
|
||||
|
||||
static inline void umc_dram_init_poll(void __iomem *dramcont)
|
||||
{
|
||||
while ((readl(dramcont + UMC_INITSTAT) & 0x00000002))
|
||||
;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -103,9 +103,11 @@
|
||||
/* DDRMC */
|
||||
#define DDRMC_PHY_DQ_TIMING 0x00002613
|
||||
#define DDRMC_PHY_DQS_TIMING 0x00002615
|
||||
#define DDRMC_PHY_CTRL 0x01210080
|
||||
#define DDRMC_PHY_CTRL 0x00210000
|
||||
#define DDRMC_PHY_MASTER_CTRL 0x0001012a
|
||||
#define DDRMC_PHY_SLAVE_CTRL 0x00012020
|
||||
#define DDRMC_PHY_SLAVE_CTRL 0x00002000
|
||||
#define DDRMC_PHY_OFF 0x00000000
|
||||
#define DDRMC_PHY_PROC_PAD_ODT 0x00010101
|
||||
|
||||
#define DDRMC_PHY50_DDR3_MODE (1 << 12)
|
||||
#define DDRMC_PHY50_EN_SW_HALF_CYCLE (1 << 8)
|
||||
@@ -138,7 +140,7 @@
|
||||
#define DDRMC_CR21_CCMAP_EN 1
|
||||
#define DDRMC_CR22_TDAL(v) (((v) & 0x3f) << 16)
|
||||
#define DDRMC_CR23_BSTLEN(v) (((v) & 0x7) << 24)
|
||||
#define DDRMC_CR23_TDLL(v) ((v) & 0xff)
|
||||
#define DDRMC_CR23_TDLL(v) ((v) & 0xffff)
|
||||
#define DDRMC_CR24_TRP_AB(v) ((v) & 0x1f)
|
||||
#define DDRMC_CR25_TREF_EN (1 << 16)
|
||||
#define DDRMC_CR26_TREF(v) (((v) & 0xffff) << 16)
|
||||
@@ -151,7 +153,7 @@
|
||||
#define DDRMC_CR33_EN_QK_SREF (1 << 16)
|
||||
#define DDRMC_CR34_CKSRX(v) (((v) & 0xf) << 16)
|
||||
#define DDRMC_CR34_CKSRE(v) (((v) & 0xf) << 8)
|
||||
#define DDRMC_CR38_FREQ_CHG_EN (1 << 8)
|
||||
#define DDRMC_CR38_FREQ_CHG_EN(v) (((v) & 0x1) << 8)
|
||||
#define DDRMC_CR39_PHY_INI_COM(v) (((v) & 0xffff) << 16)
|
||||
#define DDRMC_CR39_PHY_INI_STA(v) (((v) & 0xff) << 8)
|
||||
#define DDRMC_CR39_FRQ_CH_DLLOFF(v) ((v) & 0x3)
|
||||
@@ -163,7 +165,7 @@
|
||||
#define DDRMC_CR67_ZQCS(v) ((v) & 0xfff)
|
||||
#define DDRMC_CR69_ZQ_ON_SREF_EX(v) (((v) & 0xf) << 8)
|
||||
#define DDRMC_CR70_REF_PER_ZQ(v) (v)
|
||||
#define DDRMC_CR72_ZQCS_ROTATE (1 << 24)
|
||||
#define DDRMC_CR72_ZQCS_ROTATE(v) (((v) & 0x1) << 24)
|
||||
#define DDRMC_CR73_APREBIT(v) (((v) & 0xf) << 24)
|
||||
#define DDRMC_CR73_COL_DIFF(v) (((v) & 0x7) << 16)
|
||||
#define DDRMC_CR73_ROW_DIFF(v) (((v) & 0x3) << 8)
|
||||
@@ -182,9 +184,10 @@
|
||||
#define DDRMC_CR77_CS_MAP (1 << 24)
|
||||
#define DDRMC_CR77_DI_RD_INTLEAVE (1 << 8)
|
||||
#define DDRMC_CR77_SWAP_EN 1
|
||||
#define DDRMC_CR78_Q_FULLNESS(v) (((v) & 0x7) << 24)
|
||||
#define DDRMC_CR78_BUR_ON_FLY_BIT(v) ((v) & 0xf)
|
||||
#define DDRMC_CR79_CTLUPD_AREF (1 << 24)
|
||||
#define DDRMC_CR82_INT_MASK 0x1fffffff
|
||||
#define DDRMC_CR79_CTLUPD_AREF(v) (((v) & 0x1) << 24)
|
||||
#define DDRMC_CR82_INT_MASK 0x10000000
|
||||
#define DDRMC_CR87_ODT_WR_MAPCS0 (1 << 24)
|
||||
#define DDRMC_CR87_ODT_RD_MAPCS0 (1 << 16)
|
||||
#define DDRMC_CR88_TODTL_CMD(v) (((v) & 0x1f) << 16)
|
||||
@@ -192,9 +195,17 @@
|
||||
#define DDRMC_CR91_R2W_SMCSDL(v) (((v) & 0x7) << 16)
|
||||
#define DDRMC_CR96_WLMRD(v) (((v) & 0x3f) << 8)
|
||||
#define DDRMC_CR96_WLDQSEN(v) ((v) & 0x3f)
|
||||
#define DDRMC_CR97_WRLVL_EN (1 << 24)
|
||||
#define DDRMC_CR98_WRLVL_DL_0 (0)
|
||||
#define DDRMC_CR99_WRLVL_DL_1 (0)
|
||||
#define DDRMC_CR102_RDLVL_GT_REGEN (1 << 16)
|
||||
#define DDRMC_CR102_RDLVL_REG_EN (1 << 8)
|
||||
#define DDRMC_CR105_RDLVL_DL_0(v) (((v) & 0xff) << 8)
|
||||
#define DDRMC_CR106_RDLVL_GTDL_0(v) ((v) & 0xff)
|
||||
#define DDRMC_CR110_RDLVL_DL_1(v) ((v) & 0xff)
|
||||
#define DDRMC_CR110_RDLVL_GTDL_1(v) (((v) & 0xff) << 16)
|
||||
#define DDRMC_CR114_RDLVL_GTDL_2(v) (((v) & 0xffff) << 8)
|
||||
#define DDRMC_CR115_RDLVL_GTDL_2(v) ((v) & 0xff)
|
||||
#define DDRMC_CR117_AXI0_W_PRI(v) (((v) & 0x3) << 8)
|
||||
#define DDRMC_CR117_AXI0_R_PRI(v) ((v) & 0x3)
|
||||
#define DDRMC_CR118_AXI1_W_PRI(v) (((v) & 0x3) << 24)
|
||||
@@ -208,20 +219,42 @@
|
||||
#define DDRMC_CR122_AXI0_PRIRLX(v) ((v) & 0x3ff)
|
||||
#define DDRMC_CR123_AXI1_PRI3_RPRI(v) (((v) & 0xf) << 8)
|
||||
#define DDRMC_CR123_AXI1_PRI2_RPRI(v) ((v) & 0xf)
|
||||
#define DDRMC_CR123_AXI1_P_ODR_EN (1 << 16)
|
||||
#define DDRMC_CR124_AXI1_PRIRLX(v) ((v) & 0x3ff)
|
||||
#define DDRMC_CR126_PHY_RDLAT(v) (((v) & 0x3f) << 8)
|
||||
#define DDRMC_CR132_WRLAT_ADJ(v) (((v) & 0x1f) << 8)
|
||||
#define DDRMC_CR132_RDLAT_ADJ(v) ((v) & 0x3f)
|
||||
#define DDRMC_CR137_PHYCTL_DL(v) (((v) & 0xf) << 16)
|
||||
#define DDRMC_CR138_PHY_WRLV_MXDL(v) (((v) & 0xffff) << 16)
|
||||
#define DDRMC_CR138_PHYDRAM_CK_EN(v) (((v) & 0x8) << 8)
|
||||
#define DDRMC_CR139_PHY_WRLV_RESPLAT(v) (((v) & 0xff) << 24)
|
||||
#define DDRMC_CR139_PHY_WRLV_LOAD(v) (((v) & 0xff) << 16)
|
||||
#define DDRMC_CR139_PHY_WRLV_DLL(v) (((v) & 0xff) << 8)
|
||||
#define DDRMC_CR139_PHY_WRLV_EN(v) ((v) & 0xff)
|
||||
#define DDRMC_CR140_PHY_WRLV_WW(v) ((v) & 0x3ff)
|
||||
#define DDRMC_CR143_RDLV_GAT_MXDL(v) (((v) & 0xffff) << 16)
|
||||
#define DDRMC_CR143_RDLV_MXDL(v) ((v) & 0xffff)
|
||||
#define DDRMC_CR144_PHY_RDLVL_RES(v) (((v) & 0xff) << 24)
|
||||
#define DDRMC_CR144_PHY_RDLV_LOAD(v) (((v) & 0xff) << 16)
|
||||
#define DDRMC_CR144_PHY_RDLV_DLL(v) (((v) & 0xff) << 8)
|
||||
#define DDRMC_CR144_PHY_RDLV_EN(v) ((v) & 0xff)
|
||||
#define DDRMC_CR145_PHY_RDLV_RR(v) ((v) & 0x3ff)
|
||||
#define DDRMC_CR146_PHY_RDLVL_RESP(v) (v)
|
||||
#define DDRMC_CR147_RDLV_RESP_MASK(v) ((v) & 0xfffff)
|
||||
#define DDRMC_CR148_RDLV_GATE_RESP_MASK(v) ((v) & 0xfffff)
|
||||
#define DDRMC_CR151_RDLV_GAT_DQ_ZERO_CNT(v) (((v) & 0xf) << 8)
|
||||
#define DDRMC_CR151_RDLVL_DQ_ZERO_CNT(v) ((v) & 0xf)
|
||||
#define DDRMC_CR154_PAD_ZQ_EARLY_CMP_EN_TIMER(v) (((v) & 0x1f) << 27)
|
||||
#define DDRMC_CR154_PAD_ZQ_MODE(v) (((v) & 0x3) << 21)
|
||||
#define DDRMC_CR154_DDR_SEL_PAD_CONTR(v) (((v) & 0x3) << 18)
|
||||
#define DDRMC_CR154_PAD_ZQ_HW_FOR(v) (((v) & 0x1) << 14)
|
||||
#define DDRMC_CR155_AXI0_AWCACHE (1 << 10)
|
||||
#define DDRMC_CR155_PAD_ODT_BYTE1(v) ((v) & 0x7)
|
||||
#define DDRMC_CR155_PAD_ODT_BYTE1(v) (((v) & 0x7) << 3)
|
||||
#define DDRMC_CR155_PAD_ODT_BYTE0(v) ((v) & 0x7)
|
||||
#define DDRMC_CR158_TWR(v) ((v) & 0x3f)
|
||||
#define DDRMC_CR161_ODT_EN(v) (((v) & 0x1) << 16)
|
||||
#define DDRMC_CR161_TODTH_RD(v) (((v) & 0xf) << 8)
|
||||
#define DDRMC_CR161_TODTH_WR(v) ((v) & 0xf)
|
||||
|
||||
#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
|
||||
#include <asm/types.h>
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#define VF610_ENET_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_50ohm | \
|
||||
PAD_CTL_OBE_IBE_ENABLE)
|
||||
#define VF610_DDR_PAD_CTRL PAD_CTL_DSE_25ohm
|
||||
#define VF610_DDR_PAD_CTRL_1 (PAD_CTL_DSE_25ohm | \
|
||||
PAD_CTL_INPUT_DIFFERENTIAL)
|
||||
#define VF610_I2C_PAD_CTRL (PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_50ohm | \
|
||||
PAD_CTL_SPEED_HIGH | PAD_CTL_OBE_IBE_ENABLE)
|
||||
#define VF610_NFC_IO_PAD_CTRL (PAD_CTL_SPEED_MED | PAD_CTL_SRE | \
|
||||
@@ -102,6 +104,7 @@ enum {
|
||||
|
||||
VF610_PAD_PTC28__NF_CLE = IOMUX_PAD(0x0194, 0x0194, 6, __NA_, 0, VF610_NFC_CN_PAD_CTRL),
|
||||
|
||||
VF610_PAD_DDR_RESETB = IOMUX_PAD(0x021c, 0x021c, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A15__DDR_A_15 = IOMUX_PAD(0x0220, 0x0220, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A14__DDR_A_14 = IOMUX_PAD(0x0224, 0x0224, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A13__DDR_A_13 = IOMUX_PAD(0x0228, 0x0228, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
@@ -117,6 +120,7 @@ enum {
|
||||
VF610_PAD_DDR_A3__DDR_A_3 = IOMUX_PAD(0x0250, 0x0250, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A2__DDR_A_2 = IOMUX_PAD(0x0254, 0x0254, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A1__DDR_A_1 = IOMUX_PAD(0x0258, 0x0258, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_A0__DDR_A_0 = IOMUX_PAD(0x025c, 0x025c, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_BA2__DDR_BA_2 = IOMUX_PAD(0x0260, 0x0260, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_BA1__DDR_BA_1 = IOMUX_PAD(0x0264, 0x0264, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_BA0__DDR_BA_0 = IOMUX_PAD(0x0268, 0x0268, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
@@ -124,26 +128,26 @@ enum {
|
||||
VF610_PAD_DDR_CKE__DDR_CKE_0 = IOMUX_PAD(0x0270, 0x0270, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_CLK__DDR_CLK_0 = IOMUX_PAD(0x0274, 0x0274, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_CS__DDR_CS_B_0 = IOMUX_PAD(0x0278, 0x0278, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D15__DDR_D_15 = IOMUX_PAD(0x027c, 0x027c, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D14__DDR_D_14 = IOMUX_PAD(0x0280, 0x0280, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D13__DDR_D_13 = IOMUX_PAD(0x0284, 0x0284, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D12__DDR_D_12 = IOMUX_PAD(0x0288, 0x0288, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D11__DDR_D_11 = IOMUX_PAD(0x028c, 0x028c, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D10__DDR_D_10 = IOMUX_PAD(0x0290, 0x0290, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D9__DDR_D_9 = IOMUX_PAD(0x0294, 0x0294, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D8__DDR_D_8 = IOMUX_PAD(0x0298, 0x0298, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D7__DDR_D_7 = IOMUX_PAD(0x029c, 0x029c, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D6__DDR_D_6 = IOMUX_PAD(0x02a0, 0x02a0, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D5__DDR_D_5 = IOMUX_PAD(0x02a4, 0x02a4, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D4__DDR_D_4 = IOMUX_PAD(0x02a8, 0x02a8, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D3__DDR_D_3 = IOMUX_PAD(0x02ac, 0x02ac, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D2__DDR_D_2 = IOMUX_PAD(0x02b0, 0x02b0, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D1__DDR_D_1 = IOMUX_PAD(0x02b4, 0x02b4, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D0__DDR_D_0 = IOMUX_PAD(0x02b8, 0x02b8, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_DQM1__DDR_DQM_1 = IOMUX_PAD(0x02bc, 0x02bc, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_DQM0__DDR_DQM_0 = IOMUX_PAD(0x02c0, 0x02c0, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_DQS1__DDR_DQS_1 = IOMUX_PAD(0x02c4, 0x02c4, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_DQS0__DDR_DQS_0 = IOMUX_PAD(0x02c8, 0x02c8, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_D15__DDR_D_15 = IOMUX_PAD(0x027c, 0x027c, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D14__DDR_D_14 = IOMUX_PAD(0x0280, 0x0280, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D13__DDR_D_13 = IOMUX_PAD(0x0284, 0x0284, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D12__DDR_D_12 = IOMUX_PAD(0x0288, 0x0288, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D11__DDR_D_11 = IOMUX_PAD(0x028c, 0x028c, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D10__DDR_D_10 = IOMUX_PAD(0x0290, 0x0290, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D9__DDR_D_9 = IOMUX_PAD(0x0294, 0x0294, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D8__DDR_D_8 = IOMUX_PAD(0x0298, 0x0298, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D7__DDR_D_7 = IOMUX_PAD(0x029c, 0x029c, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D6__DDR_D_6 = IOMUX_PAD(0x02a0, 0x02a0, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D5__DDR_D_5 = IOMUX_PAD(0x02a4, 0x02a4, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D4__DDR_D_4 = IOMUX_PAD(0x02a8, 0x02a8, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D3__DDR_D_3 = IOMUX_PAD(0x02ac, 0x02ac, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D2__DDR_D_2 = IOMUX_PAD(0x02b0, 0x02b0, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D1__DDR_D_1 = IOMUX_PAD(0x02b4, 0x02b4, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_D0__DDR_D_0 = IOMUX_PAD(0x02b8, 0x02b8, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_DQM1__DDR_DQM_1 = IOMUX_PAD(0x02bc, 0x02bc, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_DQM0__DDR_DQM_0 = IOMUX_PAD(0x02c0, 0x02c0, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_DQS1__DDR_DQS_1 = IOMUX_PAD(0x02c4, 0x02c4, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_DQS0__DDR_DQS_0 = IOMUX_PAD(0x02c8, 0x02c8, 0, __NA_, 0, VF610_DDR_PAD_CTRL_1),
|
||||
VF610_PAD_DDR_RAS__DDR_RAS_B = IOMUX_PAD(0x02cc, 0x02cc, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_WE__DDR_WE_B = IOMUX_PAD(0x02d0, 0x02d0, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
VF610_PAD_DDR_ODT1__DDR_ODT_0 = IOMUX_PAD(0x02d4, 0x02d4, 0, __NA_, 0, VF610_DDR_PAD_CTRL),
|
||||
|
||||
@@ -120,6 +120,8 @@ typedef u64 iomux_v3_cfg_t;
|
||||
|
||||
#define PAD_MUX_MODE_SHIFT 20
|
||||
|
||||
#define PAD_CTL_INPUT_DIFFERENTIAL (1 << 16)
|
||||
|
||||
#define PAD_CTL_SPEED_MED (1 << 12)
|
||||
#define PAD_CTL_SPEED_HIGH (3 << 12)
|
||||
|
||||
|
||||
@@ -97,12 +97,6 @@ config TARGET_MUCMC52
|
||||
config TARGET_UC101
|
||||
bool "Support uc101"
|
||||
|
||||
config TARGET_MVBC_P
|
||||
bool "Support MVBC_P"
|
||||
|
||||
config TARGET_MVSMR
|
||||
bool "Support MVSMR"
|
||||
|
||||
config TARGET_PCM030
|
||||
bool "Support pcm030"
|
||||
|
||||
@@ -139,8 +133,6 @@ source "board/jupiter/Kconfig"
|
||||
source "board/manroland/hmi1001/Kconfig"
|
||||
source "board/manroland/mucmc52/Kconfig"
|
||||
source "board/manroland/uc101/Kconfig"
|
||||
source "board/matrix_vision/mvbc_p/Kconfig"
|
||||
source "board/matrix_vision/mvsmr/Kconfig"
|
||||
source "board/mcc200/Kconfig"
|
||||
source "board/motionpro/Kconfig"
|
||||
source "board/munices/Kconfig"
|
||||
|
||||
@@ -64,12 +64,6 @@ config TARGET_SUVD3
|
||||
config TARGET_TUXX1
|
||||
bool "Support tuxx1"
|
||||
|
||||
config TARGET_MERGERBOX
|
||||
bool "Support MERGERBOX"
|
||||
|
||||
config TARGET_MVBLM7
|
||||
bool "Support MVBLM7"
|
||||
|
||||
config TARGET_TQM834X
|
||||
bool "Support TQM834x"
|
||||
|
||||
@@ -89,8 +83,6 @@ source "board/freescale/mpc837xemds/Kconfig"
|
||||
source "board/freescale/mpc837xerdb/Kconfig"
|
||||
source "board/ids/ids8313/Kconfig"
|
||||
source "board/keymile/km83xx/Kconfig"
|
||||
source "board/matrix_vision/mergerbox/Kconfig"
|
||||
source "board/matrix_vision/mvblm7/Kconfig"
|
||||
source "board/mpc8308_p1m/Kconfig"
|
||||
source "board/sbc8349/Kconfig"
|
||||
source "board/tqc/tqm834x/Kconfig"
|
||||
|
||||
@@ -52,9 +52,6 @@ config TARGET_ACADIA
|
||||
config TARGET_BAMBOO
|
||||
bool "Support bamboo"
|
||||
|
||||
config TARGET_BLUESTONE
|
||||
bool "Support bluestone"
|
||||
|
||||
config TARGET_BUBINGA
|
||||
bool "Support bubinga"
|
||||
|
||||
@@ -106,9 +103,6 @@ config TARGET_FX12MM
|
||||
config TARGET_V5FX30TEVAL
|
||||
bool "Support v5fx30teval"
|
||||
|
||||
config TARGET_CRAYL1
|
||||
bool "Support CRAYL1"
|
||||
|
||||
config TARGET_CATCENTER
|
||||
bool "Support CATcenter"
|
||||
|
||||
@@ -226,12 +220,6 @@ config TARGET_ALPR
|
||||
config TARGET_P3P440
|
||||
bool "Support p3p440"
|
||||
|
||||
config TARGET_KAREF
|
||||
bool "Support KAREF"
|
||||
|
||||
config TARGET_METROBOX
|
||||
bool "Support METROBOX"
|
||||
|
||||
config TARGET_XPEDITE1000
|
||||
bool "Support xpedite1000"
|
||||
|
||||
@@ -248,7 +236,6 @@ endchoice
|
||||
|
||||
source "board/amcc/acadia/Kconfig"
|
||||
source "board/amcc/bamboo/Kconfig"
|
||||
source "board/amcc/bluestone/Kconfig"
|
||||
source "board/amcc/bubinga/Kconfig"
|
||||
source "board/amcc/canyonlands/Kconfig"
|
||||
source "board/amcc/ebony/Kconfig"
|
||||
@@ -266,7 +253,6 @@ source "board/amcc/yosemite/Kconfig"
|
||||
source "board/amcc/yucca/Kconfig"
|
||||
source "board/avnet/fx12mm/Kconfig"
|
||||
source "board/avnet/v5fx30teval/Kconfig"
|
||||
source "board/cray/L1/Kconfig"
|
||||
source "board/csb272/Kconfig"
|
||||
source "board/csb472/Kconfig"
|
||||
source "board/dave/PPChameleonEVB/Kconfig"
|
||||
@@ -306,8 +292,6 @@ source "board/mpl/pip405/Kconfig"
|
||||
source "board/pcs440ep/Kconfig"
|
||||
source "board/prodrive/alpr/Kconfig"
|
||||
source "board/prodrive/p3p440/Kconfig"
|
||||
source "board/sandburst/karef/Kconfig"
|
||||
source "board/sandburst/metrobox/Kconfig"
|
||||
source "board/sbc405/Kconfig"
|
||||
source "board/sc3/Kconfig"
|
||||
source "board/t3corp/Kconfig"
|
||||
|
||||
@@ -234,20 +234,6 @@ static char *bootstrap_str[] = {
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'G', 'F', 'H' };
|
||||
#endif
|
||||
#if defined(CONFIG_APM821XX)
|
||||
#define SDR0_PINSTP_SHIFT 29
|
||||
static char *bootstrap_str[] = {
|
||||
"RESERVED",
|
||||
"RESERVED",
|
||||
"RESERVED",
|
||||
"NAND (8 bits)",
|
||||
"NOR (8 bits)",
|
||||
"NOR (8 bits) w/PLL Bypassed",
|
||||
"I2C (Addr 0x54)",
|
||||
"I2C (Addr 0x52)",
|
||||
};
|
||||
static char bootstrap_char[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
|
||||
#endif
|
||||
|
||||
#if defined(SDR0_PINSTP_SHIFT)
|
||||
static int bootstrap_option(void)
|
||||
|
||||
@@ -284,7 +284,7 @@ cpu_init_f (void)
|
||||
reconfigure_pll(CONFIG_SYS_PLL_RECONFIG);
|
||||
|
||||
#if (defined(CONFIG_405EP) || defined (CONFIG_405EX)) && \
|
||||
!defined(CONFIG_APM821XX) &&!defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
!defined(CONFIG_SYS_4xx_GPIO_TABLE)
|
||||
/*
|
||||
* GPIO0 setup (select GPIO or alternate function)
|
||||
*/
|
||||
@@ -440,7 +440,7 @@ cpu_init_f (void)
|
||||
#if defined(CONFIG_405EX) || \
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_460SX) || defined(CONFIG_APM821XX)
|
||||
defined(CONFIG_460SX)
|
||||
/*
|
||||
* Set PLB4 arbiter (Segment 0 and 1) to 4 deep pipeline read
|
||||
*/
|
||||
|
||||
@@ -171,7 +171,7 @@ ulong get_PCI_freq (void)
|
||||
#elif defined(CONFIG_440)
|
||||
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_460SX) || defined(CONFIG_APM821XX)
|
||||
defined(CONFIG_460SX)
|
||||
static u8 pll_fwdv_multi_bits[] = {
|
||||
/* values for: 1 - 16 */
|
||||
0x00, 0x01, 0x0f, 0x04, 0x09, 0x0a, 0x0d, 0x0e, 0x03, 0x0c,
|
||||
@@ -232,78 +232,6 @@ u32 get_cpr0_fbdv(unsigned long cpr_reg_fbdv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_APM821XX)
|
||||
|
||||
void get_sys_info(sys_info_t *sysInfo)
|
||||
{
|
||||
unsigned long plld;
|
||||
unsigned long temp;
|
||||
unsigned long mul;
|
||||
unsigned long cpudv;
|
||||
unsigned long plb2dv;
|
||||
unsigned long ddr2dv;
|
||||
|
||||
/* Calculate Forward divisor A and Feeback divisor */
|
||||
mfcpr(CPR0_PLLD, plld);
|
||||
|
||||
temp = CPR0_PLLD_FWDVA(plld);
|
||||
sysInfo->pllFwdDivA = get_cpr0_fwdv(temp);
|
||||
|
||||
temp = CPR0_PLLD_FDV(plld);
|
||||
sysInfo->pllFbkDiv = get_cpr0_fbdv(temp);
|
||||
|
||||
/* Calculate OPB clock divisor */
|
||||
mfcpr(CPR0_OPBD, temp);
|
||||
temp = CPR0_OPBD_OPBDV(temp);
|
||||
sysInfo->pllOpbDiv = temp ? temp : 4;
|
||||
|
||||
/* Calculate Peripheral clock divisor */
|
||||
mfcpr(CPR0_PERD, temp);
|
||||
temp = CPR0_PERD_PERDV(temp);
|
||||
sysInfo->pllExtBusDiv = temp ? temp : 4;
|
||||
|
||||
/* Calculate CPU clock divisor */
|
||||
mfcpr(CPR0_CPUD, temp);
|
||||
temp = CPR0_CPUD_CPUDV(temp);
|
||||
cpudv = temp ? temp : 8;
|
||||
|
||||
/* Calculate PLB2 clock divisor */
|
||||
mfcpr(CPR0_PLB2D, temp);
|
||||
temp = CPR0_PLB2D_PLB2DV(temp);
|
||||
plb2dv = temp ? temp : 4;
|
||||
|
||||
/* Calculate DDR2 clock divisor */
|
||||
mfcpr(CPR0_DDR2D, temp);
|
||||
temp = CPR0_DDR2D_DDR2DV(temp);
|
||||
ddr2dv = temp ? temp : 4;
|
||||
|
||||
/* Calculate 'M' based on feedback source */
|
||||
mfcpr(CPR0_PLLC, temp);
|
||||
temp = CPR0_PLLC_SEL(temp);
|
||||
if (temp == 0) {
|
||||
/* PLL internal feedback */
|
||||
mul = sysInfo->pllFbkDiv;
|
||||
} else {
|
||||
/* PLL PerClk feedback */
|
||||
mul = sysInfo->pllFwdDivA * sysInfo->pllFbkDiv * cpudv
|
||||
* plb2dv * 2 * sysInfo->pllOpbDiv *
|
||||
sysInfo->pllExtBusDiv;
|
||||
}
|
||||
|
||||
/* Now calculate the individual clocks */
|
||||
sysInfo->freqVCOMhz = (mul * CONFIG_SYS_CLK_FREQ) + (mul >> 1);
|
||||
sysInfo->freqProcessor = sysInfo->freqVCOMhz /
|
||||
sysInfo->pllFwdDivA / cpudv;
|
||||
sysInfo->freqPLB = sysInfo->freqVCOMhz /
|
||||
sysInfo->pllFwdDivA / cpudv / plb2dv / 2;
|
||||
sysInfo->freqOPB = sysInfo->freqPLB / sysInfo->pllOpbDiv;
|
||||
sysInfo->freqEBC = sysInfo->freqOPB / sysInfo->pllExtBusDiv;
|
||||
sysInfo->freqDDR = sysInfo->freqVCOMhz /
|
||||
sysInfo->pllFwdDivA / cpudv / ddr2dv / 2;
|
||||
sysInfo->freqUART = sysInfo->freqPLB;
|
||||
}
|
||||
|
||||
#else
|
||||
/*
|
||||
* AMCC_TODO: verify this routine against latest EAS, cause stuff changed
|
||||
* with latest EAS
|
||||
@@ -361,7 +289,6 @@ void get_sys_info (sys_info_t * sysInfo)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
|
||||
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
|
||||
|
||||
@@ -664,8 +664,7 @@ _start:
|
||||
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_460SX)
|
||||
mtdcr L2_CACHE_CFG,r0 /* Ensure L2 Cache is off */
|
||||
#elif defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_APM821XX)
|
||||
#elif defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
lis r1, 0x0000
|
||||
ori r1,r1,0x0008 /* Set L2_CACHE_CFG[RDBW]=1 */
|
||||
mtdcr L2_CACHE_CFG,r1
|
||||
@@ -694,7 +693,7 @@ _start:
|
||||
ori r1,r1, 0x0980 /* fourth 64k */
|
||||
mtdcr ISRAM0_SB3CR,r1
|
||||
#elif defined(CONFIG_440SPE) || defined(CONFIG_460EX) || \
|
||||
defined(CONFIG_460GT) || defined(CONFIG_APM821XX)
|
||||
defined(CONFIG_460GT)
|
||||
lis r1,0x0000 /* BAS = X_0000_0000 */
|
||||
ori r1,r1,0x0984 /* first 64k */
|
||||
mtdcr ISRAM0_SB0CR,r1
|
||||
@@ -707,8 +706,7 @@ _start:
|
||||
lis r1, 0x0003
|
||||
ori r1,r1, 0x0984 /* fourth 64k */
|
||||
mtdcr ISRAM0_SB3CR,r1
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
|
||||
defined(CONFIG_APM821XX)
|
||||
#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
|
||||
lis r2,0x7fff
|
||||
ori r2,r2,0xffff
|
||||
mfdcr r1,ISRAM1_DPC
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Applied Micro Circuits Corporation
|
||||
* Author: Tirumala R Marri <tmarri@apm.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _APM821XX_H_
|
||||
#define _APM821XX_H_
|
||||
|
||||
#define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
|
||||
|
||||
/* Memory mapped registers */
|
||||
#define CONFIG_SYS_PERIPHERAL_BASE 0xEF600000
|
||||
#define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0200)
|
||||
#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
|
||||
|
||||
#define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0700)
|
||||
|
||||
#define SDR0_SRST0_DMC 0x00200000
|
||||
#define SDR0_SRST1_AHB 0x00000040 /* PLB4XAHB bridge */
|
||||
|
||||
/* AHB config. */
|
||||
#define AHB_TOP 0xA4
|
||||
#define AHB_BOT 0xA5
|
||||
|
||||
/* clk divisors */
|
||||
#define PLLSYS0_FWD_DIV_A_MASK 0x000000f0 /* Fwd Div A */
|
||||
#define PLLSYS0_FWD_DIV_B_MASK 0x0000000f /* Fwd Div B */
|
||||
#define PLLSYS0_FB_DIV_MASK 0x0000ff00 /* Feedback divisor */
|
||||
#define PLLSYS0_OPB_DIV_MASK 0x0c000000 /* OPB Divisor */
|
||||
#define PLLSYS0_EPB_DIV_MASK 0x00000300 /* EPB divisor */
|
||||
#define PLLSYS0_EXTSL_MASK 0x00000080 /* PerClk feedback path */
|
||||
#define PLLSYS0_PLBEDV0_DIV_MASK 0xe0000000/* PLB Early Clk Div*/
|
||||
#define PLLSYS0_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
|
||||
#define PLLSYS0_SEL_MASK 0x18000000 /* 0 = PLL, 1 = PerClk */
|
||||
|
||||
/*
|
||||
+ * Clocking Controller
|
||||
+ */
|
||||
#define CPR0_CLKUPD 0x0020
|
||||
#define CPR0_PLLC 0x0040
|
||||
#define CPR0_PLLC_SEL(pllc) (((pllc) & 0x01000000) >> 24)
|
||||
#define CPR0_PLLD 0x0060
|
||||
#define CPR0_PLLD_FDV(plld) (((plld) & 0xff000000) >> 24)
|
||||
#define CPR0_PLLD_FWDVA(plld) (((plld) & 0x000f0000) >> 16)
|
||||
#define CPR0_CPUD 0x0080
|
||||
#define CPR0_CPUD_CPUDV(cpud) (((cpud) & 0x07000000) >> 24)
|
||||
#define CPR0_PLB2D 0x00a0
|
||||
#define CPR0_PLB2D_PLB2DV(plb2d) (((plb2d) & 0x06000000) >> 25)
|
||||
#define CPR0_OPBD 0x00c0
|
||||
#define CPR0_OPBD_OPBDV(opbd) (((opbd) & 0x03000000) >> 24)
|
||||
#define CPR0_PERD 0x00e0
|
||||
#define CPR0_PERD_PERDV(perd) (((perd) & 0x03000000) >> 24)
|
||||
#define CPR0_DDR2D 0x0100
|
||||
#define CPR0_DDR2D_DDR2DV(ddr2d) (((ddr2d) & 0x06000000) >> 25)
|
||||
#define CLK_ICFG 0x0140
|
||||
|
||||
#endif /* _APM821XX_H_ */
|
||||
@@ -53,8 +53,7 @@
|
||||
#define EBC_NUM_BANKS 6
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
|
||||
defined(CONFIG_APM821XX)
|
||||
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
|
||||
#define EBC_NUM_BANKS 3
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user