mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-26 06:30:39 +00:00
Merge remote-tracking branch 'u-boot/master' into 'u-boot-arm/master'
This commit is contained in:
commit
e1cc4d31f8
1271 changed files with 50308 additions and 8324 deletions
|
@ -106,9 +106,6 @@ matrix:
|
|||
- env:
|
||||
- TEST_CMD="tools/buildman/buildman mpc512x"
|
||||
INSTALL_TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- TEST_CMD="tools/buildman/buildman mpc824x"
|
||||
INSTALL_TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- TEST_CMD="tools/buildman/buildman mpc8260"
|
||||
INSTALL_TOOLCHAIN="ppc"
|
||||
|
|
27
Kconfig
27
Kconfig
|
@ -56,6 +56,25 @@ config CC_OPTIMIZE_FOR_SIZE
|
|||
|
||||
This option is enabled by default for U-Boot.
|
||||
|
||||
config SYS_MALLOC_F
|
||||
bool "Enable malloc() pool before relocation"
|
||||
default 0x400
|
||||
help
|
||||
Before relocation memory is very limited on many platforms. Still,
|
||||
we can provide a small malloc() pool if needed. Driver model in
|
||||
particular needs this to operate, so that it can allocate the
|
||||
initial serial device and any others that are needed.
|
||||
|
||||
config SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool before relocation"
|
||||
depends on SYS_MALLOC_F
|
||||
default 0x400
|
||||
help
|
||||
Before relocation memory is very limited on many platforms. Still,
|
||||
we can provide a small malloc() pool if needed. Driver model in
|
||||
particular needs this to operate, so that it can allocate the
|
||||
initial serial device and any others that are needed.
|
||||
|
||||
menuconfig EXPERT
|
||||
bool "Configure standard U-Boot features (expert users)"
|
||||
help
|
||||
|
@ -116,8 +135,10 @@ config FIT_VERBOSE
|
|||
depends on FIT
|
||||
|
||||
config FIT_SIGNATURE
|
||||
bool "Enabel signature verification of FIT uImages"
|
||||
bool "Enable signature verification of FIT uImages"
|
||||
depends on FIT
|
||||
depends on DM
|
||||
select RSA
|
||||
help
|
||||
This option enables signature verification of FIT uImages,
|
||||
using a hash signed and verified using RSA.
|
||||
|
@ -138,7 +159,7 @@ config SYS_EXTRA_OPTIONS
|
|||
new boards should not use this option.
|
||||
|
||||
config SYS_TEXT_BASE
|
||||
depends on SPARC
|
||||
depends on SPARC || ARC
|
||||
hex "Text Base"
|
||||
help
|
||||
TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
|
||||
|
@ -164,3 +185,5 @@ source "drivers/Kconfig"
|
|||
source "fs/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
|
||||
source "test/Kconfig"
|
||||
|
|
13
MAINTAINERS
13
MAINTAINERS
|
@ -76,9 +76,7 @@ ARM ATMEL AT91
|
|||
M: Andreas Bießmann <andreas.devel@googlemail.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-atmel.git
|
||||
F: arch/arm/cpu/armv7/at91/
|
||||
F: arch/arm/cpu/at91-common/
|
||||
F: arch/arm/include/asm/arch-at91/
|
||||
F: arch/arm/mach-at91/
|
||||
|
||||
ARM FREESCALE IMX
|
||||
M: Stefano Babic <sbabic@denx.de>
|
||||
|
@ -100,8 +98,7 @@ M: Prafulla Wadaskar <prafulla@marvell.com>
|
|||
M: Luka Perkov <luka.perkov@sartura.hr>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-marvell.git
|
||||
F: arch/arm/cpu/arm926ejs/kirkwood/
|
||||
F: arch/arm/include/asm/arch-kirkwood/
|
||||
F: arch/arm/mach-kirkwood/
|
||||
|
||||
ARM MARVELL PXA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
|
@ -147,9 +144,7 @@ ARM TEGRA
|
|||
M: Tom Warren <twarren@nvidia.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-tegra.git
|
||||
F: arch/arm/cpu/arm720t/tegra*/
|
||||
F: arch/arm/cpu/armv7/tegra*/
|
||||
F: arch/arm/cpu/tegra*/
|
||||
F: arch/arm/mach-tegra/
|
||||
F: arch/arm/include/asm/arch-tegra*/
|
||||
|
||||
ARM TI
|
||||
|
@ -170,7 +165,7 @@ 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
|
||||
N: uniphier
|
||||
|
||||
ARM ZYNQ
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
|
|
27
Makefile
27
Makefile
|
@ -1,7 +1,7 @@
|
|||
VERSION = 2015
|
||||
PATCHLEVEL = 01
|
||||
PATCHLEVEL = 04
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = -rc2
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
|
@ -281,6 +281,11 @@ os_x_before = $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
|
|||
HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc")
|
||||
HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
|
||||
HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
|
||||
|
||||
# since Lion (10.7) ASLR is on by default, but we use linker generated lists
|
||||
# in some host tools which is a problem then ... so disable ASLR for these
|
||||
# tools
|
||||
HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
|
||||
endif
|
||||
|
||||
# Decide whether to build built-in, modular, or both.
|
||||
|
@ -729,8 +734,9 @@ ALL-$(CONFIG_SPL) += $(CONFIG_SPL_TARGET:"%"=%)
|
|||
endif
|
||||
ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
|
||||
|
||||
# We can't do this yet due to the need for binary blobs
|
||||
# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
|
||||
ifneq ($(BUILD_ROM),)
|
||||
ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
|
||||
endif
|
||||
|
||||
# enable combined SPL/u-boot/dtb rules for tegra
|
||||
ifneq ($(CONFIG_TEGRA),)
|
||||
|
@ -776,6 +782,13 @@ ifneq ($(CONFIG_SYS_GENERIC_BOARD),y)
|
|||
@echo "See doc/README.generic-board for further information"
|
||||
@echo "===================================================="
|
||||
endif
|
||||
ifeq ($(CONFIG_DM_I2C_COMPAT),y)
|
||||
@echo "===================== WARNING ======================"
|
||||
@echo "This board uses CONFIG_DM_I2C_COMPAT. Please remove"
|
||||
@echo "(possibly in a subsequent patch in your series)"
|
||||
@echo "before sending patches to the mailing list."
|
||||
@echo "===================================================="
|
||||
endif
|
||||
|
||||
PHONY += dtbs
|
||||
dtbs dts/dt.dtb: checkdtc u-boot
|
||||
|
@ -849,12 +862,18 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
|
|||
MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
|
||||
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
|
||||
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
|
||||
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
|
||||
|
||||
u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
|
||||
|
||||
u-boot-dtb.img: u-boot-dtb.bin FORCE
|
||||
|
|
17
README
17
README
|
@ -1257,6 +1257,9 @@ The following options need to be configured:
|
|||
SoC, then define this variable and provide board
|
||||
specific code for the "hw_watchdog_reset" function.
|
||||
|
||||
CONFIG_AT91_HW_WDT_TIMEOUT
|
||||
specify the timeout in seconds. default 2 seconds.
|
||||
|
||||
- U-Boot Version:
|
||||
CONFIG_VERSION_VARIABLE
|
||||
If this variable is defined, an environment variable
|
||||
|
@ -3176,8 +3179,13 @@ CBFS (Coreboot Filesystem) support
|
|||
This enables the RSA algorithm used for FIT image verification
|
||||
in U-Boot. See doc/uImage.FIT/signature.txt for more information.
|
||||
|
||||
The Modular Exponentiation algorithm in RSA is implemented using
|
||||
driver model. So CONFIG_DM needs to be enabled by default for this
|
||||
library to function.
|
||||
|
||||
The signing part is build into mkimage regardless of this
|
||||
option.
|
||||
option. The software based modular exponentiation is built into
|
||||
mkimage irrespective of this option.
|
||||
|
||||
- bootcount support:
|
||||
CONFIG_BOOTCOUNT_LIMIT
|
||||
|
@ -5899,9 +5907,10 @@ option performs the converse operation of the mkimage's second form (the "-d"
|
|||
option). Given an image built by mkimage, the dumpimage extracts a "data file"
|
||||
from the image:
|
||||
|
||||
tools/dumpimage -i image -p position data_file
|
||||
-i ==> extract from the 'image' a specific 'data_file', \
|
||||
indexed by 'position'
|
||||
tools/dumpimage -i image -T type -p position data_file
|
||||
-i ==> extract from the 'image' a specific 'data_file'
|
||||
-T ==> set image type to 'type'
|
||||
-p ==> 'position' (starting at 0) of the 'data_file' inside the 'image'
|
||||
|
||||
|
||||
Installing a Linux Image:
|
||||
|
|
|
@ -4,6 +4,7 @@ choice
|
|||
|
||||
config ARC
|
||||
bool "ARC architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
|
||||
config ARM
|
||||
bool "ARM architecture"
|
||||
|
@ -39,6 +40,7 @@ config OPENRISC
|
|||
config PPC
|
||||
bool "PowerPC architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config SANDBOX
|
||||
bool "Sandbox"
|
||||
|
|
128
arch/arc/Kconfig
128
arch/arc/Kconfig
|
@ -4,8 +4,131 @@ menu "ARC architecture"
|
|||
config SYS_ARCH
|
||||
default "arc"
|
||||
|
||||
config USE_PRIVATE_LIBGCC
|
||||
default y
|
||||
|
||||
config SYS_CPU
|
||||
default "arcv1"
|
||||
default "arcv1" if ISA_ARCOMPACT
|
||||
default "arcv2" if ISA_ARCV2
|
||||
|
||||
choice
|
||||
prompt "ARC Instruction Set"
|
||||
default ISA_ARCOMPACT
|
||||
|
||||
config ISA_ARCOMPACT
|
||||
bool "ARCompact ISA"
|
||||
help
|
||||
The original ARC ISA of ARC600/700 cores
|
||||
|
||||
config ISA_ARCV2
|
||||
bool "ARC ISA v2"
|
||||
help
|
||||
ISA for the Next Generation ARC-HS cores
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "CPU selection"
|
||||
default CPU_ARC770D if ISA_ARCOMPACT
|
||||
default CPU_ARCHS38 if ISA_ARCV2
|
||||
|
||||
config CPU_ARC750D
|
||||
bool "ARC 750D"
|
||||
select ARC_MMU_V2
|
||||
depends on ISA_ARCOMPACT
|
||||
help
|
||||
Choose this option to build an U-Boot for ARC750D CPU.
|
||||
|
||||
config CPU_ARC770D
|
||||
bool "ARC 770D"
|
||||
select ARC_MMU_V3
|
||||
depends on ISA_ARCOMPACT
|
||||
help
|
||||
Choose this option to build an U-Boot for ARC770D CPU.
|
||||
|
||||
config CPU_ARCEM6
|
||||
bool "ARC EM6"
|
||||
select ARC_MMU_ABSENT
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA without MMU.
|
||||
|
||||
config CPU_ARCHS36
|
||||
bool "ARC HS36"
|
||||
select ARC_MMU_ABSENT
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA without MMU.
|
||||
|
||||
config CPU_ARCHS38
|
||||
bool "ARC HS38"
|
||||
select ARC_MMU_V4
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA with MMU.
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "MMU Version"
|
||||
default ARC_MMU_V3 if CPU_ARC770D
|
||||
default ARC_MMU_V2 if CPU_ARC750D
|
||||
default ARC_MMU_ABSENT if CPU_ARCEM6
|
||||
default ARC_MMU_ABSENT if CPU_ARCHS36
|
||||
default ARC_MMU_V4 if CPU_ARCHS38
|
||||
|
||||
config ARC_MMU_ABSENT
|
||||
bool "No MMU"
|
||||
help
|
||||
No MMU
|
||||
|
||||
config ARC_MMU_V2
|
||||
bool "MMU v2"
|
||||
depends on CPU_ARC750D
|
||||
help
|
||||
Fixed the deficiency of v1 - possible thrashing in memcpy sceanrio
|
||||
when 2 D-TLB and 1 I-TLB entries index into same 2way set.
|
||||
|
||||
config ARC_MMU_V3
|
||||
bool "MMU v3"
|
||||
depends on CPU_ARC770D
|
||||
help
|
||||
Introduced with ARC700 4.10: New Features
|
||||
Variable Page size (1k-16k), var JTLB size 128 x (2 or 4)
|
||||
Shared Address Spaces (SASID)
|
||||
|
||||
config ARC_MMU_V4
|
||||
bool "MMU v4"
|
||||
depends on CPU_ARCHS38
|
||||
help
|
||||
Introduced as a part of ARC HS38 release.
|
||||
|
||||
endchoice
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
bool "Enable Big Endian Mode"
|
||||
default n
|
||||
help
|
||||
Build kernel for Big Endian Mode of ARC CPU
|
||||
|
||||
config SYS_ICACHE_OFF
|
||||
bool "Do not use Instruction Cache"
|
||||
default n
|
||||
|
||||
config SYS_DCACHE_OFF
|
||||
bool "Do not use Data Cache"
|
||||
default n
|
||||
|
||||
config ARC_CACHE_LINE_SHIFT
|
||||
int "Cache Line Length (as power of 2)"
|
||||
range 5 7
|
||||
default "6"
|
||||
depends on !SYS_DCACHE_OFF || !SYS_DCACHE_OFF
|
||||
help
|
||||
Starting with ARC700 4.9, Cache line length is configurable,
|
||||
This option specifies "N", with Line-len = 2 power N
|
||||
So line lengths of 32, 64, 128 are specified by 5,6,7, respectively
|
||||
Linux only supports same line lengths for I and D caches.
|
||||
|
||||
choice
|
||||
prompt "Target select"
|
||||
|
@ -16,9 +139,6 @@ config TARGET_TB100
|
|||
config TARGET_ARCANGEL4
|
||||
bool "Support arcangel4"
|
||||
|
||||
config TARGET_ARCANGEL4_BE
|
||||
bool "Support arcangel4-be"
|
||||
|
||||
config TARGET_AXS101
|
||||
bool "Support axs101"
|
||||
|
||||
|
|
|
@ -4,17 +4,22 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
ifndef CONFIG_SYS_BIG_ENDIAN
|
||||
ifndef CONFIG_CPU_BIG_ENDIAN
|
||||
CONFIG_SYS_LITTLE_ENDIAN = 1
|
||||
else
|
||||
CONFIG_SYS_BIG_ENDIAN = 1
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SYS_LITTLE_ENDIAN
|
||||
ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc-
|
||||
PLATFORM_LDFLAGS += -EL
|
||||
PLATFORM_CPPFLAGS += -mlittle-endian
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SYS_BIG_ENDIAN
|
||||
ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc-
|
||||
PLATFORM_LDFLAGS += -EB
|
||||
PLATFORM_CPPFLAGS += -mbig-endian
|
||||
endif
|
||||
|
||||
ifeq ($(CROSS_COMPILE),)
|
||||
|
@ -25,6 +30,26 @@ ifdef CONFIG_ARC_MMU_VER
|
|||
CONFIG_MMU = 1
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARC750D
|
||||
PLATFORM_CPPFLAGS += -marc700
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARC770D
|
||||
PLATFORM_CPPFLAGS += -marc700 -mlock -mswape
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARCEM6
|
||||
PLATFORM_CPPFLAGS += -marcem
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARCHS34
|
||||
PLATFORM_CPPFLAGS += -marchs
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARCHS38
|
||||
PLATFORM_CPPFLAGS += -marchs
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
|
||||
|
||||
# Needed for relocation
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
PLATFORM_CPPFLAGS += -mA7
|
7
arch/arc/cpu/arcv2/Makefile
Normal file
7
arch/arc/cpu/arcv2/Makefile
Normal file
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += start.o
|
254
arch/arc/cpu/arcv2/start.S
Normal file
254
arch/arc/cpu/arcv2/start.S
Normal file
|
@ -0,0 +1,254 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <asm/arcregs.h>
|
||||
|
||||
/*
|
||||
* Note on the LD/ST addressing modes with address register write-back
|
||||
*
|
||||
* LD.a same as LD.aw
|
||||
*
|
||||
* LD.a reg1, [reg2, x] => Pre Incr
|
||||
* Eff Addr for load = [reg2 + x]
|
||||
*
|
||||
* LD.ab reg1, [reg2, x] => Post Incr
|
||||
* Eff Addr for load = [reg2]
|
||||
*/
|
||||
|
||||
.macro PUSH reg
|
||||
st.a \reg, [%sp, -4]
|
||||
.endm
|
||||
|
||||
.macro PUSHAX aux
|
||||
lr %r9, [\aux]
|
||||
PUSH %r9
|
||||
.endm
|
||||
|
||||
.macro SAVE_R1_TO_R24
|
||||
PUSH %r1
|
||||
PUSH %r2
|
||||
PUSH %r3
|
||||
PUSH %r4
|
||||
PUSH %r5
|
||||
PUSH %r6
|
||||
PUSH %r7
|
||||
PUSH %r8
|
||||
PUSH %r9
|
||||
PUSH %r10
|
||||
PUSH %r11
|
||||
PUSH %r12
|
||||
PUSH %r13
|
||||
PUSH %r14
|
||||
PUSH %r15
|
||||
PUSH %r16
|
||||
PUSH %r17
|
||||
PUSH %r18
|
||||
PUSH %r19
|
||||
PUSH %r20
|
||||
PUSH %r21
|
||||
PUSH %r22
|
||||
PUSH %r23
|
||||
PUSH %r24
|
||||
.endm
|
||||
|
||||
.macro SAVE_ALL_SYS
|
||||
/* saving %r0 to reg->r0 in advance since weread %ecr into it */
|
||||
st %r0, [%sp, -8]
|
||||
lr %r0, [%ecr] /* all stack addressing is manual so far */
|
||||
st %r0, [%sp]
|
||||
st %sp, [%sp, -4]
|
||||
/* now move %sp to reg->r0 position so we can do "push" automatically */
|
||||
sub %sp, %sp, 8
|
||||
|
||||
SAVE_R1_TO_R24
|
||||
PUSH %r25
|
||||
PUSH %gp
|
||||
PUSH %fp
|
||||
PUSH %blink
|
||||
PUSHAX %eret
|
||||
PUSHAX %erstatus
|
||||
PUSH %lp_count
|
||||
PUSHAX %lp_end
|
||||
PUSHAX %lp_start
|
||||
PUSHAX %erbta
|
||||
.endm
|
||||
|
||||
.macro SAVE_EXCEPTION_SOURCE
|
||||
#ifdef CONFIG_MMU
|
||||
/* If MMU exists exception faulting address is loaded in EFA reg */
|
||||
lr %r0, [%efa]
|
||||
#else
|
||||
/* Otherwise in ERET (exception return) reg */
|
||||
lr %r0, [%eret]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.section .ivt, "a",@progbits
|
||||
.align 4
|
||||
/* Critical system events */
|
||||
.word _start /* 0 - 0x000 */
|
||||
.word memory_error /* 1 - 0x008 */
|
||||
.word instruction_error /* 2 - 0x010 */
|
||||
|
||||
/* Exceptions */
|
||||
.word EV_MachineCheck /* 0x100, Fatal Machine check (0x20) */
|
||||
.word EV_TLBMissI /* 0x108, Intruction TLB miss (0x21) */
|
||||
.word EV_TLBMissD /* 0x110, Data TLB miss (0x22) */
|
||||
.word EV_TLBProtV /* 0x118, Protection Violation (0x23)
|
||||
or Misaligned Access */
|
||||
.word EV_PrivilegeV /* 0x120, Privilege Violation (0x24) */
|
||||
.word EV_Trap /* 0x128, Trap exception (0x25) */
|
||||
.word EV_Extension /* 0x130, Extn Intruction Excp (0x26) */
|
||||
|
||||
/* Device interrupts */
|
||||
.rept 29
|
||||
j interrupt_handler /* 3:31 - 0x018:0xF8 */
|
||||
.endr
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
_start:
|
||||
/* Setup interrupt vector base that matches "__text_start" */
|
||||
sr __ivt_start, [ARC_AUX_INTR_VEC_BASE]
|
||||
|
||||
/* Setup stack pointer */
|
||||
mov %sp, CONFIG_SYS_INIT_SP_ADDR
|
||||
mov %fp, %sp
|
||||
|
||||
/* Clear bss */
|
||||
mov %r0, __bss_start
|
||||
mov %r1, __bss_end
|
||||
|
||||
clear_bss:
|
||||
st.ab 0, [%r0, 4]
|
||||
brlt %r0, %r1, clear_bss
|
||||
|
||||
/* Zero the one and only argument of "board_init_f" */
|
||||
mov_s %r0, 0
|
||||
j board_init_f
|
||||
|
||||
memory_error:
|
||||
SAVE_ALL_SYS
|
||||
SAVE_EXCEPTION_SOURCE
|
||||
mov %r1, %sp
|
||||
j do_memory_error
|
||||
|
||||
instruction_error:
|
||||
SAVE_ALL_SYS
|
||||
SAVE_EXCEPTION_SOURCE
|
||||
mov %r1, %sp
|
||||
j do_instruction_error
|
||||
|
||||
interrupt_handler:
|
||||
/* Todo - save and restore CPU context when interrupts will be in use */
|
||||
bl do_interrupt_handler
|
||||
rtie
|
||||
|
||||
EV_MachineCheck:
|
||||
SAVE_ALL_SYS
|
||||
SAVE_EXCEPTION_SOURCE
|
||||
mov %r1, %sp
|
||||
j do_machine_check_fault
|
||||
|
||||
EV_TLBMissI:
|
||||
SAVE_ALL_SYS
|
||||
mov %r0, %sp
|
||||
j do_itlb_miss
|
||||
|
||||
EV_TLBMissD:
|
||||
SAVE_ALL_SYS
|
||||
mov %r0, %sp
|
||||
j do_dtlb_miss
|
||||
|
||||
EV_TLBProtV:
|
||||
SAVE_ALL_SYS
|
||||
SAVE_EXCEPTION_SOURCE
|
||||
mov %r1, %sp
|
||||
j do_tlb_prot_violation
|
||||
|
||||
EV_PrivilegeV:
|
||||
SAVE_ALL_SYS
|
||||
mov %r0, %sp
|
||||
j do_privilege_violation
|
||||
|
||||
EV_Trap:
|
||||
SAVE_ALL_SYS
|
||||
mov %r0, %sp
|
||||
j do_trap
|
||||
|
||||
EV_Extension:
|
||||
SAVE_ALL_SYS
|
||||
mov %r0, %sp
|
||||
j do_extension
|
||||
|
||||
/*
|
||||
* void relocate_code (addr_sp, gd, addr_moni)
|
||||
*
|
||||
* This "function" does not return, instead it continues in RAM
|
||||
* after relocating the monitor code.
|
||||
*
|
||||
* r0 = start_addr_sp
|
||||
* r1 = new__gd
|
||||
* r2 = relocaddr
|
||||
*/
|
||||
.align 4
|
||||
.globl relocate_code
|
||||
relocate_code:
|
||||
/*
|
||||
* r0-r12 might be clobbered by C functions
|
||||
* so we use r13-r16 for storage here
|
||||
*/
|
||||
mov %r13, %r0 /* save addr_sp */
|
||||
mov %r14, %r1 /* save addr of gd */
|
||||
mov %r15, %r2 /* save addr of destination */
|
||||
|
||||
mov %r16, %r2 /* %r9 - relocation offset */
|
||||
sub %r16, %r16, __image_copy_start
|
||||
|
||||
/* Set up the stack */
|
||||
stack_setup:
|
||||
mov %sp, %r13
|
||||
mov %fp, %sp
|
||||
|
||||
/* Check if monitor is loaded right in place for relocation */
|
||||
mov %r0, __image_copy_start
|
||||
cmp %r0, %r15 /* skip relocation if code loaded */
|
||||
bz do_board_init_r /* in target location already */
|
||||
|
||||
/* Copy data (__image_copy_start - __image_copy_end) to new location */
|
||||
mov %r1, %r15
|
||||
mov %r2, __image_copy_end
|
||||
sub %r2, %r2, %r0 /* r3 <- amount of bytes to copy */
|
||||
asr %r2, %r2, 2 /* r3 <- amount of words to copy */
|
||||
mov %lp_count, %r2
|
||||
lp copy_end
|
||||
ld.ab %r2,[%r0,4]
|
||||
st.ab %r2,[%r1,4]
|
||||
copy_end:
|
||||
|
||||
/* Fix relocations related issues */
|
||||
bl do_elf_reloc_fixups
|
||||
#ifndef CONFIG_SYS_ICACHE_OFF
|
||||
bl invalidate_icache_all
|
||||
#endif
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
bl flush_dcache_all
|
||||
#endif
|
||||
|
||||
/* Update position of intterupt vector table */
|
||||
lr %r0, [ARC_AUX_INTR_VEC_BASE] /* Read current position */
|
||||
add %r0, %r0, %r16 /* Update address */
|
||||
sr %r0, [ARC_AUX_INTR_VEC_BASE] /* Write new position */
|
||||
|
||||
do_board_init_r:
|
||||
/* Prepare for exection of "board_init_r" in relocated monitor */
|
||||
mov %r2, board_init_r /* old address of "board_init_r()" */
|
||||
add %r2, %r2, %r16 /* new address of "board_init_r()" */
|
||||
mov %r0, %r14 /* 1-st parameter: gd_t */
|
||||
mov %r1, %r15 /* 2-nd parameter: dest_addr */
|
||||
j [%r2]
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef _ASM_ARC_ARCREGS_H
|
||||
#define _ASM_ARC_ARCREGS_H
|
||||
|
||||
#include <asm/cache.h>
|
||||
|
||||
/*
|
||||
* ARC architecture has additional address space - auxiliary registers.
|
||||
* These registers are mostly used for configuration purposes.
|
||||
|
@ -21,7 +23,7 @@
|
|||
#define ARC_AUX_IC_IVIC 0x10
|
||||
#define ARC_AUX_IC_CTRL 0x11
|
||||
#define ARC_AUX_IC_IVIL 0x19
|
||||
#if (CONFIG_ARC_MMU_VER > 2)
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
#define ARC_AUX_IC_PTAG 0x1E
|
||||
#endif
|
||||
#define ARC_BCR_IC_BUILD 0x77
|
||||
|
@ -40,7 +42,7 @@
|
|||
#define ARC_AUX_DC_IVDL 0x4A
|
||||
#define ARC_AUX_DC_FLSH 0x4B
|
||||
#define ARC_AUX_DC_FLDL 0x4C
|
||||
#if (CONFIG_ARC_MMU_VER > 2)
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
#define ARC_AUX_DC_PTAG 0x5C
|
||||
#endif
|
||||
#define ARC_BCR_DC_BUILD 0x72
|
||||
|
|
|
@ -9,15 +9,22 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
* The current upper bound for ARC L1 data cache line sizes is 128 bytes.
|
||||
* We use that value for aligning DMA buffers unless the board config has
|
||||
* specified an alternate cache line size.
|
||||
*/
|
||||
#ifdef CONFIG_SYS_CACHELINE_SIZE
|
||||
#define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
|
||||
#ifdef CONFIG_ARC_CACHE_LINE_SHIFT
|
||||
#define CONFIG_SYS_CACHELINE_SIZE (1 << CONFIG_ARC_CACHE_LINE_SHIFT)
|
||||
#define ARCH_DMA_MINALIGN CONFIG_SYS_CACHELINE_SIZE
|
||||
#else
|
||||
#define ARCH_DMA_MINALIGN 128
|
||||
/* Satisfy users of ARCH_DMA_MINALIGN */
|
||||
#define ARCH_DMA_MINALIGN 128
|
||||
#endif
|
||||
|
||||
#if defined(ARC_MMU_ABSENT)
|
||||
#define CONFIG_ARC_MMU_VER 0
|
||||
#elif defined(CONFIG_ARC_MMU_V2)
|
||||
#define CONFIG_ARC_MMU_VER 2
|
||||
#elif defined(CONFIG_ARC_MMU_V3)
|
||||
#define CONFIG_ARC_MMU_VER 3
|
||||
#elif defined(CONFIG_ARC_MMU_V4)
|
||||
#define CONFIG_ARC_MMU_VER 4
|
||||
#endif
|
||||
|
||||
#endif /* __ASM_ARC_CACHE_H */
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
#ifndef __ASM_ARC_CONFIG_H_
|
||||
#define __ASM_ARC_CONFIG_H_
|
||||
|
||||
#define CONFIG_SYS_GENERIC_BOARD
|
||||
#define CONFIG_SYS_GENERIC_GLOBAL_DATA
|
||||
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
|
||||
#define CONFIG_ARCH_EARLY_INIT_R
|
||||
|
||||
#define CONFIG_LMB
|
||||
|
||||
|
|
|
@ -20,3 +20,5 @@ obj-y += reset.o
|
|||
obj-y += timer.o
|
||||
|
||||
obj-$(CONFIG_CMD_BOOTM) += bootm.o
|
||||
|
||||
lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _millicodethunk.o libgcc2.o
|
||||
|
|
226
arch/arc/lib/_millicodethunk.S
Normal file
226
arch/arc/lib/_millicodethunk.S
Normal file
|
@ -0,0 +1,226 @@
|
|||
/*
|
||||
* Copyright (C) 1995, 1997, 2007-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* ANSI concatenation macros. */
|
||||
|
||||
#define CONCAT1(a, b) CONCAT2(a, b)
|
||||
#define CONCAT2(a, b) a ## b
|
||||
|
||||
/* Use the right prefix for global labels. */
|
||||
|
||||
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
|
||||
|
||||
#ifndef WORKING_ASSEMBLER
|
||||
#define abs_l abs
|
||||
#define asl_l asl
|
||||
#define mov_l mov
|
||||
#endif
|
||||
|
||||
#define FUNC(X) .type SYM(X),@function
|
||||
#define HIDDEN_FUNC(X) FUNC(X)` .hidden X
|
||||
#define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X
|
||||
#define ENDFUNC(X) ENDFUNC0(X)
|
||||
|
||||
.section .text
|
||||
.align 4
|
||||
.global SYM(__st_r13_to_r15)
|
||||
.global SYM(__st_r13_to_r16)
|
||||
.global SYM(__st_r13_to_r17)
|
||||
.global SYM(__st_r13_to_r18)
|
||||
.global SYM(__st_r13_to_r19)
|
||||
.global SYM(__st_r13_to_r20)
|
||||
.global SYM(__st_r13_to_r21)
|
||||
.global SYM(__st_r13_to_r22)
|
||||
.global SYM(__st_r13_to_r23)
|
||||
.global SYM(__st_r13_to_r24)
|
||||
.global SYM(__st_r13_to_r25)
|
||||
HIDDEN_FUNC(__st_r13_to_r15)
|
||||
HIDDEN_FUNC(__st_r13_to_r16)
|
||||
HIDDEN_FUNC(__st_r13_to_r17)
|
||||
HIDDEN_FUNC(__st_r13_to_r18)
|
||||
HIDDEN_FUNC(__st_r13_to_r19)
|
||||
HIDDEN_FUNC(__st_r13_to_r20)
|
||||
HIDDEN_FUNC(__st_r13_to_r21)
|
||||
HIDDEN_FUNC(__st_r13_to_r22)
|
||||
HIDDEN_FUNC(__st_r13_to_r23)
|
||||
HIDDEN_FUNC(__st_r13_to_r24)
|
||||
HIDDEN_FUNC(__st_r13_to_r25)
|
||||
.align 4
|
||||
SYM(__st_r13_to_r25):
|
||||
st r25, [sp,48]
|
||||
SYM(__st_r13_to_r24):
|
||||
st r24, [sp,44]
|
||||
SYM(__st_r13_to_r23):
|
||||
st r23, [sp,40]
|
||||
SYM(__st_r13_to_r22):
|
||||
st r22, [sp,36]
|
||||
SYM(__st_r13_to_r21):
|
||||
st r21, [sp,32]
|
||||
SYM(__st_r13_to_r20):
|
||||
st r20, [sp,28]
|
||||
SYM(__st_r13_to_r19):
|
||||
st r19, [sp,24]
|
||||
SYM(__st_r13_to_r18):
|
||||
st r18, [sp,20]
|
||||
SYM(__st_r13_to_r17):
|
||||
st r17, [sp,16]
|
||||
SYM(__st_r13_to_r16):
|
||||
st r16, [sp,12]
|
||||
SYM(__st_r13_to_r15):
|
||||
#ifdef __ARC700__
|
||||
st r15, [sp,8] ; minimum function size to avoid stall: 6 bytes.
|
||||
#else
|
||||
st_s r15, [sp,8]
|
||||
#endif
|
||||
st_s r14, [sp,4]
|
||||
j_s.d [%blink]
|
||||
st_s r13, [sp,0]
|
||||
ENDFUNC(__st_r13_to_r15)
|
||||
ENDFUNC(__st_r13_to_r16)
|
||||
ENDFUNC(__st_r13_to_r17)
|
||||
ENDFUNC(__st_r13_to_r18)
|
||||
ENDFUNC(__st_r13_to_r19)
|
||||
ENDFUNC(__st_r13_to_r20)
|
||||
ENDFUNC(__st_r13_to_r21)
|
||||
ENDFUNC(__st_r13_to_r22)
|
||||
ENDFUNC(__st_r13_to_r23)
|
||||
ENDFUNC(__st_r13_to_r24)
|
||||
ENDFUNC(__st_r13_to_r25)
|
||||
|
||||
.section .text
|
||||
.align 4
|
||||
; ==================================
|
||||
; the loads
|
||||
|
||||
.global SYM(__ld_r13_to_r15)
|
||||
.global SYM(__ld_r13_to_r16)
|
||||
.global SYM(__ld_r13_to_r17)
|
||||
.global SYM(__ld_r13_to_r18)
|
||||
.global SYM(__ld_r13_to_r19)
|
||||
.global SYM(__ld_r13_to_r20)
|
||||
.global SYM(__ld_r13_to_r21)
|
||||
.global SYM(__ld_r13_to_r22)
|
||||
.global SYM(__ld_r13_to_r23)
|
||||
.global SYM(__ld_r13_to_r24)
|
||||
.global SYM(__ld_r13_to_r25)
|
||||
HIDDEN_FUNC(__ld_r13_to_r15)
|
||||
HIDDEN_FUNC(__ld_r13_to_r16)
|
||||
HIDDEN_FUNC(__ld_r13_to_r17)
|
||||
HIDDEN_FUNC(__ld_r13_to_r18)
|
||||
HIDDEN_FUNC(__ld_r13_to_r19)
|
||||
HIDDEN_FUNC(__ld_r13_to_r20)
|
||||
HIDDEN_FUNC(__ld_r13_to_r21)
|
||||
HIDDEN_FUNC(__ld_r13_to_r22)
|
||||
HIDDEN_FUNC(__ld_r13_to_r23)
|
||||
HIDDEN_FUNC(__ld_r13_to_r24)
|
||||
HIDDEN_FUNC(__ld_r13_to_r25)
|
||||
SYM(__ld_r13_to_r25):
|
||||
ld r25, [sp,48]
|
||||
SYM(__ld_r13_to_r24):
|
||||
ld r24, [sp,44]
|
||||
SYM(__ld_r13_to_r23):
|
||||
ld r23, [sp,40]
|
||||
SYM(__ld_r13_to_r22):
|
||||
ld r22, [sp,36]
|
||||
SYM(__ld_r13_to_r21):
|
||||
ld r21, [sp,32]
|
||||
SYM(__ld_r13_to_r20):
|
||||
ld r20, [sp,28]
|
||||
SYM(__ld_r13_to_r19):
|
||||
ld r19, [sp,24]
|
||||
SYM(__ld_r13_to_r18):
|
||||
ld r18, [sp,20]
|
||||
SYM(__ld_r13_to_r17):
|
||||
ld r17, [sp,16]
|
||||
SYM(__ld_r13_to_r16):
|
||||
ld r16, [sp,12]
|
||||
SYM(__ld_r13_to_r15):
|
||||
#ifdef __ARC700__
|
||||
ld r15, [sp,8] ; minimum function size to avoid stall: 6 bytes.
|
||||
#else
|
||||
ld_s r15, [sp,8]
|
||||
#endif
|
||||
ld_s r14, [sp,4]
|
||||
j_s.d [%blink]
|
||||
ld_s r13, [sp,0]
|
||||
ENDFUNC(__ld_r13_to_r15)
|
||||
ENDFUNC(__ld_r13_to_r16)
|
||||
ENDFUNC(__ld_r13_to_r17)
|
||||
ENDFUNC(__ld_r13_to_r18)
|
||||
ENDFUNC(__ld_r13_to_r19)
|
||||
ENDFUNC(__ld_r13_to_r20)
|
||||
ENDFUNC(__ld_r13_to_r21)
|
||||
ENDFUNC(__ld_r13_to_r22)
|
||||
ENDFUNC(__ld_r13_to_r23)
|
||||
ENDFUNC(__ld_r13_to_r24)
|
||||
ENDFUNC(__ld_r13_to_r25)
|
||||
|
||||
.global SYM(__ld_r13_to_r14_ret)
|
||||
.global SYM(__ld_r13_to_r15_ret)
|
||||
.global SYM(__ld_r13_to_r16_ret)
|
||||
.global SYM(__ld_r13_to_r17_ret)
|
||||
.global SYM(__ld_r13_to_r18_ret)
|
||||
.global SYM(__ld_r13_to_r19_ret)
|
||||
.global SYM(__ld_r13_to_r20_ret)
|
||||
.global SYM(__ld_r13_to_r21_ret)
|
||||
.global SYM(__ld_r13_to_r22_ret)
|
||||
.global SYM(__ld_r13_to_r23_ret)
|
||||
.global SYM(__ld_r13_to_r24_ret)
|
||||
.global SYM(__ld_r13_to_r25_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r14_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r15_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r16_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r17_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r18_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r19_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r20_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r21_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r22_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r23_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r24_ret)
|
||||
HIDDEN_FUNC(__ld_r13_to_r25_ret)
|
||||
.section .text
|
||||
.align 4
|
||||
SYM(__ld_r13_to_r25_ret):
|
||||
ld r25, [sp,48]
|
||||
SYM(__ld_r13_to_r24_ret):
|
||||
ld r24, [sp,44]
|
||||
SYM(__ld_r13_to_r23_ret):
|
||||
ld r23, [sp,40]
|
||||
SYM(__ld_r13_to_r22_ret):
|
||||
ld r22, [sp,36]
|
||||
SYM(__ld_r13_to_r21_ret):
|
||||
ld r21, [sp,32]
|
||||
SYM(__ld_r13_to_r20_ret):
|
||||
ld r20, [sp,28]
|
||||
SYM(__ld_r13_to_r19_ret):
|
||||
ld r19, [sp,24]
|
||||
SYM(__ld_r13_to_r18_ret):
|
||||
ld r18, [sp,20]
|
||||
SYM(__ld_r13_to_r17_ret):
|
||||
ld r17, [sp,16]
|
||||
SYM(__ld_r13_to_r16_ret):
|
||||
ld r16, [sp,12]
|
||||
SYM(__ld_r13_to_r15_ret):
|
||||
ld r15, [sp,8]
|
||||
SYM(__ld_r13_to_r14_ret):
|
||||
ld blink,[sp,r12]
|
||||
ld_s r14, [sp,4]
|
||||
ld.ab r13, [sp,r12]
|
||||
j_s.d [%blink]
|
||||
add_s sp,sp,4
|
||||
ENDFUNC(__ld_r13_to_r14_ret)
|
||||
ENDFUNC(__ld_r13_to_r15_ret)
|
||||
ENDFUNC(__ld_r13_to_r16_ret)
|
||||
ENDFUNC(__ld_r13_to_r17_ret)
|
||||
ENDFUNC(__ld_r13_to_r18_ret)
|
||||
ENDFUNC(__ld_r13_to_r19_ret)
|
||||
ENDFUNC(__ld_r13_to_r20_ret)
|
||||
ENDFUNC(__ld_r13_to_r21_ret)
|
||||
ENDFUNC(__ld_r13_to_r22_ret)
|
||||
ENDFUNC(__ld_r13_to_r23_ret)
|
||||
ENDFUNC(__ld_r13_to_r24_ret)
|
||||
ENDFUNC(__ld_r13_to_r25_ret)
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <config.h>
|
||||
#include <asm/arcregs.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
/* Bit values in IC_CTRL */
|
||||
#define IC_CTRL_CACHE_DISABLE (1 << 0)
|
||||
|
@ -101,7 +102,7 @@ void flush_dcache_all(void)
|
|||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
static void dcache_flush_line(unsigned addr)
|
||||
{
|
||||
#if (CONFIG_ARC_MMU_VER > 2)
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
write_aux_reg(ARC_AUX_DC_PTAG, addr);
|
||||
#endif
|
||||
write_aux_reg(ARC_AUX_DC_FLDL, addr);
|
||||
|
@ -115,7 +116,7 @@ static void dcache_flush_line(unsigned addr)
|
|||
* Invalidate I$ for addresses range just flushed from D$.
|
||||
* If we try to execute data flushed above it will be valid/correct
|
||||
*/
|
||||
#if (CONFIG_ARC_MMU_VER > 2)
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
write_aux_reg(ARC_AUX_IC_PTAG, addr);
|
||||
#endif
|
||||
write_aux_reg(ARC_AUX_IC_IVIL, addr);
|
||||
|
@ -145,7 +146,7 @@ void invalidate_dcache_range(unsigned long start, unsigned long end)
|
|||
end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
|
||||
|
||||
for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE) {
|
||||
#if (CONFIG_ARC_MMU_VER > 2)
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
write_aux_reg(ARC_AUX_DC_PTAG, addr);
|
||||
#endif
|
||||
write_aux_reg(ARC_AUX_DC_IVDL, addr);
|
||||
|
|
161
arch/arc/lib/libgcc2.c
Normal file
161
arch/arc/lib/libgcc2.c
Normal file
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include "libgcc2.h"
|
||||
|
||||
DWtype
|
||||
__ashldi3(DWtype u, shift_count_type b)
|
||||
{
|
||||
if (b == 0)
|
||||
return u;
|
||||
|
||||
const DWunion uu = {.ll = u};
|
||||
const shift_count_type bm = W_TYPE_SIZE - b;
|
||||
DWunion w;
|
||||
|
||||
if (bm <= 0) {
|
||||
w.s.low = 0;
|
||||
w.s.high = (UWtype)uu.s.low << -bm;
|
||||
} else {
|
||||
const UWtype carries = (UWtype) uu.s.low >> bm;
|
||||
|
||||
w.s.low = (UWtype)uu.s.low << b;
|
||||
w.s.high = ((UWtype)uu.s.high << b) | carries;
|
||||
}
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
|
||||
DWtype
|
||||
__ashrdi3(DWtype u, shift_count_type b)
|
||||
{
|
||||
if (b == 0)
|
||||
return u;
|
||||
|
||||
const DWunion uu = {.ll = u};
|
||||
const shift_count_type bm = W_TYPE_SIZE - b;
|
||||
DWunion w;
|
||||
|
||||
if (bm <= 0) {
|
||||
/* w.s.high = 1..1 or 0..0 */
|
||||
w.s.high = uu.s.high >> (W_TYPE_SIZE - 1);
|
||||
w.s.low = uu.s.high >> -bm;
|
||||
} else {
|
||||
const UWtype carries = (UWtype) uu.s.high << bm;
|
||||
|
||||
w.s.high = uu.s.high >> b;
|
||||
w.s.low = ((UWtype)uu.s.low >> b) | carries;
|
||||
}
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
|
||||
DWtype
|
||||
__lshrdi3(DWtype u, shift_count_type b)
|
||||
{
|
||||
if (b == 0)
|
||||
return u;
|
||||
|
||||
const DWunion uu = {.ll = u};
|
||||
const shift_count_type bm = W_TYPE_SIZE - b;
|
||||
DWunion w;
|
||||
|
||||
if (bm <= 0) {
|
||||
w.s.high = 0;
|
||||
w.s.low = (UWtype)uu.s.high >> -bm;
|
||||
} else {
|
||||
const UWtype carries = (UWtype)uu.s.high << bm;
|
||||
|
||||
w.s.high = (UWtype)uu.s.high >> b;
|
||||
w.s.low = ((UWtype)uu.s.low >> b) | carries;
|
||||
}
|
||||
|
||||
return w.ll;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
udivmodsi4(unsigned long num, unsigned long den, int modwanted)
|
||||
{
|
||||
unsigned long bit = 1;
|
||||
unsigned long res = 0;
|
||||
|
||||
while (den < num && bit && !(den & (1L<<31))) {
|
||||
den <<= 1;
|
||||
bit <<= 1;
|
||||
}
|
||||
|
||||
while (bit) {
|
||||
if (num >= den) {
|
||||
num -= den;
|
||||
res |= bit;
|
||||
}
|
||||
bit >>= 1;
|
||||
den >>= 1;
|
||||
}
|
||||
|
||||
if (modwanted)
|
||||
return num;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
long
|
||||
__divsi3(long a, long b)
|
||||
{
|
||||
int neg = 0;
|
||||
long res;
|
||||
|
||||
if (a < 0) {
|
||||
a = -a;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
if (b < 0) {
|
||||
b = -b;
|
||||
neg = !neg;
|
||||
}
|
||||
|
||||
res = udivmodsi4(a, b, 0);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
long
|
||||
__modsi3(long a, long b)
|
||||
{
|
||||
int neg = 0;
|
||||
long res;
|
||||
|
||||
if (a < 0) {
|
||||
a = -a;
|
||||
neg = 1;
|
||||
}
|
||||
|
||||
if (b < 0)
|
||||
b = -b;
|
||||
|
||||
res = udivmodsi4(a, b, 1);
|
||||
|
||||
if (neg)
|
||||
res = -res;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
long
|
||||
__udivsi3(long a, long b)
|
||||
{
|
||||
return udivmodsi4(a, b, 0);
|
||||
}
|
||||
|
||||
long
|
||||
__umodsi3(long a, long b)
|
||||
{
|
||||
return udivmodsi4(a, b, 1);
|
||||
}
|
132
arch/arc/lib/libgcc2.h
Normal file
132
arch/arc/lib/libgcc2.h
Normal file
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_LIBGCC_H
|
||||
#define __ASM_LIBGCC_H
|
||||
|
||||
#define UNITS_PER_WORD 4 /* for ARC */
|
||||
#define BITS_PER_UNIT 8 /* for ARC */
|
||||
|
||||
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
|
||||
|
||||
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
|
||||
|
||||
/* Work out the largest "word" size that we can deal with on this target. */
|
||||
#if MIN_UNITS_PER_WORD > 4
|
||||
# define LIBGCC2_MAX_UNITS_PER_WORD 8
|
||||
#elif (MIN_UNITS_PER_WORD > 2 \
|
||||
|| (MIN_UNITS_PER_WORD > 1 && __SIZEOF_LONG_LONG__ > 4))
|
||||
# define LIBGCC2_MAX_UNITS_PER_WORD 4
|
||||
#else
|
||||
# define LIBGCC2_MAX_UNITS_PER_WORD MIN_UNITS_PER_WORD
|
||||
#endif
|
||||
|
||||
/* Work out what word size we are using for this compilation.
|
||||
The value can be set on the command line. */
|
||||
#ifndef LIBGCC2_UNITS_PER_WORD
|
||||
#define LIBGCC2_UNITS_PER_WORD LIBGCC2_MAX_UNITS_PER_WORD
|
||||
#endif
|
||||
|
||||
typedef int QItype __attribute__ ((mode (QI)));
|
||||
typedef unsigned int UQItype __attribute__ ((mode (QI)));
|
||||
typedef int HItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int UHItype __attribute__ ((mode (HI)));
|
||||
#if MIN_UNITS_PER_WORD > 1
|
||||
/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
#if __SIZEOF_LONG_LONG__ > 4
|
||||
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */
|
||||
typedef int DItype __attribute__ ((mode (DI)));
|
||||
typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
#if MIN_UNITS_PER_WORD > 4
|
||||
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */
|
||||
typedef int TItype __attribute__ ((mode (TI)));
|
||||
typedef unsigned int UTItype __attribute__ ((mode (TI)));
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LIBGCC2_UNITS_PER_WORD == 8
|
||||
#define W_TYPE_SIZE (8 * BITS_PER_UNIT)
|
||||
#define Wtype DItype
|
||||
#define UWtype UDItype
|
||||
#define HWtype DItype
|
||||
#define UHWtype UDItype
|
||||
#define DWtype TItype
|
||||
#define UDWtype UTItype
|
||||
#ifdef LIBGCC2_GNU_PREFIX
|
||||
#define __NW(a,b) __gnu_ ## a ## di ## b
|
||||
#define __NDW(a,b) __gnu_ ## a ## ti ## b
|
||||
#else
|
||||
#define __NW(a,b) __ ## a ## di ## b
|
||||
#define __NDW(a,b) __ ## a ## ti ## b
|
||||
#endif
|
||||
#elif LIBGCC2_UNITS_PER_WORD == 4
|
||||
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
|
||||
#define Wtype SItype
|
||||
#define UWtype USItype
|
||||
#define HWtype SItype
|
||||
#define UHWtype USItype
|
||||
#define DWtype DItype
|
||||
#define UDWtype UDItype
|
||||
#ifdef LIBGCC2_GNU_PREFIX
|
||||
#define __NW(a,b) __gnu_ ## a ## si ## b
|
||||
#define __NDW(a,b) __gnu_ ## a ## di ## b
|
||||
#else
|
||||
#define __NW(a,b) __ ## a ## si ## b
|
||||
#define __NDW(a,b) __ ## a ## di ## b
|
||||
#endif
|
||||
#elif LIBGCC2_UNITS_PER_WORD == 2
|
||||
#define W_TYPE_SIZE (2 * BITS_PER_UNIT)
|
||||
#define Wtype HItype
|
||||
#define UWtype UHItype
|
||||
#define HWtype HItype
|
||||
#define UHWtype UHItype
|
||||
#define DWtype SItype
|
||||
#define UDWtype USItype
|
||||
#ifdef LIBGCC2_GNU_PREFIX
|
||||
#define __NW(a,b) __gnu_ ## a ## hi ## b
|
||||
#define __NDW(a,b) __gnu_ ## a ## si ## b
|
||||
#else
|
||||
#define __NW(a,b) __ ## a ## hi ## b
|
||||
#define __NDW(a,b) __ ## a ## si ## b
|
||||
#endif
|
||||
#else
|
||||
#define W_TYPE_SIZE BITS_PER_UNIT
|
||||
#define Wtype QItype
|
||||
#define UWtype UQItype
|
||||
#define HWtype QItype
|
||||
#define UHWtype UQItype
|
||||
#define DWtype HItype
|
||||
#define UDWtype UHItype
|
||||
#ifdef LIBGCC2_GNU_PREFIX
|
||||
#define __NW(a,b) __gnu_ ## a ## qi ## b
|
||||
#define __NDW(a,b) __gnu_ ## a ## hi ## b
|
||||
#else
|
||||
#define __NW(a,b) __ ## a ## qi ## b
|
||||
#define __NDW(a,b) __ ## a ## hi ## b
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
|
||||
|
||||
#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
|
||||
struct DWstruct {Wtype high, low;};
|
||||
#else
|
||||
struct DWstruct {Wtype low, high;};
|
||||
#endif
|
||||
|
||||
/* We need this union to unpack/pack DImode values, since we don't have
|
||||
any arithmetic yet. Incoming DImode parameters are stored into the
|
||||
`ll' field, and the unpacked result is read from the struct `s'. */
|
||||
|
||||
typedef union {
|
||||
struct DWstruct s;
|
||||
DWtype ll;
|
||||
} DWunion;
|
||||
|
||||
#endif /* __ASM_LIBGCC_H */
|
|
@ -29,6 +29,7 @@ memcmp:
|
|||
ld.a %r4, [%r0, 8]
|
||||
ld.a %r5, [%r1, 8]
|
||||
brne WORD2, %r12, .Lodd
|
||||
nop
|
||||
.Loop_end:
|
||||
asl_s SHIFT, SHIFT, 3
|
||||
bhs_s .Last_cmp
|
||||
|
@ -105,6 +106,7 @@ memcmp:
|
|||
ldb.a %r4, [%r0, 2]
|
||||
ldb.a %r5, [%r1, 2]
|
||||
brne %r3, %r12, .Lbyte_odd
|
||||
nop
|
||||
.Lbyte_end:
|
||||
bcc .Lbyte_even
|
||||
brne %r4, %r5, .Lbyte_even
|
||||
|
|
213
arch/arm/Kconfig
213
arch/arm/Kconfig
|
@ -51,6 +51,13 @@ config SYS_CPU
|
|||
default "sa1100" if CPU_SA1100
|
||||
default "armv8" if ARM64
|
||||
|
||||
config SEMIHOSTING
|
||||
bool "support boot from semihosting"
|
||||
help
|
||||
In emulated environments, semihosting is a way for
|
||||
the hosted environment to call out to the emulator to
|
||||
retrieve files from the host machine.
|
||||
|
||||
choice
|
||||
prompt "Target select"
|
||||
|
||||
|
@ -70,17 +77,8 @@ config TARGET_A320EVB
|
|||
bool "Support a320evb"
|
||||
select CPU_ARM920T
|
||||
|
||||
config TARGET_AT91RM9200EK
|
||||
bool "Support at91rm9200ek"
|
||||
select CPU_ARM920T
|
||||
|
||||
config TARGET_EB_CPUX9K2
|
||||
bool "Support eb_cpux9k2"
|
||||
select CPU_ARM920T
|
||||
|
||||
config TARGET_CPUAT91
|
||||
bool "Support cpuat91"
|
||||
select CPU_ARM920T
|
||||
config ARCH_AT91
|
||||
bool "Atmel AT91"
|
||||
|
||||
config TARGET_EDB93XX
|
||||
bool "Support edb93xx"
|
||||
|
@ -122,100 +120,6 @@ config TARGET_GPLUGD
|
|||
bool "Support gplugd"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AFEB9260
|
||||
bool "Support afeb9260"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9260EK
|
||||
bool "Support at91sam9260ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9261EK
|
||||
bool "Support at91sam9261ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9263EK
|
||||
bool "Support at91sam9263ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9M10G45EK
|
||||
bool "Support at91sam9m10g45ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9N12EK
|
||||
bool "Support at91sam9n12ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9RLEK
|
||||
bool "Support at91sam9rlek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_AT91SAM9X5EK
|
||||
bool "Support at91sam9x5ek"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_SNAPPER9260
|
||||
bool "Support snapper9260"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_VL_MA2SC
|
||||
bool "Support vl_ma2sc"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_SBC35_A9G20
|
||||
bool "Support sbc35_a9g20"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_TNY_A9260
|
||||
bool "Support tny_a9260"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_USB_A9263
|
||||
bool "Support usb_a9263"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_ETHERNUT5
|
||||
bool "Support ethernut5"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_MEESC
|
||||
bool "Support meesc"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_OTC570
|
||||
bool "Support otc570"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_CPU9260
|
||||
bool "Support cpu9260"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_PM9261
|
||||
bool "Support pm9261"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_PM9263
|
||||
bool "Support pm9263"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_PM9G45
|
||||
bool "Support pm9g45"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_CORVUS
|
||||
select SUPPORT_SPL
|
||||
bool "Support corvus"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_TAURUS
|
||||
select SUPPORT_SPL
|
||||
bool "Support taurus"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config TARGET_STAMP9G20
|
||||
bool "Support stamp9g20"
|
||||
select CPU_ARM926EJS
|
||||
|
||||
config ARCH_DAVINCI
|
||||
bool "TI DaVinci"
|
||||
select CPU_ARM926EJS
|
||||
|
@ -229,10 +133,12 @@ config KIRKWOOD
|
|||
config TARGET_DB_MV784MP_GP
|
||||
bool "Support db-mv784mp-gp"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_MAXBCM
|
||||
bool "Support maxbcm"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_DEVKIT3250
|
||||
bool "Support devkit3250"
|
||||
|
@ -404,6 +310,10 @@ config TARGET_RPI
|
|||
bool "Support rpi"
|
||||
select CPU_ARM1176
|
||||
|
||||
config TARGET_RPI_2
|
||||
bool "Support rpi_2"
|
||||
select CPU_V7
|
||||
|
||||
config TARGET_TNETV107X_EVM
|
||||
bool "Support tnetv107x_evm"
|
||||
select CPU_ARM1176
|
||||
|
@ -505,24 +415,6 @@ config TARGET_TI816X_EVM
|
|||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_SAMA5D3_XPLAINED
|
||||
bool "Support sama5d3_xplained"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_SAMA5D3XEK
|
||||
bool "Support sama5d3xek"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_SAMA5D4_XPLAINED
|
||||
bool "Support sama5d4_xplained"
|
||||
select CPU_V7
|
||||
|
||||
config TARGET_SAMA5D4EK
|
||||
bool "Support sama5d4ek"
|
||||
select CPU_V7
|
||||
|
||||
config TARGET_BCM28155_AP
|
||||
bool "Support bcm28155_ap"
|
||||
select CPU_V7
|
||||
|
@ -637,6 +529,7 @@ config TARGET_MX6SLEVK
|
|||
config TARGET_MX6SXSABRESD
|
||||
bool "Support mx6sxsabresd"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_GW_VENTANA
|
||||
bool "Support gw_ventana"
|
||||
|
@ -663,6 +556,17 @@ config TARGET_TQMA6
|
|||
config TARGET_OT1200
|
||||
bool "Bachmann OT1200"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_PLATINUM_PICON
|
||||
bool "Support platinum-picon"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config TARGET_PLATINUM_TITANIUM
|
||||
bool "Support platinum-titanium"
|
||||
select CPU_V7
|
||||
select SUPPORT_SPL
|
||||
|
||||
config OMAP34XX
|
||||
bool "OMAP34XX SoC"
|
||||
|
@ -720,10 +624,19 @@ config TEGRA
|
|||
select CPU_ARM720T if SPL_BUILD
|
||||
select CPU_V7 if !SPL_BUILD
|
||||
|
||||
config TARGET_VEXPRESS_AEMV8A
|
||||
config TARGET_VEXPRESS64_AEMV8A
|
||||
bool "Support vexpress_aemv8a"
|
||||
select ARM64
|
||||
|
||||
config TARGET_VEXPRESS64_BASE_FVP
|
||||
bool "Support Versatile Express ARMv8a FVP BASE model"
|
||||
select ARM64
|
||||
select SEMIHOSTING
|
||||
|
||||
config TARGET_VEXPRESS64_JUNO
|
||||
bool "Support Versatile Express Juno Development Platform"
|
||||
select ARM64
|
||||
|
||||
config TARGET_LS2085A_EMU
|
||||
bool "Support ls2085a_emu"
|
||||
select ARM64
|
||||
|
@ -805,17 +718,21 @@ config ARCH_UNIPHIER
|
|||
|
||||
endchoice
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/davinci/Kconfig"
|
||||
source "arch/arm/mach-at91/Kconfig"
|
||||
|
||||
source "arch/arm/mach-davinci/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm1176/bcm2835/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/exynos/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/highbank/Kconfig"
|
||||
source "arch/arm/mach-highbank/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/keystone/Kconfig"
|
||||
source "arch/arm/mach-keystone/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/kirkwood/Kconfig"
|
||||
source "arch/arm/mach-kirkwood/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/nomadik/Kconfig"
|
||||
source "arch/arm/mach-nomadik/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/omap3/Kconfig"
|
||||
|
||||
|
@ -823,17 +740,17 @@ source "arch/arm/cpu/armv7/omap4/Kconfig"
|
|||
|
||||
source "arch/arm/cpu/armv7/omap5/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/orion5x/Kconfig"
|
||||
source "arch/arm/mach-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/mach-tegra/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/uniphier/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/arm926ejs/versatile/Kconfig"
|
||||
source "arch/arm/mach-versatile/Kconfig"
|
||||
|
||||
source "arch/arm/cpu/armv7/zynq/Kconfig"
|
||||
|
||||
|
@ -842,43 +759,25 @@ source "arch/arm/cpu/armv7/Kconfig"
|
|||
source "board/aristainetos/Kconfig"
|
||||
source "board/BuR/kwb/Kconfig"
|
||||
source "board/BuR/tseries/Kconfig"
|
||||
source "board/BuS/eb_cpux9k2/Kconfig"
|
||||
source "board/BuS/vl_ma2sc/Kconfig"
|
||||
source "board/CarMediaLab/flea3/Kconfig"
|
||||
source "board/Marvell/aspenite/Kconfig"
|
||||
source "board/Marvell/db-mv784mp-gp/Kconfig"
|
||||
source "board/Marvell/dkb/Kconfig"
|
||||
source "board/Marvell/gplugd/Kconfig"
|
||||
source "board/afeb9260/Kconfig"
|
||||
source "board/altera/socfpga/Kconfig"
|
||||
source "board/armadeus/apf27/Kconfig"
|
||||
source "board/armltd/integrator/Kconfig"
|
||||
source "board/armltd/vexpress/Kconfig"
|
||||
source "board/armltd/vexpress64/Kconfig"
|
||||
source "board/atmel/at91rm9200ek/Kconfig"
|
||||
source "board/atmel/at91sam9260ek/Kconfig"
|
||||
source "board/atmel/at91sam9261ek/Kconfig"
|
||||
source "board/atmel/at91sam9263ek/Kconfig"
|
||||
source "board/atmel/at91sam9m10g45ek/Kconfig"
|
||||
source "board/atmel/at91sam9n12ek/Kconfig"
|
||||
source "board/atmel/at91sam9rlek/Kconfig"
|
||||
source "board/atmel/at91sam9x5ek/Kconfig"
|
||||
source "board/atmel/sama5d3_xplained/Kconfig"
|
||||
source "board/atmel/sama5d3xek/Kconfig"
|
||||
source "board/atmel/sama5d4_xplained/Kconfig"
|
||||
source "board/atmel/sama5d4ek/Kconfig"
|
||||
source "board/bachmann/ot1200/Kconfig"
|
||||
source "board/balloon3/Kconfig"
|
||||
source "board/barco/platinum/Kconfig"
|
||||
source "board/barco/titanium/Kconfig"
|
||||
source "board/bluegiga/apx4devkit/Kconfig"
|
||||
source "board/bluewater/snapper9260/Kconfig"
|
||||
source "board/boundary/nitrogen6x/Kconfig"
|
||||
source "board/broadcom/bcm28155_ap/Kconfig"
|
||||
source "board/broadcom/bcmcygnus/Kconfig"
|
||||
source "board/broadcom/bcmnsp/Kconfig"
|
||||
source "board/calao/sbc35_a9g20/Kconfig"
|
||||
source "board/calao/tny_a9260/Kconfig"
|
||||
source "board/calao/usb_a9263/Kconfig"
|
||||
source "board/cirrus/edb93xx/Kconfig"
|
||||
source "board/cm4008/Kconfig"
|
||||
source "board/cm41xx/Kconfig"
|
||||
|
@ -889,13 +788,8 @@ source "board/creative/xfi3/Kconfig"
|
|||
source "board/davedenx/qong/Kconfig"
|
||||
source "board/denx/m28evk/Kconfig"
|
||||
source "board/denx/m53evk/Kconfig"
|
||||
source "board/egnite/ethernut5/Kconfig"
|
||||
source "board/embest/mx6boards/Kconfig"
|
||||
source "board/esd/meesc/Kconfig"
|
||||
source "board/esd/otc570/Kconfig"
|
||||
source "board/esg/ima3-mx53/Kconfig"
|
||||
source "board/eukrea/cpu9260/Kconfig"
|
||||
source "board/eukrea/cpuat91/Kconfig"
|
||||
source "board/faraday/a320evb/Kconfig"
|
||||
source "board/freescale/ls2085a/Kconfig"
|
||||
source "board/freescale/ls1021aqds/Kconfig"
|
||||
|
@ -940,18 +834,14 @@ source "board/phytec/pcm051/Kconfig"
|
|||
source "board/ppcag/bg0900/Kconfig"
|
||||
source "board/pxa255_idp/Kconfig"
|
||||
source "board/raspberrypi/rpi/Kconfig"
|
||||
source "board/ronetix/pm9261/Kconfig"
|
||||
source "board/ronetix/pm9263/Kconfig"
|
||||
source "board/ronetix/pm9g45/Kconfig"
|
||||
source "board/raspberrypi/rpi_2/Kconfig"
|
||||
source "board/samsung/smdk2410/Kconfig"
|
||||
source "board/sandisk/sansa_fuze_plus/Kconfig"
|
||||
source "board/scb9328/Kconfig"
|
||||
source "board/schulercontrol/sc_sps_1/Kconfig"
|
||||
source "board/siemens/corvus/Kconfig"
|
||||
source "board/siemens/draco/Kconfig"
|
||||
source "board/siemens/pxm2/Kconfig"
|
||||
source "board/siemens/rut/Kconfig"
|
||||
source "board/siemens/taurus/Kconfig"
|
||||
source "board/silica/pengwyn/Kconfig"
|
||||
source "board/solidrun/hummingboard/Kconfig"
|
||||
source "board/spear/spear300/Kconfig"
|
||||
|
@ -965,7 +855,6 @@ source "board/st/stv0991/Kconfig"
|
|||
source "board/sunxi/Kconfig"
|
||||
source "board/syteco/jadecpu/Kconfig"
|
||||
source "board/syteco/zmx25/Kconfig"
|
||||
source "board/taskit/stamp9g20/Kconfig"
|
||||
source "board/tbs/tbs2910/Kconfig"
|
||||
source "board/ti/am335x/Kconfig"
|
||||
source "board/ti/am43xx/Kconfig"
|
||||
|
|
|
@ -2,6 +2,27 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
# Machine directory name. This list is sorted alphanumerically
|
||||
# by CONFIG_* macro name.
|
||||
machine-$(CONFIG_ARCH_AT91) += at91
|
||||
machine-$(CONFIG_ARCH_DAVINCI) += davinci
|
||||
machine-$(CONFIG_ARCH_HIGHBANK) += highbank
|
||||
machine-$(CONFIG_ARCH_KEYSTONE) += keystone
|
||||
# TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
|
||||
machine-$(CONFIG_KIRKWOOD) += kirkwood
|
||||
# TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
|
||||
machine-$(CONFIG_ARCH_NOMADIK) += nomadik
|
||||
# TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
|
||||
machine-$(CONFIG_ORION5X) += orion5x
|
||||
machine-$(CONFIG_TEGRA) += tegra
|
||||
machine-$(CONFIG_ARCH_VERSATILE) += versatile
|
||||
|
||||
machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
|
||||
|
||||
PLATFORM_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
|
||||
|
||||
libs-y += $(machdirs)
|
||||
|
||||
head-y := arch/arm/cpu/$(CPU)/start.o
|
||||
|
||||
ifeq ($(CONFIG_SPL_BUILD),y)
|
||||
|
@ -27,3 +48,6 @@ endif
|
|||
ifneq (,$(filter $(SOC), armada-xp kirkwood))
|
||||
libs-y += arch/arm/mvebu-common/
|
||||
endif
|
||||
|
||||
# deprecated
|
||||
-include $(machdirs)/config.mk
|
||||
|
|
|
@ -1,6 +1 @@
|
|||
obj-$(CONFIG_AT91FAMILY) += at91-common/
|
||||
obj-$(CONFIG_TEGRA20) += tegra20-common/
|
||||
obj-$(CONFIG_TEGRA30) += tegra30-common/
|
||||
obj-$(CONFIG_TEGRA114) += tegra114-common/
|
||||
obj-$(CONFIG_TEGRA124) += tegra124-common/
|
||||
obj-$(CONFIG_TEGRA) += tegra-common/
|
||||
obj- += dummy.o
|
||||
|
|
12
arch/arm/cpu/arm1176/bcm2835/Kconfig
Normal file
12
arch/arm/cpu/arm1176/bcm2835/Kconfig
Normal file
|
@ -0,0 +1,12 @@
|
|||
if TARGET_RPI || TARGET_RPI_2
|
||||
|
||||
config DM
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_SERIAL
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_GPIO
|
||||
default y if !SPL_BUILD
|
||||
|
||||
endif
|
|
@ -1,15 +1,7 @@
|
|||
#
|
||||
# See file CREDITS for list of people who contributed to this
|
||||
# project.
|
||||
# (C) Copyright 2012 Stephen Warren
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
#
|
||||
|
||||
obj-y := lowlevel_init.o
|
||||
|
|
|
@ -7,9 +7,3 @@
|
|||
|
||||
extra-y = start.o
|
||||
obj-y = interrupts.o cpu.o
|
||||
|
||||
obj-$(CONFIG_TEGRA) += tegra-common/
|
||||
obj-$(CONFIG_TEGRA20) += tegra20/
|
||||
obj-$(CONFIG_TEGRA30) += tegra30/
|
||||
obj-$(CONFIG_TEGRA114) += tegra114/
|
||||
obj-$(CONFIG_TEGRA124) += tegra124/
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2010,2011 Nvidia Corporation.
|
||||
#
|
||||
# (C) Copyright 2000-2008
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
obj-y += cpu.o
|
|
@ -1,21 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# (C) Copyright 2000-2008
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms and conditions of the GNU General Public License,
|
||||
# version 2, as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#obj-y += cpu.o t11x.o
|
||||
obj-y += cpu.o
|
|
@ -1,8 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2013-2014
|
||||
# NVIDIA Corporation <www.nvidia.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += cpu.o
|
|
@ -1,10 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2010,2011 Nvidia Corporation.
|
||||
#
|
||||
# (C) Copyright 2000-2008
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += cpu.o
|
|
@ -1,20 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# (C) Copyright 2000-2008
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms and conditions of the GNU General Public License,
|
||||
# version 2, as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
obj-y += cpu.o
|
|
@ -11,7 +11,6 @@ obj-y += cpu.o
|
|||
obj-$(CONFIG_USE_IRQ) += interrupts.o
|
||||
|
||||
obj-$(if $(filter a320,$(SOC)),y) += a320/
|
||||
obj-$(CONFIG_AT91FAMILY) += at91/
|
||||
obj-$(CONFIG_EP93XX) += ep93xx/
|
||||
obj-$(CONFIG_IMX) += imx/
|
||||
obj-$(CONFIG_KS8695) += ks8695/
|
||||
|
|
|
@ -15,16 +15,10 @@ endif
|
|||
endif
|
||||
|
||||
obj-$(CONFIG_ARMADA100) += armada100/
|
||||
obj-$(CONFIG_AT91FAMILY) += at91/
|
||||
obj-$(CONFIG_ARCH_DAVINCI) += davinci/
|
||||
obj-$(CONFIG_KIRKWOOD) += kirkwood/
|
||||
obj-$(if $(filter lpc32xx,$(SOC)),y) += lpc32xx/
|
||||
obj-$(CONFIG_MB86R0x) += mb86r0x/
|
||||
obj-$(CONFIG_MX25) += mx25/
|
||||
obj-$(CONFIG_MX27) += mx27/
|
||||
obj-$(if $(filter mxs,$(SOC)),y) += mxs/
|
||||
obj-$(CONFIG_ARCH_NOMADIK) += nomadik/
|
||||
obj-$(CONFIG_ORION5X) += orion5x/
|
||||
obj-$(CONFIG_PANTHEON) += pantheon/
|
||||
obj-$(if $(filter spear,$(SOC)),y) += spear/
|
||||
obj-$(CONFIG_ARCH_VERSATILE) += versatile/
|
||||
|
|
|
@ -1,189 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2007-2008
|
||||
* Stelian Pop <stelian@popies.net>
|
||||
* Lead Tech Design <www.leadtechdesign.com>
|
||||
*
|
||||
* (C) Copyright 2009
|
||||
* Daniel Gorsulowski <daniel.gorsulowski@esd.eu>
|
||||
* esd electronic system design gmbh <www.esd.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/at91_common.h>
|
||||
#include <asm/arch/at91_pmc.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
#include <asm/arch/io.h>
|
||||
|
||||
void at91_serial0_hw_init(void)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTA, 22, 1); /* TXD0 */
|
||||
at91_set_a_periph(AT91_PIO_PORTA, 23, 0); /* RXD0 */
|
||||
writel(1 << AT91CAP9_ID_US0, &pmc->pcer);
|
||||
}
|
||||
|
||||
void at91_serial1_hw_init(void)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTD, 0, 1); /* TXD1 */
|
||||
at91_set_a_periph(AT91_PIO_PORTD, 1, 0); /* RXD1 */
|
||||
writel(1 << AT91CAP9_ID_US1, &pmc->pcer);
|
||||
}
|
||||
|
||||
void at91_serial2_hw_init(void)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTD, 2, 1); /* TXD2 */
|
||||
at91_set_a_periph(AT91_PIO_PORTD, 3, 0); /* RXD2 */
|
||||
writel(1 << AT91CAP9_ID_US2, &pmc->pcer);
|
||||
}
|
||||
|
||||
void at91_serial3_hw_init(void)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 30, 0); /* DRXD */
|
||||
at91_set_a_periph(AT91_PIO_PORTC, 31, 1); /* DTXD */
|
||||
writel(1 << AT91_ID_SYS, &pmc->pcer);
|
||||
}
|
||||
|
||||
void at91_serial_hw_init(void)
|
||||
{
|
||||
#ifdef CONFIG_USART0
|
||||
at91_serial0_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USART1
|
||||
at91_serial1_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USART2
|
||||
at91_serial2_hw_init();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USART3 /* DBGU */
|
||||
at91_serial3_hw_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HAS_DATAFLASH
|
||||
void at91_spi0_hw_init(unsigned long cs_mask)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_b_periph(AT91_PIO_PORTA, 0, 0); /* SPI0_MISO */
|
||||
at91_set_b_periph(AT91_PIO_PORTA, 1, 0); /* SPI0_MOSI */
|
||||
at91_set_b_periph(AT91_PIO_PORTA, 2, 0); /* SPI0_SPCK */
|
||||
|
||||
/* Enable clock */
|
||||
writel(1 << AT91CAP9_ID_SPI0, &pmc->pcer);
|
||||
|
||||
if (cs_mask & (1 << 0)) {
|
||||
at91_set_b_periph(AT91_PIO_PORTA, 5, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 1)) {
|
||||
at91_set_b_periph(AT91_PIO_PORTA, 3, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 2)) {
|
||||
at91_set_b_periph(AT91_PIO_PORTD, 0, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 3)) {
|
||||
at91_set_b_periph(AT91_PIO_PORTD, 1, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 4)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTA, 5, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 5)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTA, 3, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 6)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTD, 0, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 7)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTD, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void at91_spi1_hw_init(unsigned long cs_mask)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 12, 0); /* SPI1_MISO */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 13, 0); /* SPI1_MOSI */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 14, 0); /* SPI1_SPCK */
|
||||
|
||||
/* Enable clock */
|
||||
writel(1 << AT91CAP9_ID_SPI1, &pmc->pcer);
|
||||
|
||||
if (cs_mask & (1 << 0)) {
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 15, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 1)) {
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 16, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 2)) {
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 17, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 3)) {
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 18, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 4)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTB, 15, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 5)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTB, 16, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 6)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTB, 17, 1);
|
||||
}
|
||||
if (cs_mask & (1 << 7)) {
|
||||
at91_set_pio_output(AT91_PIO_PORTB, 18, 1);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MACB
|
||||
void at91_macb_hw_init(void)
|
||||
{
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 21, 0); /* ETXCK_EREFCK */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 22, 0); /* ERXDV */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 25, 0); /* ERX0 */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 26, 0); /* ERX1 */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 27, 0); /* ERXER */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 28, 0); /* ETXEN */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 23, 0); /* ETX0 */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 24, 0); /* ETX1 */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 30, 0); /* EMDIO */
|
||||
at91_set_a_periph(AT91_PIO_PORTB, 29, 0); /* EMDC */
|
||||
|
||||
#ifndef CONFIG_RMII
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 25, 0); /* ECRS */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 26, 0); /* ECOL */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 22, 0); /* ERX2 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 23, 0); /* ERX3 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 27, 0); /* ERXCK */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 20, 0); /* ETX2 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 21, 0); /* ETX3 */
|
||||
at91_set_b_periph(AT91_PIO_PORTC, 24, 0); /* ETXER */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AT91_CAN
|
||||
void at91_can_hw_init(void)
|
||||
{
|
||||
at91_pmc_t *pmc = (at91_pmc_t *) AT91_PMC_BASE;
|
||||
|
||||
at91_set_a_periph(AT91_PIO_PORTA, 12, 0); /* CAN_TX */
|
||||
at91_set_a_periph(AT91_PIO_PORTA, 13, 1); /* CAN_RX */
|
||||
|
||||
/* Enable clock */
|
||||
writel(1 << AT91CAP9_ID_CAN, &pmc->pcer);
|
||||
}
|
||||
#endif
|
|
@ -1,2 +0,0 @@
|
|||
PF_CPPFLAGS_TUNE := $(call cc-option,-mtune=arm926ejs,)
|
||||
PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_TUNE)
|
|
@ -147,6 +147,7 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
|||
mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
|
||||
|
||||
mxs_spl_console_init();
|
||||
debug("SPL: Serial Console Initialised\n");
|
||||
|
||||
mxs_power_init();
|
||||
|
||||
|
@ -156,6 +157,11 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
|||
data->boot_mode_idx = bootmode;
|
||||
|
||||
mxs_power_wait_pswitch();
|
||||
|
||||
if (mxs_boot_modes[data->boot_mode_idx].boot_pads == MXS_BM_JTAG) {
|
||||
debug("SPL: Waiting for JTAG user\n");
|
||||
asm volatile ("x: b x");
|
||||
}
|
||||
}
|
||||
|
||||
/* Support aparatus */
|
||||
|
|
|
@ -18,6 +18,8 @@ void mxs_lradc_init(void)
|
|||
{
|
||||
struct mxs_lradc_regs *regs = (struct mxs_lradc_regs *)MXS_LRADC_BASE;
|
||||
|
||||
debug("SPL: Initialisating LRADC\n");
|
||||
|
||||
writel(LRADC_CTRL0_SFTRST, ®s->hw_lradc_ctrl0_clr);
|
||||
writel(LRADC_CTRL0_CLKGATE, ®s->hw_lradc_ctrl0_clr);
|
||||
writel(LRADC_CTRL0_ONCHIP_GROUNDREF, ®s->hw_lradc_ctrl0_clr);
|
||||
|
@ -37,9 +39,15 @@ void mxs_lradc_enable_batt_measurement(void)
|
|||
{
|
||||
struct mxs_lradc_regs *regs = (struct mxs_lradc_regs *)MXS_LRADC_BASE;
|
||||
|
||||
debug("SPL: Enabling LRADC battery measurement\n");
|
||||
|
||||
/* Check if the channel is present at all. */
|
||||
if (!(readl(®s->hw_lradc_status) & LRADC_STATUS_CHANNEL7_PRESENT))
|
||||
if (!(readl(®s->hw_lradc_status) & LRADC_STATUS_CHANNEL7_PRESENT)) {
|
||||
debug("SPL: LRADC channel 7 is not present - aborting\n");
|
||||
return;
|
||||
}
|
||||
|
||||
debug("SPL: LRADC channel 7 is present - configuring\n");
|
||||
|
||||
writel(LRADC_CTRL1_LRADC7_IRQ_EN, ®s->hw_lradc_ctrl1_clr);
|
||||
writel(LRADC_CTRL1_LRADC7_IRQ, ®s->hw_lradc_ctrl1_clr);
|
||||
|
@ -65,6 +73,7 @@ void mxs_lradc_enable_batt_measurement(void)
|
|||
100, ®s->hw_lradc_delay3);
|
||||
|
||||
writel(0xffffffff, ®s->hw_lradc_ch7_clr);
|
||||
|
||||
writel(LRADC_DELAY_KICK, ®s->hw_lradc_delay3_set);
|
||||
|
||||
debug("SPL: LRADC channel 7 configuration complete\n");
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ static uint32_t dram_vals[] = {
|
|||
|
||||
__weak void mxs_adjust_memory_params(uint32_t *dram_vals)
|
||||
{
|
||||
debug("SPL: Using default SDRAM parameters\n");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MX28
|
||||
|
@ -99,8 +100,10 @@ static void initialize_dram_values(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
debug("SPL: Setting mx28 board specific SDRAM parameters\n");
|
||||
mxs_adjust_memory_params(dram_vals);
|
||||
|
||||
debug("SPL: Applying SDRAM parameters\n");
|
||||
for (i = 0; i < ARRAY_SIZE(dram_vals); i++)
|
||||
writel(dram_vals[i], MXS_DRAM_BASE + (4 * i));
|
||||
}
|
||||
|
@ -109,6 +112,7 @@ static void initialize_dram_values(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
debug("SPL: Setting mx23 board specific SDRAM parameters\n");
|
||||
mxs_adjust_memory_params(dram_vals);
|
||||
|
||||
/*
|
||||
|
@ -120,6 +124,7 @@ static void initialize_dram_values(void)
|
|||
* HW_DRAM_CTL8 is setup as the last element.
|
||||
* So skip the initialization of these HW_DRAM_CTL registers.
|
||||
*/
|
||||
debug("SPL: Applying SDRAM parameters\n");
|
||||
for (i = 0; i < ARRAY_SIZE(dram_vals); i++) {
|
||||
if (i == 8 || i == 27 || i == 28 || i == 35)
|
||||
continue;
|
||||
|
@ -146,6 +151,8 @@ static void mxs_mem_init_clock(void)
|
|||
const unsigned char divider = 21;
|
||||
#endif
|
||||
|
||||
debug("SPL: Initialising FRAC0\n");
|
||||
|
||||
/* Gate EMI clock */
|
||||
writeb(CLKCTRL_FRAC_CLKGATE,
|
||||
&clkctrl_regs->hw_clkctrl_frac0_set[CLKCTRL_FRAC0_EMI]);
|
||||
|
@ -170,6 +177,7 @@ static void mxs_mem_init_clock(void)
|
|||
&clkctrl_regs->hw_clkctrl_clkseq_clr);
|
||||
|
||||
early_delay(10000);
|
||||
debug("SPL: FRAC0 Initialised\n");
|
||||
}
|
||||
|
||||
static void mxs_mem_setup_cpu_and_hbus(void)
|
||||
|
@ -177,6 +185,8 @@ static void mxs_mem_setup_cpu_and_hbus(void)
|
|||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
|
||||
debug("SPL: Setting CPU and HBUS clock frequencies\n");
|
||||
|
||||
/* Set fractional divider for ref_cpu to 480 * 18 / 19 = 454MHz
|
||||
* and ungate CPU clock */
|
||||
writeb(19 & CLKCTRL_FRAC_FRAC_MASK,
|
||||
|
@ -209,6 +219,8 @@ static void mxs_mem_setup_vdda(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Configuring VDDA\n");
|
||||
|
||||
writel((0xc << POWER_VDDACTRL_TRG_OFFSET) |
|
||||
(0x7 << POWER_VDDACTRL_BO_OFFSET_OFFSET) |
|
||||
POWER_VDDACTRL_LINREG_OFFSET_1STEPS_BELOW,
|
||||
|
@ -240,6 +252,8 @@ static void mx23_mem_setup_vddmem(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Setting mx23 VDDMEM\n");
|
||||
|
||||
/* We must wait before and after disabling the current limiter! */
|
||||
early_delay(10000);
|
||||
|
||||
|
@ -252,6 +266,8 @@ static void mx23_mem_setup_vddmem(void)
|
|||
|
||||
static void mx23_mem_init(void)
|
||||
{
|
||||
debug("SPL: Initialising mx23 SDRAM Controller\n");
|
||||
|
||||
/*
|
||||
* Reset/ungate the EMI block. This is essential, otherwise the system
|
||||
* suffers from memory instability. This thing is mx23 specific and is
|
||||
|
@ -297,6 +313,8 @@ static void mx28_mem_init(void)
|
|||
struct mxs_pinctrl_regs *pinctrl_regs =
|
||||
(struct mxs_pinctrl_regs *)MXS_PINCTRL_BASE;
|
||||
|
||||
debug("SPL: Initialising mx28 SDRAM Controller\n");
|
||||
|
||||
/* Set DDR2 mode */
|
||||
writel(PINCTRL_EMI_DS_CTRL_DDR_MODE_DDR2,
|
||||
&pinctrl_regs->hw_pinctrl_emi_ds_ctrl_set);
|
||||
|
|
|
@ -14,6 +14,13 @@
|
|||
|
||||
#include "mxs_init.h"
|
||||
|
||||
#ifdef CONFIG_SYS_MXS_VDD5V_ONLY
|
||||
#define DCDC4P2_DROPOUT_CONFIG POWER_DCDC4P2_DROPOUT_CTRL_100MV | \
|
||||
POWER_DCDC4P2_DROPOUT_CTRL_SRC_4P2
|
||||
#else
|
||||
#define DCDC4P2_DROPOUT_CONFIG POWER_DCDC4P2_DROPOUT_CTRL_100MV | \
|
||||
POWER_DCDC4P2_DROPOUT_CTRL_SRC_SEL
|
||||
#endif
|
||||
/**
|
||||
* mxs_power_clock2xtal() - Switch CPU core clock source to 24MHz XTAL
|
||||
*
|
||||
|
@ -26,6 +33,8 @@ static void mxs_power_clock2xtal(void)
|
|||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
|
||||
debug("SPL: Switching CPU clock to 24MHz XTAL\n");
|
||||
|
||||
/* Set XTAL as CPU reference clock */
|
||||
writel(CLKCTRL_CLKSEQ_BYPASS_CPU,
|
||||
&clkctrl_regs->hw_clkctrl_clkseq_set);
|
||||
|
@ -43,9 +52,23 @@ static void mxs_power_clock2pll(void)
|
|||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
|
||||
debug("SPL: Switching CPU core clock source to PLL\n");
|
||||
|
||||
/*
|
||||
* TODO: Are we really? It looks like we turn on PLL0, but we then
|
||||
* set the CLKCTRL_CLKSEQ_BYPASS_CPU bit of the (which was already
|
||||
* set by mxs_power_clock2xtal()). Clearing this bit here seems to
|
||||
* introduce some instability (causing the CPU core to hang). Maybe
|
||||
* we aren't giving PLL0 enough time to stabilise?
|
||||
*/
|
||||
setbits_le32(&clkctrl_regs->hw_clkctrl_pll0ctrl0,
|
||||
CLKCTRL_PLL0CTRL0_POWER);
|
||||
early_delay(100);
|
||||
|
||||
/*
|
||||
* TODO: Should the PLL0 FORCE_LOCK bit be set here followed be a
|
||||
* wait on the PLL0 LOCK bit?
|
||||
*/
|
||||
setbits_le32(&clkctrl_regs->hw_clkctrl_clkseq,
|
||||
CLKCTRL_CLKSEQ_BYPASS_CPU);
|
||||
}
|
||||
|
@ -62,6 +85,8 @@ static void mxs_power_set_auto_restart(void)
|
|||
struct mxs_rtc_regs *rtc_regs =
|
||||
(struct mxs_rtc_regs *)MXS_RTC_BASE;
|
||||
|
||||
debug("SPL: Setting auto-restart bit\n");
|
||||
|
||||
writel(RTC_CTRL_SFTRST, &rtc_regs->hw_rtc_ctrl_clr);
|
||||
while (readl(&rtc_regs->hw_rtc_ctrl) & RTC_CTRL_SFTRST)
|
||||
;
|
||||
|
@ -101,14 +126,17 @@ static void mxs_power_set_linreg(void)
|
|||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
/* Set linear regulator 25mV below switching converter */
|
||||
debug("SPL: Setting VDDD 25mV below DC-DC converters\n");
|
||||
clrsetbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_LINREG_OFFSET_MASK,
|
||||
POWER_VDDDCTRL_LINREG_OFFSET_1STEPS_BELOW);
|
||||
|
||||
debug("SPL: Setting VDDA 25mV below DC-DC converters\n");
|
||||
clrsetbits_le32(&power_regs->hw_power_vddactrl,
|
||||
POWER_VDDACTRL_LINREG_OFFSET_MASK,
|
||||
POWER_VDDACTRL_LINREG_OFFSET_1STEPS_BELOW);
|
||||
|
||||
debug("SPL: Setting VDDIO 25mV below DC-DC converters\n");
|
||||
clrsetbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_LINREG_OFFSET_MASK,
|
||||
POWER_VDDIOCTRL_LINREG_OFFSET_1STEPS_BELOW);
|
||||
|
@ -127,6 +155,8 @@ static int mxs_get_batt_volt(void)
|
|||
volt &= POWER_BATTMONITOR_BATT_VAL_MASK;
|
||||
volt >>= POWER_BATTMONITOR_BATT_VAL_OFFSET;
|
||||
volt *= 8;
|
||||
|
||||
debug("SPL: Battery Voltage = %dmV\n", volt);
|
||||
return volt;
|
||||
}
|
||||
|
||||
|
@ -154,8 +184,10 @@ static int mxs_is_batt_good(void)
|
|||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
uint32_t volt = mxs_get_batt_volt();
|
||||
|
||||
if ((volt >= 2400) && (volt <= 4300))
|
||||
if ((volt >= 2400) && (volt <= 4300)) {
|
||||
debug("SPL: Battery is good\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_5vctrl,
|
||||
POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK,
|
||||
|
@ -175,16 +207,21 @@ static int mxs_is_batt_good(void)
|
|||
|
||||
volt = mxs_get_batt_volt();
|
||||
|
||||
if (volt >= 3500)
|
||||
if (volt >= 3500) {
|
||||
debug("SPL: Battery Voltage too high\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (volt >= 2400)
|
||||
if (volt >= 2400) {
|
||||
debug("SPL: Battery is good\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
writel(POWER_CHARGE_STOP_ILIMIT_MASK | POWER_CHARGE_BATTCHRG_I_MASK,
|
||||
&power_regs->hw_power_charge_clr);
|
||||
writel(POWER_CHARGE_PWD_BATTCHRG, &power_regs->hw_power_charge_set);
|
||||
|
||||
debug("SPL: Battery Voltage too low\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -203,6 +240,7 @@ static void mxs_power_setup_5v_detect(void)
|
|||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
/* Start 5V detection */
|
||||
debug("SPL: Starting 5V input detection comparator\n");
|
||||
clrsetbits_le32(&power_regs->hw_power_5vctrl,
|
||||
POWER_5VCTRL_VBUSVALID_TRSH_MASK,
|
||||
POWER_5VCTRL_VBUSVALID_TRSH_4V4 |
|
||||
|
@ -220,6 +258,8 @@ static void mxs_src_power_init(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Pre-Configuring power block\n");
|
||||
|
||||
/* Improve efficieny and reduce transient ripple */
|
||||
writel(POWER_LOOPCTRL_TOGGLE_DIF | POWER_LOOPCTRL_EN_CM_HYST |
|
||||
POWER_LOOPCTRL_EN_DF_HYST, &power_regs->hw_power_loopctrl_set);
|
||||
|
@ -257,6 +297,8 @@ static void mxs_power_init_4p2_params(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Configuring common 4P2 regulator params\n");
|
||||
|
||||
/* Setup 4P2 parameters */
|
||||
clrsetbits_le32(&power_regs->hw_power_dcdc4p2,
|
||||
POWER_DCDC4P2_CMPTRIP_MASK | POWER_DCDC4P2_TRG_MASK,
|
||||
|
@ -268,8 +310,7 @@ static void mxs_power_init_4p2_params(void)
|
|||
|
||||
clrsetbits_le32(&power_regs->hw_power_dcdc4p2,
|
||||
POWER_DCDC4P2_DROPOUT_CTRL_MASK,
|
||||
POWER_DCDC4P2_DROPOUT_CTRL_100MV |
|
||||
POWER_DCDC4P2_DROPOUT_CTRL_SRC_SEL);
|
||||
DCDC4P2_DROPOUT_CONFIG);
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_5vctrl,
|
||||
POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK,
|
||||
|
@ -289,6 +330,8 @@ static void mxs_enable_4p2_dcdc_input(int xfer)
|
|||
uint32_t tmp, vbus_thresh, vbus_5vdetect, pwd_bo;
|
||||
uint32_t prev_5v_brnout, prev_5v_droop;
|
||||
|
||||
debug("SPL: %s 4P2 DC-DC Input\n", xfer ? "Enabling" : "Disabling");
|
||||
|
||||
prev_5v_brnout = readl(&power_regs->hw_power_5vctrl) &
|
||||
POWER_5VCTRL_PWDN_5VBRNOUT;
|
||||
prev_5v_droop = readl(&power_regs->hw_power_ctrl) &
|
||||
|
@ -390,6 +433,8 @@ static void mxs_power_init_4p2_regulator(void)
|
|||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
uint32_t tmp, tmp2;
|
||||
|
||||
debug("SPL: Enabling 4P2 regulator\n");
|
||||
|
||||
setbits_le32(&power_regs->hw_power_dcdc4p2, POWER_DCDC4P2_ENABLE_4P2);
|
||||
|
||||
writel(POWER_CHARGE_ENABLE_LOAD, &power_regs->hw_power_charge_set);
|
||||
|
@ -407,6 +452,7 @@ static void mxs_power_init_4p2_regulator(void)
|
|||
* gradually to avoid large inrush current from the 5V cable which can
|
||||
* cause transients/problems
|
||||
*/
|
||||
debug("SPL: Charging 4P2 capacitor\n");
|
||||
mxs_enable_4p2_dcdc_input(0);
|
||||
|
||||
if (readl(&power_regs->hw_power_ctrl) & POWER_CTRL_VBUS_VALID_IRQ) {
|
||||
|
@ -420,6 +466,8 @@ static void mxs_power_init_4p2_regulator(void)
|
|||
POWER_DCDC4P2_ENABLE_DCDC);
|
||||
writel(POWER_5VCTRL_PWD_CHARGE_4P2_MASK,
|
||||
&power_regs->hw_power_5vctrl_set);
|
||||
|
||||
debug("SPL: Unable to recover from mx23 errata 5837\n");
|
||||
hang();
|
||||
}
|
||||
|
||||
|
@ -433,6 +481,7 @@ static void mxs_power_init_4p2_regulator(void)
|
|||
* current limit until the brownout status is false or until we've
|
||||
* reached our maximum defined 4p2 current limit.
|
||||
*/
|
||||
debug("SPL: Setting 4P2 brownout level\n");
|
||||
clrsetbits_le32(&power_regs->hw_power_dcdc4p2,
|
||||
POWER_DCDC4P2_BO_MASK,
|
||||
22 << POWER_DCDC4P2_BO_OFFSET); /* 4.15V */
|
||||
|
@ -479,8 +528,11 @@ static void mxs_power_init_dcdc_4p2_source(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Switching DC-DC converters to 4P2\n");
|
||||
|
||||
if (!(readl(&power_regs->hw_power_dcdc4p2) &
|
||||
POWER_DCDC4P2_ENABLE_DCDC)) {
|
||||
debug("SPL: Already switched - aborting\n");
|
||||
hang();
|
||||
}
|
||||
|
||||
|
@ -509,6 +561,8 @@ static void mxs_power_enable_4p2(void)
|
|||
uint32_t vdddctrl, vddactrl, vddioctrl;
|
||||
uint32_t tmp;
|
||||
|
||||
debug("SPL: Powering up 4P2 regulator\n");
|
||||
|
||||
vdddctrl = readl(&power_regs->hw_power_vdddctrl);
|
||||
vddactrl = readl(&power_regs->hw_power_vddactrl);
|
||||
vddioctrl = readl(&power_regs->hw_power_vddioctrl);
|
||||
|
@ -559,6 +613,8 @@ static void mxs_power_enable_4p2(void)
|
|||
if (tmp)
|
||||
writel(POWER_CHARGE_ENABLE_LOAD,
|
||||
&power_regs->hw_power_charge_clr);
|
||||
|
||||
debug("SPL: 4P2 regulator powered-up\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -574,6 +630,8 @@ static void mxs_boot_valid_5v(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Booting from 5V supply\n");
|
||||
|
||||
/*
|
||||
* Use VBUSVALID level instead of VDD5V_GT_VDDIO level to trigger a 5V
|
||||
* disconnect event. FIXME
|
||||
|
@ -601,6 +659,9 @@ static void mxs_powerdown(void)
|
|||
{
|
||||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("Powering Down\n");
|
||||
|
||||
writel(POWER_RESET_UNLOCK_KEY, &power_regs->hw_power_reset);
|
||||
writel(POWER_RESET_UNLOCK_KEY | POWER_RESET_PWD_OFF,
|
||||
&power_regs->hw_power_reset);
|
||||
|
@ -617,6 +678,8 @@ static void mxs_batt_boot(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Configuring power block to boot from battery\n");
|
||||
|
||||
clrbits_le32(&power_regs->hw_power_5vctrl, POWER_5VCTRL_PWDN_5VBRNOUT);
|
||||
clrbits_le32(&power_regs->hw_power_5vctrl, POWER_5VCTRL_ENABLE_DCDC);
|
||||
|
||||
|
@ -672,6 +735,8 @@ static void mxs_handle_5v_conflict(void)
|
|||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
uint32_t tmp;
|
||||
|
||||
debug("SPL: Resolving 5V conflict\n");
|
||||
|
||||
setbits_le32(&power_regs->hw_power_vddioctrl,
|
||||
POWER_VDDIOCTRL_BO_OFFSET_MASK);
|
||||
|
||||
|
@ -683,19 +748,27 @@ static void mxs_handle_5v_conflict(void)
|
|||
* VDDIO has a brownout, then the VDD5V_GT_VDDIO becomes
|
||||
* unreliable
|
||||
*/
|
||||
debug("SPL: VDDIO has a brownout\n");
|
||||
mxs_powerdown();
|
||||
break;
|
||||
}
|
||||
|
||||
if (tmp & POWER_STS_VDD5V_GT_VDDIO) {
|
||||
debug("SPL: POWER_STS_VDD5V_GT_VDDIO is set\n");
|
||||
mxs_boot_valid_5v();
|
||||
break;
|
||||
} else {
|
||||
debug("SPL: POWER_STS_VDD5V_GT_VDDIO is not set\n");
|
||||
mxs_powerdown();
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: I can't see this being reached. We'll either
|
||||
* powerdown or boot from a stable 5V supply.
|
||||
*/
|
||||
if (tmp & POWER_STS_PSWITCH_MASK) {
|
||||
debug("SPL: POWER_STS_PSWITCH_MASK is set\n");
|
||||
mxs_batt_boot();
|
||||
break;
|
||||
}
|
||||
|
@ -713,21 +786,26 @@ static void mxs_5v_boot(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Configuring power block to boot from 5V input\n");
|
||||
|
||||
/*
|
||||
* NOTE: In original IMX-Bootlets, this also checks for VBUSVALID,
|
||||
* but their implementation always returns 1 so we omit it here.
|
||||
*/
|
||||
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
|
||||
debug("SPL: 5V VDD good\n");
|
||||
mxs_boot_valid_5v();
|
||||
return;
|
||||
}
|
||||
|
||||
early_delay(1000);
|
||||
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
|
||||
debug("SPL: 5V VDD good (after delay)\n");
|
||||
mxs_boot_valid_5v();
|
||||
return;
|
||||
}
|
||||
|
||||
debug("SPL: 5V VDD not good\n");
|
||||
mxs_handle_5v_conflict();
|
||||
}
|
||||
|
||||
|
@ -742,6 +820,8 @@ static void mxs_init_batt_bo(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Initialising battery brown-out level to 3.0V\n");
|
||||
|
||||
/* Brownout at 3V */
|
||||
clrsetbits_le32(&power_regs->hw_power_battmonitor,
|
||||
POWER_BATTMONITOR_BRWNOUT_LVL_MASK,
|
||||
|
@ -762,6 +842,8 @@ static void mxs_switch_vddd_to_dcdc_source(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Switching VDDD to DC-DC converters\n");
|
||||
|
||||
clrsetbits_le32(&power_regs->hw_power_vdddctrl,
|
||||
POWER_VDDDCTRL_LINREG_OFFSET_MASK,
|
||||
POWER_VDDDCTRL_LINREG_OFFSET_1STEPS_BELOW);
|
||||
|
@ -788,6 +870,8 @@ static void mxs_power_configure_power_source(void)
|
|||
struct mxs_lradc_regs *lradc_regs =
|
||||
(struct mxs_lradc_regs *)MXS_LRADC_BASE;
|
||||
|
||||
debug("SPL: Configuring power source\n");
|
||||
|
||||
mxs_src_power_init();
|
||||
|
||||
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
|
||||
|
@ -811,6 +895,10 @@ static void mxs_power_configure_power_source(void)
|
|||
mxs_batt_boot();
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Do not switch CPU clock to PLL if we are VDD5V is sourced
|
||||
* from USB VBUS
|
||||
*/
|
||||
mxs_power_clock2pll();
|
||||
|
||||
mxs_init_batt_bo();
|
||||
|
@ -819,6 +907,7 @@ static void mxs_power_configure_power_source(void)
|
|||
|
||||
#ifdef CONFIG_MX23
|
||||
/* Fire up the VDDMEM LinReg now that we're all set. */
|
||||
debug("SPL: Enabling mx23 VDDMEM linear regulator\n");
|
||||
writel(POWER_VDDMEMCTRL_ENABLE_LINREG | POWER_VDDMEMCTRL_ENABLE_ILIMIT,
|
||||
&power_regs->hw_power_vddmemctrl);
|
||||
#endif
|
||||
|
@ -838,6 +927,8 @@ static void mxs_enable_output_rail_protection(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Enabling output rail protection\n");
|
||||
|
||||
writel(POWER_CTRL_VDDD_BO_IRQ | POWER_CTRL_VDDA_BO_IRQ |
|
||||
POWER_CTRL_VDDIO_BO_IRQ, &power_regs->hw_power_ctrl_clr);
|
||||
|
||||
|
@ -1077,6 +1168,8 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
|
|||
*/
|
||||
static void mxs_setup_batt_detect(void)
|
||||
{
|
||||
debug("SPL: Starting battery voltage measurement logic\n");
|
||||
|
||||
mxs_lradc_init();
|
||||
mxs_lradc_enable_batt_measurement();
|
||||
early_delay(10);
|
||||
|
@ -1111,6 +1204,8 @@ void mxs_power_init(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Initialising Power Block\n");
|
||||
|
||||
mxs_ungate_power();
|
||||
|
||||
mxs_power_clock2xtal();
|
||||
|
@ -1123,9 +1218,13 @@ void mxs_power_init(void)
|
|||
mxs_power_configure_power_source();
|
||||
mxs_enable_output_rail_protection();
|
||||
|
||||
debug("SPL: Setting VDDIO to 3V3 (brownout @ 3v15)\n");
|
||||
mxs_power_set_vddx(&mxs_vddio_cfg, 3300, 3150);
|
||||
|
||||
debug("SPL: Setting VDDD to 1V5 (brownout @ 1v0)\n");
|
||||
mxs_power_set_vddx(&mxs_vddd_cfg, 1500, 1000);
|
||||
#ifdef CONFIG_MX23
|
||||
debug("SPL: Setting mx23 VDDMEM to 2V5 (brownout @ 1v7)\n");
|
||||
mxs_power_set_vddx(&mxs_vddmem_cfg, 2500, 1700);
|
||||
#endif
|
||||
writel(POWER_CTRL_VDDD_BO_IRQ | POWER_CTRL_VDDA_BO_IRQ |
|
||||
|
@ -1150,6 +1249,7 @@ void mxs_power_wait_pswitch(void)
|
|||
struct mxs_power_regs *power_regs =
|
||||
(struct mxs_power_regs *)MXS_POWER_BASE;
|
||||
|
||||
debug("SPL: Waiting for power switch input\n");
|
||||
while (!(readl(&power_regs->hw_power_sts) & POWER_STS_PSWITCH_MASK))
|
||||
;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ obj-$(CONFIG_IPROC) += iproc-common/
|
|||
obj-$(CONFIG_KONA) += kona-common/
|
||||
obj-$(CONFIG_OMAP_COMMON) += omap-common/
|
||||
obj-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
|
||||
obj-$(CONFIG_TEGRA) += tegra-common/
|
||||
|
||||
ifneq (,$(filter s5pc1xx exynos,$(SOC)))
|
||||
obj-y += s5p-common/
|
||||
|
@ -40,13 +39,11 @@ endif
|
|||
|
||||
obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
|
||||
obj-$(if $(filter armada-xp,$(SOC)),y) += armada-xp/
|
||||
obj-$(CONFIG_AT91FAMILY) += at91/
|
||||
obj-$(CONFIG_BCM2835) += bcm2835/
|
||||
obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
|
||||
obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
|
||||
obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/
|
||||
obj-$(CONFIG_ARCH_EXYNOS) += exynos/
|
||||
obj-$(CONFIG_ARCH_HIGHBANK) += highbank/
|
||||
obj-$(CONFIG_ARCH_KEYSTONE) += keystone/
|
||||
obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/
|
||||
obj-$(if $(filter mx5,$(SOC)),y) += mx5/
|
||||
obj-$(CONFIG_MX6) += mx6/
|
||||
|
@ -58,7 +55,6 @@ obj-$(CONFIG_ARCH_S5PC1XX) += s5pc1xx/
|
|||
obj-$(CONFIG_SOCFPGA) += socfpga/
|
||||
obj-$(if $(filter stv0991,$(SOC)),y) += stv0991/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
|
||||
obj-$(CONFIG_TEGRA20) += tegra20/
|
||||
obj-$(CONFIG_U8500) += u8500/
|
||||
obj-$(CONFIG_ARCH_UNIPHIER) += uniphier/
|
||||
obj-$(CONFIG_VF610) += vf610/
|
||||
|
|
|
@ -118,4 +118,7 @@ void enable_basic_clocks(void)
|
|||
|
||||
/* Select the Master osc clk as Timer2 clock source */
|
||||
writel(0x1, &cmdpll->clktimer2clk);
|
||||
|
||||
/* For OPP100 the mac clock should be /5. */
|
||||
writel(0x4, &cmdpll->clkselmacclk);
|
||||
}
|
||||
|
|
|
@ -5,3 +5,5 @@
|
|||
#
|
||||
|
||||
obj-y = cpu.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
|
||||
|
|
62
arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S
Normal file
62
arch/arm/cpu/armv7/armada-xp/lowlevel_spl.S
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ENTRY(save_boot_params)
|
||||
bx lr
|
||||
ENDPROC(save_boot_params)
|
||||
|
||||
/*
|
||||
* cache_inv - invalidate Cache line
|
||||
* r0 - dest
|
||||
*/
|
||||
.global cache_inv
|
||||
.type cache_inv, %function
|
||||
cache_inv:
|
||||
|
||||
stmfd sp!, {r1-r12}
|
||||
|
||||
mcr p15, 0, r0, c7, c6, 1
|
||||
|
||||
ldmfd sp!, {r1-r12}
|
||||
bx lr
|
||||
|
||||
|
||||
/*
|
||||
* flush_l1_v6 - l1 cache clean invalidate
|
||||
* r0 - dest
|
||||
*/
|
||||
.global flush_l1_v6
|
||||
.type flush_l1_v6, %function
|
||||
flush_l1_v6:
|
||||
|
||||
stmfd sp!, {r1-r12}
|
||||
|
||||
mcr p15, 0, r0, c7, c10, 5 /* @ data memory barrier */
|
||||
mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
|
||||
mcr p15, 0, r0, c7, c10, 4 /* @ data sync barrier */
|
||||
|
||||
ldmfd sp!, {r1-r12}
|
||||
bx lr
|
||||
|
||||
|
||||
/*
|
||||
* flush_l1_v7 - l1 cache clean invalidate
|
||||
* r0 - dest
|
||||
*/
|
||||
.global flush_l1_v7
|
||||
.type flush_l1_v7, %function
|
||||
flush_l1_v7:
|
||||
|
||||
stmfd sp!, {r1-r12}
|
||||
|
||||
dmb /* @data memory barrier */
|
||||
mcr p15, 0, r0, c7, c14, 1 /* @ clean & invalidate D line */
|
||||
dsb /* @data sync barrier */
|
||||
|
||||
ldmfd sp!, {r1-r12}
|
||||
bx lr
|
38
arch/arm/cpu/armv7/armada-xp/spl.c
Normal file
38
arch/arm/cpu/armv7/armada-xp/spl.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2014 Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/soc.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
/* Right now only booting via SPI NOR flash is supported */
|
||||
return BOOT_DEVICE_SPI;
|
||||
}
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
/* Set global data pointer */
|
||||
gd = &gdata;
|
||||
|
||||
/* Linux expects the internal registers to be at 0xf1000000 */
|
||||
arch_cpu_init();
|
||||
|
||||
preloader_console_init();
|
||||
|
||||
/* First init the serdes PHY's */
|
||||
serdes_phy_config();
|
||||
|
||||
/* Setup DDR */
|
||||
ddr3_init();
|
||||
|
||||
board_init_r(NULL, 0);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2014, Andreas Bießmann <andreas.devel@googlemail.com>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ALL-y += u-boot.img
|
||||
endif
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2014 Atmel
|
||||
* Bo Shen <voice.shen@atmel.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/at91_common.h>
|
||||
#include <asm/arch/at91_pmc.h>
|
||||
#include <asm/arch/clk.h>
|
||||
#include <asm/arch/sama5d4.h>
|
||||
|
||||
char *get_cpu_name()
|
||||
{
|
||||
unsigned int extension_id = get_extension_chip_id();
|
||||
|
||||
if (cpu_is_sama5d4())
|
||||
switch (extension_id) {
|
||||
case ARCH_EXID_SAMA5D41:
|
||||
return "SAMA5D41";
|
||||
case ARCH_EXID_SAMA5D42:
|
||||
return "SAMA5D42";
|
||||
case ARCH_EXID_SAMA5D43:
|
||||
return "SAMA5D43";
|
||||
case ARCH_EXID_SAMA5D44:
|
||||
return "SAMA5D44";
|
||||
default:
|
||||
return "Unknown CPU type";
|
||||
}
|
||||
else
|
||||
return "Unknown CPU type";
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_GADGET_ATMEL_USBA
|
||||
void at91_udp_hw_init(void)
|
||||
{
|
||||
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
|
||||
|
||||
/* Enable UPLL clock */
|
||||
writel(AT91_PMC_UPLLEN | AT91_PMC_BIASEN, &pmc->uckr);
|
||||
/* Enable UDPHS clock */
|
||||
at91_periph_clk_enable(ATMEL_ID_UDPHS);
|
||||
}
|
||||
#endif
|
13
arch/arm/cpu/armv7/bcm2835/Makefile
Normal file
13
arch/arm/cpu/armv7/bcm2835/Makefile
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# (C) Copyright 2012 Stephen Warren
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
src_dir := ../../arm1176/bcm2835/
|
||||
|
||||
obj-y :=
|
||||
obj-y += $(src_dir)/init.o
|
||||
obj-y += $(src_dir)/reset.o
|
||||
obj-y += $(src_dir)/timer.o
|
||||
obj-y += $(src_dir)/mbox.o
|
|
@ -53,7 +53,7 @@ int cleanup_before_linux(void)
|
|||
* After D-cache is flushed and before it is disabled there may
|
||||
* be some new valid entries brought into the cache. We are sure
|
||||
* that these lines are not dirty and will not affect our execution.
|
||||
* (because unwinding the call-stack and setting a bit in CP15 SCTRL
|
||||
* (because unwinding the call-stack and setting a bit in CP15 SCTLR
|
||||
* is all we did during this. We have not pushed anything on to the
|
||||
* stack. Neither have we affected any static data)
|
||||
* So just invalidate the entire d-cache again to avoid coherency
|
||||
|
|
|
@ -65,6 +65,27 @@ endchoice
|
|||
config SYS_SOC
|
||||
default "exynos"
|
||||
|
||||
config DM
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_SERIAL
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_SPI
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_SPI_FLASH
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_GPIO
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config SYS_MALLOC_F
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config SYS_MALLOC_F_LEN
|
||||
default 0x400 if !SPL_BUILD
|
||||
|
||||
source "board/samsung/smdkv310/Kconfig"
|
||||
source "board/samsung/trats/Kconfig"
|
||||
source "board/samsung/universal_c210/Kconfig"
|
||||
|
|
|
@ -20,42 +20,84 @@
|
|||
* positions of the peripheral clocks of the src and div registers
|
||||
*/
|
||||
struct clk_bit_info {
|
||||
enum periph_id id;
|
||||
int32_t src_mask;
|
||||
int32_t div_mask;
|
||||
int32_t prediv_mask;
|
||||
int8_t src_bit;
|
||||
int8_t div_bit;
|
||||
int8_t prediv_bit;
|
||||
};
|
||||
|
||||
/* src_bit div_bit prediv_bit */
|
||||
static struct clk_bit_info clk_bit_info[] = {
|
||||
{0, 0, -1},
|
||||
{4, 4, -1},
|
||||
{8, 8, -1},
|
||||
{12, 12, -1},
|
||||
{0, 0, 8},
|
||||
{4, 16, 24},
|
||||
{8, 0, 8},
|
||||
{12, 16, 24},
|
||||
{-1, -1, -1},
|
||||
{16, 0, 8},
|
||||
{20, 16, 24},
|
||||
{24, 0, 8},
|
||||
{0, 0, 4},
|
||||
{4, 12, 16},
|
||||
{-1, -1, -1},
|
||||
{-1, -1, -1},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{-1, 24, 0},
|
||||
{24, 0, -1},
|
||||
{24, 0, -1},
|
||||
{24, 0, -1},
|
||||
{24, 0, -1},
|
||||
{24, 0, -1},
|
||||
static struct clk_bit_info exynos5_bit_info[] = {
|
||||
/* periph id s_mask d_mask p_mask s_bit d_bit p_bit */
|
||||
{PERIPH_ID_UART0, 0xf, 0xf, -1, 0, 0, -1},
|
||||
{PERIPH_ID_UART1, 0xf, 0xf, -1, 4, 4, -1},
|
||||
{PERIPH_ID_UART2, 0xf, 0xf, -1, 8, 8, -1},
|
||||
{PERIPH_ID_UART3, 0xf, 0xf, -1, 12, 12, -1},
|
||||
{PERIPH_ID_I2C0, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C1, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C2, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C3, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C4, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C5, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C6, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_I2C7, -1, 0x7, 0x7, -1, 24, 0},
|
||||
{PERIPH_ID_SPI0, 0xf, 0xf, 0xff, 16, 0, 8},
|
||||
{PERIPH_ID_SPI1, 0xf, 0xf, 0xff, 20, 16, 24},
|
||||
{PERIPH_ID_SPI2, 0xf, 0xf, 0xff, 24, 0, 8},
|
||||
{PERIPH_ID_SDMMC0, 0xf, 0xf, 0xff, 0, 0, 8},
|
||||
{PERIPH_ID_SDMMC1, 0xf, 0xf, 0xff, 4, 16, 24},
|
||||
{PERIPH_ID_SDMMC2, 0xf, 0xf, 0xff, 8, 0, 8},
|
||||
{PERIPH_ID_SDMMC3, 0xf, 0xf, 0xff, 12, 16, 24},
|
||||
{PERIPH_ID_I2S0, 0xf, 0xf, 0xff, 0, 0, 4},
|
||||
{PERIPH_ID_I2S1, 0xf, 0xf, 0xff, 4, 12, 16},
|
||||
{PERIPH_ID_SPI3, 0xf, 0xf, 0xff, 0, 0, 4},
|
||||
{PERIPH_ID_SPI4, 0xf, 0xf, 0xff, 4, 12, 16},
|
||||
{PERIPH_ID_SDMMC4, 0xf, 0xf, 0xff, 16, 0, 8},
|
||||
{PERIPH_ID_PWM0, 0xf, 0xf, -1, 24, 0, -1},
|
||||
{PERIPH_ID_PWM1, 0xf, 0xf, -1, 24, 0, -1},
|
||||
{PERIPH_ID_PWM2, 0xf, 0xf, -1, 24, 0, -1},
|
||||
{PERIPH_ID_PWM3, 0xf, 0xf, -1, 24, 0, -1},
|
||||
{PERIPH_ID_PWM4, 0xf, 0xf, -1, 24, 0, -1},
|
||||
|
||||
{PERIPH_ID_NONE, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
|
||||
static struct clk_bit_info exynos542x_bit_info[] = {
|
||||
/* periph id s_mask d_mask p_mask s_bit d_bit p_bit */
|
||||
{PERIPH_ID_UART0, 0xf, 0xf, -1, 4, 8, -1},
|
||||
{PERIPH_ID_UART1, 0xf, 0xf, -1, 8, 12, -1},
|
||||
{PERIPH_ID_UART2, 0xf, 0xf, -1, 12, 16, -1},
|
||||
{PERIPH_ID_UART3, 0xf, 0xf, -1, 16, 20, -1},
|
||||
{PERIPH_ID_I2C0, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C1, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C2, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C3, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C4, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C5, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C6, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C7, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_SPI0, 0xf, 0xf, 0xff, 20, 20, 8},
|
||||
{PERIPH_ID_SPI1, 0xf, 0xf, 0xff, 24, 24, 16},
|
||||
{PERIPH_ID_SPI2, 0xf, 0xf, 0xff, 28, 28, 24},
|
||||
{PERIPH_ID_SDMMC0, 0x7, 0x3ff, -1, 8, 0, -1},
|
||||
{PERIPH_ID_SDMMC1, 0x7, 0x3ff, -1, 12, 10, -1},
|
||||
{PERIPH_ID_SDMMC2, 0x7, 0x3ff, -1, 16, 20, -1},
|
||||
{PERIPH_ID_I2C8, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2C9, -1, 0x3f, -1, -1, 8, -1},
|
||||
{PERIPH_ID_I2S0, 0xf, 0xf, 0xff, 0, 0, 4},
|
||||
{PERIPH_ID_I2S1, 0xf, 0xf, 0xff, 4, 12, 16},
|
||||
{PERIPH_ID_SPI3, 0xf, 0xf, 0xff, 12, 16, 0},
|
||||
{PERIPH_ID_SPI4, 0xf, 0xf, 0xff, 16, 20, 8},
|
||||
{PERIPH_ID_PWM0, 0xf, 0xf, -1, 24, 28, -1},
|
||||
{PERIPH_ID_PWM1, 0xf, 0xf, -1, 24, 28, -1},
|
||||
{PERIPH_ID_PWM2, 0xf, 0xf, -1, 24, 28, -1},
|
||||
{PERIPH_ID_PWM3, 0xf, 0xf, -1, 24, 28, -1},
|
||||
{PERIPH_ID_PWM4, 0xf, 0xf, -1, 24, 28, -1},
|
||||
{PERIPH_ID_I2C10, -1, 0x3f, -1, -1, 8, -1},
|
||||
|
||||
{PERIPH_ID_NONE, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
|
||||
/* Epll Clock division values to achive different frequency output */
|
||||
|
@ -260,112 +302,8 @@ static unsigned long exynos5_get_pll_clk(int pllreg)
|
|||
return fout;
|
||||
}
|
||||
|
||||
static unsigned long exynos5_get_periph_rate(int peripheral)
|
||||
{
|
||||
struct clk_bit_info *bit_info = &clk_bit_info[peripheral];
|
||||
unsigned long sclk, sub_clk;
|
||||
unsigned int src, div, sub_div;
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
case PERIPH_ID_UART1:
|
||||
case PERIPH_ID_UART2:
|
||||
case PERIPH_ID_UART3:
|
||||
src = readl(&clk->src_peric0);
|
||||
div = readl(&clk->div_peric0);
|
||||
break;
|
||||
case PERIPH_ID_PWM0:
|
||||
case PERIPH_ID_PWM1:
|
||||
case PERIPH_ID_PWM2:
|
||||
case PERIPH_ID_PWM3:
|
||||
case PERIPH_ID_PWM4:
|
||||
src = readl(&clk->src_peric0);
|
||||
div = readl(&clk->div_peric3);
|
||||
break;
|
||||
case PERIPH_ID_I2S0:
|
||||
src = readl(&clk->src_mau);
|
||||
div = readl(&clk->div_mau);
|
||||
case PERIPH_ID_SPI0:
|
||||
case PERIPH_ID_SPI1:
|
||||
src = readl(&clk->src_peric1);
|
||||
div = readl(&clk->div_peric1);
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
src = readl(&clk->src_peric1);
|
||||
div = readl(&clk->div_peric2);
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
case PERIPH_ID_SPI4:
|
||||
src = readl(&clk->sclk_src_isp);
|
||||
div = readl(&clk->sclk_div_isp);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC0:
|
||||
case PERIPH_ID_SDMMC1:
|
||||
case PERIPH_ID_SDMMC2:
|
||||
case PERIPH_ID_SDMMC3:
|
||||
src = readl(&clk->src_fsys);
|
||||
div = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case PERIPH_ID_I2C0:
|
||||
case PERIPH_ID_I2C1:
|
||||
case PERIPH_ID_I2C2:
|
||||
case PERIPH_ID_I2C3:
|
||||
case PERIPH_ID_I2C4:
|
||||
case PERIPH_ID_I2C5:
|
||||
case PERIPH_ID_I2C6:
|
||||
case PERIPH_ID_I2C7:
|
||||
sclk = exynos5_get_pll_clk(MPLL);
|
||||
sub_div = ((readl(&clk->div_top1) >> bit_info->div_bit)
|
||||
& 0x7) + 1;
|
||||
div = ((readl(&clk->div_top0) >> bit_info->prediv_bit)
|
||||
& 0x7) + 1;
|
||||
return (sclk / sub_div) / div;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
};
|
||||
|
||||
src = (src >> bit_info->src_bit) & 0xf;
|
||||
|
||||
switch (src) {
|
||||
case EXYNOS_SRC_MPLL:
|
||||
sclk = exynos5_get_pll_clk(MPLL);
|
||||
break;
|
||||
case EXYNOS_SRC_EPLL:
|
||||
sclk = exynos5_get_pll_clk(EPLL);
|
||||
break;
|
||||
case EXYNOS_SRC_VPLL:
|
||||
sclk = exynos5_get_pll_clk(VPLL);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Ratio clock division for this peripheral */
|
||||
sub_div = (div >> bit_info->div_bit) & 0xf;
|
||||
sub_clk = sclk / (sub_div + 1);
|
||||
|
||||
/* Pre-ratio clock division for SDMMC0 and 2 */
|
||||
if (peripheral == PERIPH_ID_SDMMC0 || peripheral == PERIPH_ID_SDMMC2) {
|
||||
div = (div >> bit_info->prediv_bit) & 0xff;
|
||||
return sub_clk / (div + 1);
|
||||
}
|
||||
|
||||
return sub_clk;
|
||||
}
|
||||
|
||||
unsigned long clock_get_periph_rate(int peripheral)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_get_periph_rate(peripheral);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* exynos5420: return pll clock frequency */
|
||||
static unsigned long exynos5420_get_pll_clk(int pllreg)
|
||||
/* exynos542x: return pll clock frequency */
|
||||
static unsigned long exynos542x_get_pll_clk(int pllreg)
|
||||
{
|
||||
struct exynos5420_clock *clk =
|
||||
(struct exynos5420_clock *)samsung_get_base_clock();
|
||||
|
@ -404,6 +342,231 @@ static unsigned long exynos5420_get_pll_clk(int pllreg)
|
|||
return exynos_get_pll_clk(pllreg, r, k);
|
||||
}
|
||||
|
||||
static struct clk_bit_info *get_clk_bit_info(int peripheral)
|
||||
{
|
||||
int i;
|
||||
struct clk_bit_info *info;
|
||||
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
info = exynos542x_bit_info;
|
||||
else
|
||||
info = exynos5_bit_info;
|
||||
|
||||
for (i = 0; info[i].id != PERIPH_ID_NONE; i++) {
|
||||
if (info[i].id == peripheral)
|
||||
break;
|
||||
}
|
||||
|
||||
if (info[i].id == PERIPH_ID_NONE)
|
||||
debug("ERROR: Peripheral ID %d not found\n", peripheral);
|
||||
|
||||
return &info[i];
|
||||
}
|
||||
|
||||
static unsigned long exynos5_get_periph_rate(int peripheral)
|
||||
{
|
||||
struct clk_bit_info *bit_info = get_clk_bit_info(peripheral);
|
||||
unsigned long sclk = 0;
|
||||
unsigned int src = 0, div = 0, sub_div = 0;
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
case PERIPH_ID_UART1:
|
||||
case PERIPH_ID_UART2:
|
||||
case PERIPH_ID_UART3:
|
||||
src = readl(&clk->src_peric0);
|
||||
div = readl(&clk->div_peric0);
|
||||
break;
|
||||
case PERIPH_ID_PWM0:
|
||||
case PERIPH_ID_PWM1:
|
||||
case PERIPH_ID_PWM2:
|
||||
case PERIPH_ID_PWM3:
|
||||
case PERIPH_ID_PWM4:
|
||||
src = readl(&clk->src_peric0);
|
||||
div = readl(&clk->div_peric3);
|
||||
break;
|
||||
case PERIPH_ID_I2S0:
|
||||
src = readl(&clk->src_mau);
|
||||
div = sub_div = readl(&clk->div_mau);
|
||||
case PERIPH_ID_SPI0:
|
||||
case PERIPH_ID_SPI1:
|
||||
src = readl(&clk->src_peric1);
|
||||
div = sub_div = readl(&clk->div_peric1);
|
||||
break;
|
||||
case PERIPH_ID_SPI2:
|
||||
src = readl(&clk->src_peric1);
|
||||
div = sub_div = readl(&clk->div_peric2);
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
case PERIPH_ID_SPI4:
|
||||
src = readl(&clk->sclk_src_isp);
|
||||
div = sub_div = readl(&clk->sclk_div_isp);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC0:
|
||||
case PERIPH_ID_SDMMC1:
|
||||
src = readl(&clk->src_fsys);
|
||||
div = sub_div = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC2:
|
||||
case PERIPH_ID_SDMMC3:
|
||||
src = readl(&clk->src_fsys);
|
||||
div = sub_div = readl(&clk->div_fsys2);
|
||||
break;
|
||||
case PERIPH_ID_I2C0:
|
||||
case PERIPH_ID_I2C1:
|
||||
case PERIPH_ID_I2C2:
|
||||
case PERIPH_ID_I2C3:
|
||||
case PERIPH_ID_I2C4:
|
||||
case PERIPH_ID_I2C5:
|
||||
case PERIPH_ID_I2C6:
|
||||
case PERIPH_ID_I2C7:
|
||||
src = EXYNOS_SRC_MPLL;
|
||||
div = readl(&clk->div_top0);
|
||||
sub_div = readl(&clk->div_top1);
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
};
|
||||
|
||||
if (bit_info->src_bit >= 0)
|
||||
src = (src >> bit_info->src_bit) & bit_info->src_mask;
|
||||
|
||||
switch (src) {
|
||||
case EXYNOS_SRC_MPLL:
|
||||
sclk = exynos5_get_pll_clk(MPLL);
|
||||
break;
|
||||
case EXYNOS_SRC_EPLL:
|
||||
sclk = exynos5_get_pll_clk(EPLL);
|
||||
break;
|
||||
case EXYNOS_SRC_VPLL:
|
||||
sclk = exynos5_get_pll_clk(VPLL);
|
||||
break;
|
||||
default:
|
||||
debug("%s: EXYNOS_SRC %d not supported\n", __func__, src);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Clock divider ratio for this peripheral */
|
||||
if (bit_info->div_bit >= 0)
|
||||
div = (div >> bit_info->div_bit) & bit_info->div_mask;
|
||||
|
||||
/* Clock pre-divider ratio for this peripheral */
|
||||
if (bit_info->prediv_bit >= 0)
|
||||
sub_div = (sub_div >> bit_info->prediv_bit)
|
||||
& bit_info->prediv_mask;
|
||||
|
||||
/* Calculate and return required clock rate */
|
||||
return (sclk / (div + 1)) / (sub_div + 1);
|
||||
}
|
||||
|
||||
static unsigned long exynos542x_get_periph_rate(int peripheral)
|
||||
{
|
||||
struct clk_bit_info *bit_info = get_clk_bit_info(peripheral);
|
||||
unsigned long sclk = 0;
|
||||
unsigned int src = 0, div = 0, sub_div = 0;
|
||||
struct exynos5420_clock *clk =
|
||||
(struct exynos5420_clock *)samsung_get_base_clock();
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_UART0:
|
||||
case PERIPH_ID_UART1:
|
||||
case PERIPH_ID_UART2:
|
||||
case PERIPH_ID_UART3:
|
||||
case PERIPH_ID_PWM0:
|
||||
case PERIPH_ID_PWM1:
|
||||
case PERIPH_ID_PWM2:
|
||||
case PERIPH_ID_PWM3:
|
||||
case PERIPH_ID_PWM4:
|
||||
src = readl(&clk->src_peric0);
|
||||
div = readl(&clk->div_peric0);
|
||||
break;
|
||||
case PERIPH_ID_SPI0:
|
||||
case PERIPH_ID_SPI1:
|
||||
case PERIPH_ID_SPI2:
|
||||
src = readl(&clk->src_peric1);
|
||||
div = readl(&clk->div_peric1);
|
||||
sub_div = readl(&clk->div_peric4);
|
||||
break;
|
||||
case PERIPH_ID_SPI3:
|
||||
case PERIPH_ID_SPI4:
|
||||
src = readl(&clk->src_isp);
|
||||
div = readl(&clk->div_isp1);
|
||||
sub_div = readl(&clk->div_isp1);
|
||||
break;
|
||||
case PERIPH_ID_SDMMC0:
|
||||
case PERIPH_ID_SDMMC1:
|
||||
case PERIPH_ID_SDMMC2:
|
||||
case PERIPH_ID_SDMMC3:
|
||||
src = readl(&clk->src_fsys);
|
||||
div = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case PERIPH_ID_I2C0:
|
||||
case PERIPH_ID_I2C1:
|
||||
case PERIPH_ID_I2C2:
|
||||
case PERIPH_ID_I2C3:
|
||||
case PERIPH_ID_I2C4:
|
||||
case PERIPH_ID_I2C5:
|
||||
case PERIPH_ID_I2C6:
|
||||
case PERIPH_ID_I2C7:
|
||||
case PERIPH_ID_I2C8:
|
||||
case PERIPH_ID_I2C9:
|
||||
case PERIPH_ID_I2C10:
|
||||
src = EXYNOS542X_SRC_MPLL;
|
||||
div = readl(&clk->div_top1);
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
};
|
||||
|
||||
if (bit_info->src_bit >= 0)
|
||||
src = (src >> bit_info->src_bit) & bit_info->src_mask;
|
||||
|
||||
switch (src) {
|
||||
case EXYNOS542X_SRC_MPLL:
|
||||
sclk = exynos542x_get_pll_clk(MPLL);
|
||||
break;
|
||||
case EXYNOS542X_SRC_SPLL:
|
||||
sclk = exynos542x_get_pll_clk(SPLL);
|
||||
break;
|
||||
case EXYNOS542X_SRC_EPLL:
|
||||
sclk = exynos542x_get_pll_clk(EPLL);
|
||||
break;
|
||||
case EXYNOS542X_SRC_RPLL:
|
||||
sclk = exynos542x_get_pll_clk(RPLL);
|
||||
break;
|
||||
default:
|
||||
debug("%s: EXYNOS542X_SRC %d not supported", __func__, src);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Clock divider ratio for this peripheral */
|
||||
if (bit_info->div_bit >= 0)
|
||||
div = (div >> bit_info->div_bit) & bit_info->div_mask;
|
||||
|
||||
/* Clock pre-divider ratio for this peripheral */
|
||||
if (bit_info->prediv_bit >= 0)
|
||||
sub_div = (sub_div >> bit_info->prediv_bit)
|
||||
& bit_info->prediv_mask;
|
||||
|
||||
/* Calculate and return required clock rate */
|
||||
return (sclk / (div + 1)) / (sub_div + 1);
|
||||
}
|
||||
|
||||
unsigned long clock_get_periph_rate(int peripheral)
|
||||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
return exynos542x_get_periph_rate(peripheral);
|
||||
return exynos5_get_periph_rate(peripheral);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* exynos4: return ARM clock frequency */
|
||||
static unsigned long exynos4_get_arm_clk(void)
|
||||
{
|
||||
|
@ -527,27 +690,6 @@ static unsigned long exynos4x12_get_pwm_clk(void)
|
|||
return pclk;
|
||||
}
|
||||
|
||||
/* exynos5420: return pwm clock frequency */
|
||||
static unsigned long exynos5420_get_pwm_clk(void)
|
||||
{
|
||||
struct exynos5420_clock *clk =
|
||||
(struct exynos5420_clock *)samsung_get_base_clock();
|
||||
unsigned long pclk, sclk;
|
||||
unsigned int ratio;
|
||||
|
||||
/*
|
||||
* CLK_DIV_PERIC0
|
||||
* PWM_RATIO [31:28]
|
||||
*/
|
||||
ratio = readl(&clk->div_peric0);
|
||||
ratio = (ratio >> 28) & 0xf;
|
||||
sclk = get_pll_clk(MPLL);
|
||||
|
||||
pclk = sclk / (ratio + 1);
|
||||
|
||||
return pclk;
|
||||
}
|
||||
|
||||
/* exynos4: return uart clock frequency */
|
||||
static unsigned long exynos4_get_uart_clk(int dev_index)
|
||||
{
|
||||
|
@ -640,100 +782,6 @@ static unsigned long exynos4x12_get_uart_clk(int dev_index)
|
|||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos5: return uart clock frequency */
|
||||
static unsigned long exynos5_get_uart_clk(int dev_index)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel;
|
||||
unsigned int ratio;
|
||||
|
||||
/*
|
||||
* CLK_SRC_PERIC0
|
||||
* UART0_SEL [3:0]
|
||||
* UART1_SEL [7:4]
|
||||
* UART2_SEL [8:11]
|
||||
* UART3_SEL [12:15]
|
||||
* UART4_SEL [16:19]
|
||||
* UART5_SEL [23:20]
|
||||
*/
|
||||
sel = readl(&clk->src_peric0);
|
||||
sel = (sel >> (dev_index << 2)) & 0xf;
|
||||
|
||||
if (sel == 0x6)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x8)
|
||||
sclk = get_pll_clk(VPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* CLK_DIV_PERIC0
|
||||
* UART0_RATIO [3:0]
|
||||
* UART1_RATIO [7:4]
|
||||
* UART2_RATIO [8:11]
|
||||
* UART3_RATIO [12:15]
|
||||
* UART4_RATIO [16:19]
|
||||
* UART5_RATIO [23:20]
|
||||
*/
|
||||
ratio = readl(&clk->div_peric0);
|
||||
ratio = (ratio >> (dev_index << 2)) & 0xf;
|
||||
|
||||
uclk = sclk / (ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos5420: return uart clock frequency */
|
||||
static unsigned long exynos5420_get_uart_clk(int dev_index)
|
||||
{
|
||||
struct exynos5420_clock *clk =
|
||||
(struct exynos5420_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel;
|
||||
unsigned int ratio;
|
||||
|
||||
/*
|
||||
* CLK_SRC_PERIC0
|
||||
* UART0_SEL [6:4]
|
||||
* UART1_SEL [10:8]
|
||||
* UART2_SEL [14:12]
|
||||
* UART3_SEL [18:16]
|
||||
* generalised calculation as follows
|
||||
* sel = (sel >> ((dev_index * 4) + 4)) & mask;
|
||||
*/
|
||||
sel = readl(&clk->src_peric0);
|
||||
sel = (sel >> ((dev_index * 4) + 4)) & 0x7;
|
||||
|
||||
if (sel == 0x3)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x6)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(RPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* CLK_DIV_PERIC0
|
||||
* UART0_RATIO [11:8]
|
||||
* UART1_RATIO [15:12]
|
||||
* UART2_RATIO [19:16]
|
||||
* UART3_RATIO [23:20]
|
||||
* generalised calculation as follows
|
||||
* ratio = (ratio >> ((dev_index * 4) + 8)) & mask;
|
||||
*/
|
||||
ratio = readl(&clk->div_peric0);
|
||||
ratio = (ratio >> ((dev_index * 4) + 8)) & 0xf;
|
||||
|
||||
uclk = sclk / (ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
static unsigned long exynos4_get_mmc_clk(int dev_index)
|
||||
{
|
||||
struct exynos4_clock *clk =
|
||||
|
@ -783,94 +831,6 @@ static unsigned long exynos4_get_mmc_clk(int dev_index)
|
|||
return uclk;
|
||||
}
|
||||
|
||||
static unsigned long exynos5_get_mmc_clk(int dev_index)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel, ratio, pre_ratio;
|
||||
int shift = 0;
|
||||
|
||||
sel = readl(&clk->src_fsys);
|
||||
sel = (sel >> (dev_index << 2)) & 0xf;
|
||||
|
||||
if (sel == 0x6)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x7)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else if (sel == 0x8)
|
||||
sclk = get_pll_clk(VPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
switch (dev_index) {
|
||||
case 0:
|
||||
case 1:
|
||||
ratio = readl(&clk->div_fsys1);
|
||||
pre_ratio = readl(&clk->div_fsys1);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
ratio = readl(&clk->div_fsys2);
|
||||
pre_ratio = readl(&clk->div_fsys2);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dev_index == 1 || dev_index == 3)
|
||||
shift = 16;
|
||||
|
||||
ratio = (ratio >> shift) & 0xf;
|
||||
pre_ratio = (pre_ratio >> (shift + 8)) & 0xff;
|
||||
uclk = (sclk / (ratio + 1)) / (pre_ratio + 1);
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
static unsigned long exynos5420_get_mmc_clk(int dev_index)
|
||||
{
|
||||
struct exynos5420_clock *clk =
|
||||
(struct exynos5420_clock *)samsung_get_base_clock();
|
||||
unsigned long uclk, sclk;
|
||||
unsigned int sel, ratio;
|
||||
|
||||
/*
|
||||
* CLK_SRC_FSYS
|
||||
* MMC0_SEL [10:8]
|
||||
* MMC1_SEL [14:12]
|
||||
* MMC2_SEL [18:16]
|
||||
* generalised calculation as follows
|
||||
* sel = (sel >> ((dev_index * 4) + 8)) & mask
|
||||
*/
|
||||
sel = readl(&clk->src_fsys);
|
||||
sel = (sel >> ((dev_index * 4) + 8)) & 0x7;
|
||||
|
||||
if (sel == 0x3)
|
||||
sclk = get_pll_clk(MPLL);
|
||||
else if (sel == 0x4)
|
||||
sclk = get_pll_clk(SPLL);
|
||||
else if (sel == 0x6)
|
||||
sclk = get_pll_clk(EPLL);
|
||||
else
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* CLK_DIV_FSYS1
|
||||
* MMC0_RATIO [9:0]
|
||||
* MMC1_RATIO [19:10]
|
||||
* MMC2_RATIO [29:20]
|
||||
* generalised calculation as follows
|
||||
* ratio = (ratio >> (dev_index * 10)) & mask
|
||||
*/
|
||||
ratio = readl(&clk->div_fsys1);
|
||||
ratio = (ratio >> (dev_index * 10)) & 0x3ff;
|
||||
|
||||
uclk = (sclk / (ratio + 1));
|
||||
|
||||
return uclk;
|
||||
}
|
||||
|
||||
/* exynos4: set the mmc clock */
|
||||
static void exynos4_set_mmc_clk(int dev_index, unsigned int div)
|
||||
{
|
||||
|
@ -1249,29 +1209,6 @@ void exynos4_set_mipi_clk(void)
|
|||
clrsetbits_le32(&clk->div_lcd0, 0xf << 16, 0x1 << 16);
|
||||
}
|
||||
|
||||
/*
|
||||
* I2C
|
||||
*
|
||||
* exynos5: obtaining the I2C clock
|
||||
*/
|
||||
static unsigned long exynos5_get_i2c_clk(void)
|
||||
{
|
||||
struct exynos5_clock *clk =
|
||||
(struct exynos5_clock *)samsung_get_base_clock();
|
||||
unsigned long aclk_66, aclk_66_pre, sclk;
|
||||
unsigned int ratio;
|
||||
|
||||
sclk = get_pll_clk(MPLL);
|
||||
|
||||
ratio = (readl(&clk->div_top1)) >> 24;
|
||||
ratio &= 0x7;
|
||||
aclk_66_pre = sclk / (ratio + 1);
|
||||
ratio = readl(&clk->div_top0);
|
||||
ratio &= 0x7;
|
||||
aclk_66 = aclk_66_pre / (ratio + 1);
|
||||
return aclk_66;
|
||||
}
|
||||
|
||||
int exynos5_set_epll_clk(unsigned long rate)
|
||||
{
|
||||
unsigned int epll_con, epll_con_k;
|
||||
|
@ -1585,7 +1522,7 @@ unsigned long get_pll_clk(int pllreg)
|
|||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
return exynos5420_get_pll_clk(pllreg);
|
||||
return exynos542x_get_pll_clk(pllreg);
|
||||
return exynos5_get_pll_clk(pllreg);
|
||||
} else {
|
||||
if (proid_is_exynos4412())
|
||||
|
@ -1608,7 +1545,7 @@ unsigned long get_arm_clk(void)
|
|||
unsigned long get_i2c_clk(void)
|
||||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
return exynos5_get_i2c_clk();
|
||||
return clock_get_periph_rate(PERIPH_ID_I2C0);
|
||||
} else if (cpu_is_exynos4()) {
|
||||
return exynos4_get_i2c_clk();
|
||||
} else {
|
||||
|
@ -1620,8 +1557,6 @@ unsigned long get_i2c_clk(void)
|
|||
unsigned long get_pwm_clk(void)
|
||||
{
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
return exynos5420_get_pwm_clk();
|
||||
return clock_get_periph_rate(PERIPH_ID_PWM0);
|
||||
} else {
|
||||
if (proid_is_exynos4412())
|
||||
|
@ -1632,10 +1567,28 @@ unsigned long get_pwm_clk(void)
|
|||
|
||||
unsigned long get_uart_clk(int dev_index)
|
||||
{
|
||||
enum periph_id id;
|
||||
|
||||
switch (dev_index) {
|
||||
case 0:
|
||||
id = PERIPH_ID_UART0;
|
||||
break;
|
||||
case 1:
|
||||
id = PERIPH_ID_UART1;
|
||||
break;
|
||||
case 2:
|
||||
id = PERIPH_ID_UART2;
|
||||
break;
|
||||
case 3:
|
||||
id = PERIPH_ID_UART3;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid UART index %d", __func__, dev_index);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
return exynos5420_get_uart_clk(dev_index);
|
||||
return exynos5_get_uart_clk(dev_index);
|
||||
return clock_get_periph_rate(id);
|
||||
} else {
|
||||
if (proid_is_exynos4412())
|
||||
return exynos4x12_get_uart_clk(dev_index);
|
||||
|
@ -1645,10 +1598,28 @@ unsigned long get_uart_clk(int dev_index)
|
|||
|
||||
unsigned long get_mmc_clk(int dev_index)
|
||||
{
|
||||
enum periph_id id;
|
||||
|
||||
switch (dev_index) {
|
||||
case 0:
|
||||
id = PERIPH_ID_SDMMC0;
|
||||
break;
|
||||
case 1:
|
||||
id = PERIPH_ID_SDMMC1;
|
||||
break;
|
||||
case 2:
|
||||
id = PERIPH_ID_SDMMC2;
|
||||
break;
|
||||
case 3:
|
||||
id = PERIPH_ID_SDMMC3;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid MMC index %d", __func__, dev_index);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
return exynos5420_get_mmc_clk(dev_index);
|
||||
return exynos5_get_mmc_clk(dev_index);
|
||||
return clock_get_periph_rate(id);
|
||||
} else {
|
||||
return exynos4_get_mmc_clk(dev_index);
|
||||
}
|
||||
|
@ -1656,6 +1627,10 @@ unsigned long get_mmc_clk(int dev_index)
|
|||
|
||||
void set_mmc_clk(int dev_index, unsigned int div)
|
||||
{
|
||||
/* If want to set correct value, it needs to substract one from div.*/
|
||||
if (div > 0)
|
||||
div -= 1;
|
||||
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
exynos5420_set_mmc_clk(dev_index, div);
|
||||
|
|
|
@ -266,22 +266,33 @@ static void exynos5_sromc_config(int flags)
|
|||
|
||||
static void exynos5_i2c_config(int peripheral, int flags)
|
||||
{
|
||||
int func01, func23;
|
||||
|
||||
/* High-Speed I2C */
|
||||
if (flags & PINMUX_FLAG_HS_MODE) {
|
||||
func01 = 4;
|
||||
func23 = 4;
|
||||
} else {
|
||||
func01 = 2;
|
||||
func23 = 3;
|
||||
}
|
||||
|
||||
switch (peripheral) {
|
||||
case PERIPH_ID_I2C0:
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B30, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B31, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B30, S5P_GPIO_FUNC(func01));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B31, S5P_GPIO_FUNC(func01));
|
||||
break;
|
||||
case PERIPH_ID_I2C1:
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B32, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B33, S5P_GPIO_FUNC(0x2));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B32, S5P_GPIO_FUNC(func01));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_B33, S5P_GPIO_FUNC(func01));
|
||||
break;
|
||||
case PERIPH_ID_I2C2:
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A06, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A07, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A06, S5P_GPIO_FUNC(func23));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A07, S5P_GPIO_FUNC(func23));
|
||||
break;
|
||||
case PERIPH_ID_I2C3:
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A12, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A13, S5P_GPIO_FUNC(0x3));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A12, S5P_GPIO_FUNC(func23));
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A13, S5P_GPIO_FUNC(func23));
|
||||
break;
|
||||
case PERIPH_ID_I2C4:
|
||||
gpio_cfg_pin(EXYNOS5_GPIO_A20, S5P_GPIO_FUNC(0x3));
|
||||
|
|
|
@ -102,10 +102,34 @@ static void exynos5_set_usbdrd_phy_ctrl(unsigned int enable)
|
|||
}
|
||||
}
|
||||
|
||||
static void exynos5420_set_usbdev_phy_ctrl(unsigned int enable)
|
||||
{
|
||||
struct exynos5420_power *power =
|
||||
(struct exynos5420_power *)samsung_get_base_power();
|
||||
|
||||
if (enable) {
|
||||
/* Enabling USBDEV_PHY */
|
||||
setbits_le32(&power->usbdev_phy_control,
|
||||
POWER_USB_DRD_PHY_CTRL_EN);
|
||||
setbits_le32(&power->usbdev1_phy_control,
|
||||
POWER_USB_DRD_PHY_CTRL_EN);
|
||||
} else {
|
||||
/* Disabling USBDEV_PHY */
|
||||
clrbits_le32(&power->usbdev_phy_control,
|
||||
POWER_USB_DRD_PHY_CTRL_EN);
|
||||
clrbits_le32(&power->usbdev1_phy_control,
|
||||
POWER_USB_DRD_PHY_CTRL_EN);
|
||||
}
|
||||
}
|
||||
|
||||
void set_usbdrd_phy_ctrl(unsigned int enable)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
exynos5_set_usbdrd_phy_ctrl(enable);
|
||||
if (cpu_is_exynos5()) {
|
||||
if (proid_is_exynos5420() || proid_is_exynos5800())
|
||||
exynos5420_set_usbdev_phy_ctrl(enable);
|
||||
else
|
||||
exynos5_set_usbdrd_phy_ctrl(enable);
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos5_dp_phy_control(unsigned int enable)
|
||||
|
|
|
@ -309,4 +309,3 @@ void board_init_r(gd_t *id, ulong dest_addr)
|
|||
while (1)
|
||||
;
|
||||
}
|
||||
void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
|
||||
|
|
|
@ -12,6 +12,65 @@
|
|||
#include <asm/io.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#if defined(CONFIG_MX6SX)
|
||||
/* Configure MX6SX mmdc iomux */
|
||||
void mx6sx_dram_iocfg(unsigned width,
|
||||
const struct mx6sx_iomux_ddr_regs *ddr,
|
||||
const struct mx6sx_iomux_grp_regs *grp)
|
||||
{
|
||||
struct mx6sx_iomux_ddr_regs *mx6_ddr_iomux;
|
||||
struct mx6sx_iomux_grp_regs *mx6_grp_iomux;
|
||||
|
||||
mx6_ddr_iomux = (struct mx6sx_iomux_ddr_regs *)MX6SX_IOM_DDR_BASE;
|
||||
mx6_grp_iomux = (struct mx6sx_iomux_grp_regs *)MX6SX_IOM_GRP_BASE;
|
||||
|
||||
/* DDR IO TYPE */
|
||||
writel(grp->grp_ddr_type, &mx6_grp_iomux->grp_ddr_type);
|
||||
writel(grp->grp_ddrpke, &mx6_grp_iomux->grp_ddrpke);
|
||||
|
||||
/* CLOCK */
|
||||
writel(ddr->dram_sdclk_0, &mx6_ddr_iomux->dram_sdclk_0);
|
||||
|
||||
/* ADDRESS */
|
||||
writel(ddr->dram_cas, &mx6_ddr_iomux->dram_cas);
|
||||
writel(ddr->dram_ras, &mx6_ddr_iomux->dram_ras);
|
||||
writel(grp->grp_addds, &mx6_grp_iomux->grp_addds);
|
||||
|
||||
/* Control */
|
||||
writel(ddr->dram_reset, &mx6_ddr_iomux->dram_reset);
|
||||
writel(ddr->dram_sdba2, &mx6_ddr_iomux->dram_sdba2);
|
||||
writel(ddr->dram_sdcke0, &mx6_ddr_iomux->dram_sdcke0);
|
||||
writel(ddr->dram_sdcke1, &mx6_ddr_iomux->dram_sdcke1);
|
||||
writel(ddr->dram_odt0, &mx6_ddr_iomux->dram_odt0);
|
||||
writel(ddr->dram_odt1, &mx6_ddr_iomux->dram_odt1);
|
||||
writel(grp->grp_ctlds, &mx6_grp_iomux->grp_ctlds);
|
||||
|
||||
/* Data Strobes */
|
||||
writel(grp->grp_ddrmode_ctl, &mx6_grp_iomux->grp_ddrmode_ctl);
|
||||
writel(ddr->dram_sdqs0, &mx6_ddr_iomux->dram_sdqs0);
|
||||
writel(ddr->dram_sdqs1, &mx6_ddr_iomux->dram_sdqs1);
|
||||
if (width >= 32) {
|
||||
writel(ddr->dram_sdqs2, &mx6_ddr_iomux->dram_sdqs2);
|
||||
writel(ddr->dram_sdqs3, &mx6_ddr_iomux->dram_sdqs3);
|
||||
}
|
||||
|
||||
/* Data */
|
||||
writel(grp->grp_ddrmode, &mx6_grp_iomux->grp_ddrmode);
|
||||
writel(grp->grp_b0ds, &mx6_grp_iomux->grp_b0ds);
|
||||
writel(grp->grp_b1ds, &mx6_grp_iomux->grp_b1ds);
|
||||
if (width >= 32) {
|
||||
writel(grp->grp_b2ds, &mx6_grp_iomux->grp_b2ds);
|
||||
writel(grp->grp_b3ds, &mx6_grp_iomux->grp_b3ds);
|
||||
}
|
||||
writel(ddr->dram_dqm0, &mx6_ddr_iomux->dram_dqm0);
|
||||
writel(ddr->dram_dqm1, &mx6_ddr_iomux->dram_dqm1);
|
||||
if (width >= 32) {
|
||||
writel(ddr->dram_dqm2, &mx6_ddr_iomux->dram_dqm2);
|
||||
writel(ddr->dram_dqm3, &mx6_ddr_iomux->dram_dqm3);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MX6QDL) || defined(CONFIG_MX6Q) || defined(CONFIG_MX6D)
|
||||
/* Configure MX6DQ mmdc iomux */
|
||||
void mx6dq_dram_iocfg(unsigned width,
|
||||
|
@ -184,12 +243,19 @@ void mx6sdl_dram_iocfg(unsigned width,
|
|||
*/
|
||||
#define MR(val, ba, cmd, cs1) \
|
||||
((val << 16) | (1 << 15) | (cmd << 4) | (cs1 << 3) | ba)
|
||||
#ifdef CONFIG_MX6SX
|
||||
#define MMDC1(entry, value) do {} while (0)
|
||||
#else
|
||||
#define MMDC1(entry, value) do { mmdc1->entry = value; } while (0)
|
||||
#endif
|
||||
void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
||||
const struct mx6_mmdc_calibration *calib,
|
||||
const struct mx6_ddr3_cfg *ddr3_cfg)
|
||||
{
|
||||
volatile struct mmdc_p_regs *mmdc0;
|
||||
#ifndef CONFIG_MX6SX
|
||||
volatile struct mmdc_p_regs *mmdc1;
|
||||
#endif
|
||||
u32 val;
|
||||
u8 tcke, tcksrx, tcksre, txpdll, taofpd, taonpd, trrd;
|
||||
u8 todtlon, taxpd, tanpd, tcwl, txp, tfaw, tcl;
|
||||
|
@ -203,7 +269,9 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
|||
int cs;
|
||||
|
||||
mmdc0 = (struct mmdc_p_regs *)MMDC_P0_BASE_ADDR;
|
||||
#ifndef CONFIG_MX6SX
|
||||
mmdc1 = (struct mmdc_p_regs *)MMDC_P1_BASE_ADDR;
|
||||
#endif
|
||||
|
||||
/* MX6D/MX6Q: 1066 MHz memory clock, clkper = 1.894ns = 1894ps */
|
||||
if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) {
|
||||
|
@ -362,12 +430,12 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
|||
mmdc0->mprddlctl = calib->p0_mprddlctl;
|
||||
mmdc0->mpwrdlctl = calib->p0_mpwrdlctl;
|
||||
if (sysinfo->dsize > 1) {
|
||||
mmdc1->mpwldectrl0 = calib->p1_mpwldectrl0;
|
||||
mmdc1->mpwldectrl1 = calib->p1_mpwldectrl1;
|
||||
mmdc1->mpdgctrl0 = calib->p1_mpdgctrl0;
|
||||
mmdc1->mpdgctrl1 = calib->p1_mpdgctrl1;
|
||||
mmdc1->mprddlctl = calib->p1_mprddlctl;
|
||||
mmdc1->mpwrdlctl = calib->p1_mpwrdlctl;
|
||||
MMDC1(mpwldectrl0, calib->p1_mpwldectrl0);
|
||||
MMDC1(mpwldectrl1, calib->p1_mpwldectrl1);
|
||||
MMDC1(mpdgctrl0, calib->p1_mpdgctrl0);
|
||||
MMDC1(mpdgctrl1, calib->p1_mpdgctrl1);
|
||||
MMDC1(mprddlctl, calib->p1_mprddlctl);
|
||||
MMDC1(mpwrdlctl, calib->p1_mpwrdlctl);
|
||||
}
|
||||
|
||||
/* Read data DQ Byte0-3 delay */
|
||||
|
@ -379,23 +447,23 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
|||
}
|
||||
|
||||
if (sysinfo->dsize > 1) {
|
||||
mmdc1->mprddqby0dl = 0x33333333;
|
||||
mmdc1->mprddqby1dl = 0x33333333;
|
||||
mmdc1->mprddqby2dl = 0x33333333;
|
||||
mmdc1->mprddqby3dl = 0x33333333;
|
||||
MMDC1(mprddqby0dl, 0x33333333);
|
||||
MMDC1(mprddqby1dl, 0x33333333);
|
||||
MMDC1(mprddqby2dl, 0x33333333);
|
||||
MMDC1(mprddqby3dl, 0x33333333);
|
||||
}
|
||||
|
||||
/* MMDC Termination: rtt_nom:2 RZQ/2(120ohm), rtt_nom:1 RZQ/4(60ohm) */
|
||||
val = (sysinfo->rtt_nom == 2) ? 0x00011117 : 0x00022227;
|
||||
mmdc0->mpodtctrl = val;
|
||||
if (sysinfo->dsize > 1)
|
||||
mmdc1->mpodtctrl = val;
|
||||
MMDC1(mpodtctrl, val);
|
||||
|
||||
/* complete calibration */
|
||||
val = (1 << 11); /* Force measurement on delay-lines */
|
||||
mmdc0->mpmur0 = val;
|
||||
if (sysinfo->dsize > 1)
|
||||
mmdc1->mpmur0 = val;
|
||||
MMDC1(mpmur0, val);
|
||||
|
||||
/* Step 1: configuration request */
|
||||
mmdc0->mdscr = (u32)(1 << 15); /* config request */
|
||||
|
@ -435,7 +503,7 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
|||
val = 0xa1390001; /* one-time HW ZQ calib */
|
||||
mmdc0->mpzqhwctrl = val;
|
||||
if (sysinfo->dsize > 1)
|
||||
mmdc1->mpzqhwctrl = val;
|
||||
MMDC1(mpzqhwctrl, val);
|
||||
|
||||
/* Step 7: Enable MMDC with desired chip select */
|
||||
mmdc0->mdctl |= (1 << 31) | /* SDE_0 for CS0 */
|
||||
|
@ -477,7 +545,7 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
|
|||
val = 0xa1390003;
|
||||
mmdc0->mpzqhwctrl = val;
|
||||
if (sysinfo->dsize > 1)
|
||||
mmdc1->mpzqhwctrl = val;
|
||||
MMDC1(mpzqhwctrl, val);
|
||||
|
||||
/* Step 12: Configure and activate periodic refresh */
|
||||
mmdc0->mdref = (1 << 14) | /* REF_SEL: Periodic refresh cycle: 32kHz */
|
||||
|
|
|
@ -109,7 +109,7 @@ void init_aips(void)
|
|||
aips1 = (struct aipstz_regs *)AIPS1_BASE_ADDR;
|
||||
aips2 = (struct aipstz_regs *)AIPS2_BASE_ADDR;
|
||||
#ifdef CONFIG_MX6SX
|
||||
aips3 = (struct aipstz_regs *)AIPS3_BASE_ADDR;
|
||||
aips3 = (struct aipstz_regs *)AIPS3_CONFIG_BASE_ADDR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -437,12 +437,15 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
|
|||
{
|
||||
u32 offset_code;
|
||||
u32 offset = volt_mv;
|
||||
#ifndef CONFIG_DRA7XX
|
||||
int ret = 0;
|
||||
#endif
|
||||
|
||||
if (!volt_mv)
|
||||
return;
|
||||
|
||||
pmic->pmic_bus_init();
|
||||
#ifndef CONFIG_DRA7XX
|
||||
/* See if we can first get the GPIO if needed */
|
||||
if (pmic->gpio_en)
|
||||
ret = gpio_request(pmic->gpio, "PMIC_GPIO");
|
||||
|
@ -456,7 +459,7 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
|
|||
/* Pull the GPIO low to select SET0 register, while we program SET1 */
|
||||
if (pmic->gpio_en)
|
||||
gpio_direction_output(pmic->gpio, 0);
|
||||
|
||||
#endif
|
||||
/* convert to uV for better accuracy in the calculations */
|
||||
offset *= 1000;
|
||||
|
||||
|
@ -467,9 +470,10 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
|
|||
|
||||
if (pmic->pmic_write(pmic->i2c_slave_addr, vcore_reg, offset_code))
|
||||
printf("Scaling voltage failed for 0x%x\n", vcore_reg);
|
||||
|
||||
#ifndef CONFIG_DRA7XX
|
||||
if (pmic->gpio_en)
|
||||
gpio_direction_output(pmic->gpio, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static u32 optimize_vcore_voltage(struct volts const *v)
|
||||
|
@ -505,13 +509,79 @@ static u32 optimize_vcore_voltage(struct volts const *v)
|
|||
}
|
||||
|
||||
/*
|
||||
* Setup the voltages for vdd_mpu, vdd_core, and vdd_iva
|
||||
* We set the maximum voltages allowed here because Smart-Reflex is not
|
||||
* enabled in bootloader. Voltage initialization in the kernel will set
|
||||
* these to the nominal values after enabling Smart-Reflex
|
||||
* Setup the voltages for the main SoC core power domains.
|
||||
* We start with the maximum voltages allowed here, as set in the corresponding
|
||||
* vcores_data struct, and then scale (usually down) to the fused values that
|
||||
* are retrieved from the SoC. The scaling happens only if the efuse.reg fields
|
||||
* are initialised.
|
||||
* Rail grouping is supported for the DRA7xx SoCs only, therefore the code is
|
||||
* compiled conditionally. Note that the new code writes the scaled (or zeroed)
|
||||
* values back to the vcores_data struct for eventual reuse. Zero values mean
|
||||
* that the corresponding rails are not controlled separately, and are not sent
|
||||
* to the PMIC.
|
||||
*/
|
||||
void scale_vcores(struct vcores_data const *vcores)
|
||||
{
|
||||
#if defined(CONFIG_DRA7XX)
|
||||
int i;
|
||||
struct volts *pv = (struct volts *)vcores;
|
||||
struct volts *px;
|
||||
|
||||
for (i=0; i<(sizeof(struct vcores_data)/sizeof(struct volts)); i++) {
|
||||
debug("%d -> ", pv->value);
|
||||
if (pv->value) {
|
||||
/* Handle non-empty members only */
|
||||
pv->value = optimize_vcore_voltage(pv);
|
||||
px = (struct volts *)vcores;
|
||||
while (px < pv) {
|
||||
/*
|
||||
* Scan already handled non-empty members to see
|
||||
* if we have a group and find the max voltage,
|
||||
* which is set to the first occurance of the
|
||||
* particular SMPS; the other group voltages are
|
||||
* zeroed.
|
||||
*/
|
||||
if (px->value) {
|
||||
if ((pv->pmic->i2c_slave_addr ==
|
||||
px->pmic->i2c_slave_addr) &&
|
||||
(pv->addr == px->addr)) {
|
||||
/* Same PMIC, same SMPS */
|
||||
if (pv->value > px->value)
|
||||
px->value = pv->value;
|
||||
|
||||
pv->value = 0;
|
||||
}
|
||||
}
|
||||
px++;
|
||||
}
|
||||
}
|
||||
debug("%d\n", pv->value);
|
||||
pv++;
|
||||
}
|
||||
|
||||
debug("cor: %d\n", vcores->core.value);
|
||||
do_scale_vcore(vcores->core.addr, vcores->core.value, vcores->core.pmic);
|
||||
debug("mpu: %d\n", vcores->mpu.value);
|
||||
do_scale_vcore(vcores->mpu.addr, vcores->mpu.value, vcores->mpu.pmic);
|
||||
/* Configure MPU ABB LDO after scale */
|
||||
abb_setup((*ctrl)->control_std_fuse_opp_vdd_mpu_2,
|
||||
(*ctrl)->control_wkup_ldovbb_mpu_voltage_ctrl,
|
||||
(*prcm)->prm_abbldo_mpu_setup,
|
||||
(*prcm)->prm_abbldo_mpu_ctrl,
|
||||
(*prcm)->prm_irqstatus_mpu_2,
|
||||
OMAP_ABB_MPU_TXDONE_MASK,
|
||||
OMAP_ABB_FAST_OPP);
|
||||
|
||||
/* The .mm member is not used for the DRA7xx */
|
||||
|
||||
debug("gpu: %d\n", vcores->gpu.value);
|
||||
do_scale_vcore(vcores->gpu.addr, vcores->gpu.value, vcores->gpu.pmic);
|
||||
debug("eve: %d\n", vcores->eve.value);
|
||||
do_scale_vcore(vcores->eve.addr, vcores->eve.value, vcores->eve.pmic);
|
||||
debug("iva: %d\n", vcores->iva.value);
|
||||
do_scale_vcore(vcores->iva.addr, vcores->iva.value, vcores->iva.pmic);
|
||||
/* Might need udelay(1000) here if debug is enabled to see all prints */
|
||||
#else
|
||||
u32 val;
|
||||
|
||||
val = optimize_vcore_voltage(&vcores->core);
|
||||
|
@ -540,6 +610,7 @@ void scale_vcores(struct vcores_data const *vcores)
|
|||
|
||||
val = optimize_vcore_voltage(&vcores->iva);
|
||||
do_scale_vcore(vcores->iva.addr, val, vcores->iva.pmic);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void enable_clock_domain(u32 const clkctrl_reg, u32 enable_mode)
|
||||
|
|
|
@ -252,6 +252,8 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
|
|||
{
|
||||
struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
|
||||
|
||||
writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl);
|
||||
writel(regs->sdram_config_init, &emif->emif_sdram_config);
|
||||
/*
|
||||
* Set SDRAM_CONFIG and PHY control registers to locked frequency
|
||||
* and RL =7. As the default values of the Mode Registers are not
|
||||
|
@ -265,7 +267,6 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
|
|||
writel(regs->sdram_tim2, &emif->emif_sdram_tim_2);
|
||||
writel(regs->sdram_tim3, &emif->emif_sdram_tim_3);
|
||||
|
||||
writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl);
|
||||
writel(regs->read_idle_ctrl, &emif->emif_read_idlectrl);
|
||||
|
||||
/*
|
||||
|
@ -274,6 +275,7 @@ static void ddr3_init(u32 base, const struct emif_regs *regs)
|
|||
*/
|
||||
if (is_dra7xx()) {
|
||||
do_ext_phy_settings(base, regs);
|
||||
writel(regs->ref_ctrl_final, &emif->emif_sdram_ref_ctrl);
|
||||
writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config);
|
||||
writel(regs->sdram_config_init, &emif->emif_sdram_config);
|
||||
} else {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
ENTRY(save_boot_params)
|
||||
ldr r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
|
||||
str r0, [r1]
|
||||
bx lr
|
||||
b save_boot_params_ret
|
||||
ENDPROC(save_boot_params)
|
||||
|
||||
ENTRY(set_pl310_ctrl_reg)
|
||||
|
|
|
@ -93,6 +93,21 @@ config TARGET_TWISTER
|
|||
|
||||
endchoice
|
||||
|
||||
config DM
|
||||
default y if !SPL_BUILD
|
||||
|
||||
config DM_GPIO
|
||||
default y if DM && !SPL_BUILD
|
||||
|
||||
config DM_SERIAL
|
||||
default y if DM && !SPL_BUILD
|
||||
|
||||
config SYS_MALLOC_F
|
||||
default y if DM && !SPL_BUILD
|
||||
|
||||
config SYS_MALLOC_F_LEN
|
||||
default 0x400 if DM && !SPL_BUILD
|
||||
|
||||
config SYS_SOC
|
||||
default "omap3"
|
||||
|
||||
|
|
|
@ -732,11 +732,20 @@ void per_clocks_enable(void)
|
|||
setbits_le32(&prcm_base->iclken_per, 0x08); /* ICKen GPT2 */
|
||||
setbits_le32(&prcm_base->fclken_per, 0x08); /* FCKen GPT2 */
|
||||
|
||||
/* Enable GP9 timer. */
|
||||
setbits_le32(&prcm_base->clksel_per, 0x80); /* GPT9 = 32kHz clk */
|
||||
setbits_le32(&prcm_base->iclken_per, 0x400); /* ICKen GPT9 */
|
||||
setbits_le32(&prcm_base->fclken_per, 0x400); /* FCKen GPT9 */
|
||||
|
||||
#ifdef CONFIG_SYS_NS16550
|
||||
/* Enable UART1 clocks */
|
||||
setbits_le32(&prcm_base->fclken1_core, 0x00002000);
|
||||
setbits_le32(&prcm_base->iclken1_core, 0x00002000);
|
||||
|
||||
/* Enable UART2 clocks */
|
||||
setbits_le32(&prcm_base->fclken1_core, 0x00004000);
|
||||
setbits_le32(&prcm_base->iclken1_core, 0x00004000);
|
||||
|
||||
/* UART 3 Clocks */
|
||||
setbits_le32(&prcm_base->fclken_per, 0x00000800);
|
||||
setbits_le32(&prcm_base->iclken_per, 0x00000800);
|
||||
|
|
|
@ -23,7 +23,7 @@ ENTRY(save_boot_params)
|
|||
ldr r5, [r0, #0x4]
|
||||
and r5, r5, #0xff
|
||||
str r5, [r4]
|
||||
bx lr
|
||||
b save_boot_params_ret
|
||||
ENDPROC(save_boot_params)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -135,6 +135,9 @@ void do_sdrc_init(u32 cs, u32 early)
|
|||
sdrc_actim_base0 = (struct sdrc_actim *)SDRC_ACTIM_CTRL0_BASE;
|
||||
sdrc_actim_base1 = (struct sdrc_actim *)SDRC_ACTIM_CTRL1_BASE;
|
||||
|
||||
/* set some default timings */
|
||||
timings.sharing = SDRC_SHARING;
|
||||
|
||||
/*
|
||||
* When called in the early context this may be SPL and we will
|
||||
* need to set all of the timings. This ends up being board
|
||||
|
@ -145,6 +148,7 @@ void do_sdrc_init(u32 cs, u32 early)
|
|||
* setup CS1.
|
||||
*/
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
/* set/modify board-specific timings */
|
||||
get_board_mem_timings(&timings);
|
||||
#endif
|
||||
if (early) {
|
||||
|
@ -155,7 +159,7 @@ void do_sdrc_init(u32 cs, u32 early)
|
|||
writel(0, &sdrc_base->sysconfig);
|
||||
|
||||
/* setup sdrc to ball mux */
|
||||
writel(SDRC_SHARING, &sdrc_base->sharing);
|
||||
writel(timings.sharing, &sdrc_base->sharing);
|
||||
|
||||
/* Disable Power Down of CKE because of 1 CKE on combo part */
|
||||
writel(WAKEUPPROC | SRFRONRESET | PAGEPOLICY_HIGH,
|
||||
|
|
|
@ -320,6 +320,7 @@ struct pmic_data palmas = {
|
|||
.pmic_write = omap_vc_bypass_send_value,
|
||||
};
|
||||
|
||||
/* The TPS659038 and TPS65917 are software-compatible, use common struct */
|
||||
struct pmic_data tps659038 = {
|
||||
.base_offset = PALMAS_SMPS_BASE_VOLT_UV,
|
||||
.step = 10000, /* 10 mV represented in uV */
|
||||
|
@ -394,34 +395,38 @@ struct vcores_data dra752_volts = {
|
|||
};
|
||||
|
||||
struct vcores_data dra722_volts = {
|
||||
.mpu.value = 1000,
|
||||
.mpu.value = VDD_MPU_DRA72x,
|
||||
.mpu.efuse.reg = STD_FUSE_OPP_VMIN_MPU_NOM,
|
||||
.mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.mpu.addr = 0x23,
|
||||
.mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.mpu.addr = TPS65917_REG_ADDR_SMPS1,
|
||||
.mpu.pmic = &tps659038,
|
||||
|
||||
.eve.value = 1000,
|
||||
.eve.efuse.reg = STD_FUSE_OPP_VMIN_DSPEVE_NOM,
|
||||
.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.eve.addr = 0x2f,
|
||||
.eve.pmic = &tps659038,
|
||||
|
||||
.gpu.value = 1000,
|
||||
.gpu.efuse.reg = STD_FUSE_OPP_VMIN_GPU_NOM,
|
||||
.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.gpu.addr = 0x2f,
|
||||
.gpu.pmic = &tps659038,
|
||||
|
||||
.core.value = 1000,
|
||||
.core.value = VDD_CORE_DRA72x,
|
||||
.core.efuse.reg = STD_FUSE_OPP_VMIN_CORE_NOM,
|
||||
.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.core.addr = 0x27,
|
||||
.core.addr = TPS65917_REG_ADDR_SMPS2,
|
||||
.core.pmic = &tps659038,
|
||||
|
||||
.iva.value = 1000,
|
||||
/*
|
||||
* The DSPEVE, GPU and IVA rails are usually grouped on DRA72x
|
||||
* designs and powered by TPS65917 SMPS3, as on the J6Eco EVM.
|
||||
*/
|
||||
.gpu.value = VDD_GPU_DRA72x,
|
||||
.gpu.efuse.reg = STD_FUSE_OPP_VMIN_GPU_NOM,
|
||||
.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.gpu.addr = TPS65917_REG_ADDR_SMPS3,
|
||||
.gpu.pmic = &tps659038,
|
||||
|
||||
.eve.value = VDD_EVE_DRA72x,
|
||||
.eve.efuse.reg = STD_FUSE_OPP_VMIN_DSPEVE_NOM,
|
||||
.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.eve.addr = TPS65917_REG_ADDR_SMPS3,
|
||||
.eve.pmic = &tps659038,
|
||||
|
||||
.iva.value = VDD_IVA_DRA72x,
|
||||
.iva.efuse.reg = STD_FUSE_OPP_VMIN_IVA_NOM,
|
||||
.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.iva.addr = 0x2f,
|
||||
.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
|
||||
.iva.addr = TPS65917_REG_ADDR_SMPS3,
|
||||
.iva.pmic = &tps659038,
|
||||
};
|
||||
|
||||
|
|
|
@ -141,7 +141,8 @@ const struct emif_regs emif_1_regs_ddr3_532_mhz_1cs_dra_es1 = {
|
|||
.sdram_config_init = 0x61851ab2,
|
||||
.sdram_config = 0x61851ab2,
|
||||
.sdram_config2 = 0x08000000,
|
||||
.ref_ctrl = 0x00001035,
|
||||
.ref_ctrl = 0x000040F1,
|
||||
.ref_ctrl_final = 0x00001035,
|
||||
.sdram_tim1 = 0xCCCF36B3,
|
||||
.sdram_tim2 = 0x308F7FDA,
|
||||
.sdram_tim3 = 0x027F88A8,
|
||||
|
@ -151,10 +152,10 @@ const struct emif_regs emif_1_regs_ddr3_532_mhz_1cs_dra_es1 = {
|
|||
.emif_ddr_phy_ctlr_1_init = 0x0E24400A,
|
||||
.emif_ddr_phy_ctlr_1 = 0x0E24400A,
|
||||
.emif_ddr_ext_phy_ctrl_1 = 0x10040100,
|
||||
.emif_ddr_ext_phy_ctrl_2 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_3 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_4 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_5 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_2 = 0x00910091,
|
||||
.emif_ddr_ext_phy_ctrl_3 = 0x00950095,
|
||||
.emif_ddr_ext_phy_ctrl_4 = 0x009B009B,
|
||||
.emif_ddr_ext_phy_ctrl_5 = 0x009E009E,
|
||||
.emif_rd_wr_lvl_rmp_win = 0x00000000,
|
||||
.emif_rd_wr_lvl_rmp_ctl = 0x00000000,
|
||||
.emif_rd_wr_lvl_ctl = 0x00000000,
|
||||
|
@ -165,7 +166,8 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
|
|||
.sdram_config_init = 0x61851B32,
|
||||
.sdram_config = 0x61851B32,
|
||||
.sdram_config2 = 0x08000000,
|
||||
.ref_ctrl = 0x00001035,
|
||||
.ref_ctrl = 0x000040F1,
|
||||
.ref_ctrl_final = 0x00001035,
|
||||
.sdram_tim1 = 0xCCCF36B3,
|
||||
.sdram_tim2 = 0x308F7FDA,
|
||||
.sdram_tim3 = 0x027F88A8,
|
||||
|
@ -175,10 +177,10 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
|
|||
.emif_ddr_phy_ctlr_1_init = 0x0E24400A,
|
||||
.emif_ddr_phy_ctlr_1 = 0x0E24400A,
|
||||
.emif_ddr_ext_phy_ctrl_1 = 0x10040100,
|
||||
.emif_ddr_ext_phy_ctrl_2 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_3 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_4 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_5 = 0x00BB00BB,
|
||||
.emif_ddr_ext_phy_ctrl_2 = 0x00910091,
|
||||
.emif_ddr_ext_phy_ctrl_3 = 0x00950095,
|
||||
.emif_ddr_ext_phy_ctrl_4 = 0x009B009B,
|
||||
.emif_ddr_ext_phy_ctrl_5 = 0x009E009E,
|
||||
.emif_rd_wr_lvl_rmp_win = 0x00000000,
|
||||
.emif_rd_wr_lvl_rmp_ctl = 0x00000000,
|
||||
.emif_rd_wr_lvl_ctl = 0x00000000,
|
||||
|
@ -186,18 +188,19 @@ const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
|
|||
};
|
||||
|
||||
const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es1 = {
|
||||
.sdram_config_init = 0x61851AB2,
|
||||
.sdram_config = 0x61851AB2,
|
||||
.sdram_config_init = 0x61862B32,
|
||||
.sdram_config = 0x61862B32,
|
||||
.sdram_config2 = 0x08000000,
|
||||
.ref_ctrl = 0x00001035,
|
||||
.sdram_tim1 = 0xCCCF36B3,
|
||||
.sdram_tim2 = 0x308F7FDA,
|
||||
.sdram_tim3 = 0x027F88A8,
|
||||
.ref_ctrl = 0x0000493E,
|
||||
.ref_ctrl_final = 0x0000144A,
|
||||
.sdram_tim1 = 0xD113781C,
|
||||
.sdram_tim2 = 0x308F7FE3,
|
||||
.sdram_tim3 = 0x009F86A8,
|
||||
.read_idle_ctrl = 0x00050000,
|
||||
.zq_config = 0x0007190B,
|
||||
.temp_alert_config = 0x00000000,
|
||||
.emif_ddr_phy_ctlr_1_init = 0x0024400A,
|
||||
.emif_ddr_phy_ctlr_1 = 0x0024400A,
|
||||
.emif_ddr_phy_ctlr_1_init = 0x0E24400D,
|
||||
.emif_ddr_phy_ctlr_1 = 0x0E24400D,
|
||||
.emif_ddr_ext_phy_ctrl_1 = 0x10040100,
|
||||
.emif_ddr_ext_phy_ctrl_2 = 0x00A400A4,
|
||||
.emif_ddr_ext_phy_ctrl_3 = 0x00A900A9,
|
||||
|
@ -420,22 +423,22 @@ const u32 ddr3_ext_phy_ctrl_const_base_es2[] = {
|
|||
|
||||
const u32
|
||||
dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[] = {
|
||||
0x00BB00BB,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00980098,
|
||||
0x00340034,
|
||||
0x00350035,
|
||||
0x00340034,
|
||||
0x00310031,
|
||||
0x00340034,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00480048,
|
||||
0x004A004A,
|
||||
0x00520052,
|
||||
0x00550055,
|
||||
0x00500050,
|
||||
0x00000000,
|
||||
0x00600020,
|
||||
0x40010080,
|
||||
|
@ -449,22 +452,22 @@ dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[] = {
|
|||
|
||||
const u32
|
||||
dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[] = {
|
||||
0x00BB00BB,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00440044,
|
||||
0x00980098,
|
||||
0x00330033,
|
||||
0x00330033,
|
||||
0x002F002F,
|
||||
0x00320032,
|
||||
0x00310031,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x007F007F,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00600060,
|
||||
0x00520052,
|
||||
0x00520052,
|
||||
0x00470047,
|
||||
0x00490049,
|
||||
0x00500050,
|
||||
0x00000000,
|
||||
0x00600020,
|
||||
0x40010080,
|
||||
|
|
|
@ -21,6 +21,9 @@ config TARGET_KZM9G
|
|||
config TARGET_ALT
|
||||
bool "Alt board"
|
||||
|
||||
config TARGET_SILK
|
||||
bool "Silk board"
|
||||
|
||||
endchoice
|
||||
|
||||
config SYS_SOC
|
||||
|
@ -28,7 +31,7 @@ config SYS_SOC
|
|||
|
||||
config RMOBILE_EXTRAM_BOOT
|
||||
bool "Enable boot from RAM"
|
||||
depends on TARGET_ALT || TARGET_KOELSCH || TARGET_LAGER
|
||||
depends on TARGET_ALT || TARGET_KOELSCH || TARGET_LAGER || TARGET_SILK
|
||||
default n
|
||||
|
||||
source "board/atmark-techno/armadillo-800eva/Kconfig"
|
||||
|
@ -37,5 +40,6 @@ source "board/renesas/koelsch/Kconfig"
|
|||
source "board/renesas/lager/Kconfig"
|
||||
source "board/kmc/kzm9g/Kconfig"
|
||||
source "board/renesas/alt/Kconfig"
|
||||
source "board/renesas/silk/Kconfig"
|
||||
|
||||
endif
|
||||
|
|
|
@ -40,7 +40,7 @@ do_lowlevel_init:
|
|||
and r1, r1, #0x7F00
|
||||
lsrs r1, r1, #8
|
||||
cmp r1, #0x4C /* 0x4C is ID of r8a7794 */
|
||||
beq _exit_init_l2_a15
|
||||
beq _enable_actlr_smp
|
||||
|
||||
/* surpress wfe if ca15 */
|
||||
tst r4, #4
|
||||
|
@ -64,6 +64,16 @@ do_lowlevel_init:
|
|||
orrne r0, r0, #0x20 /* L2CTLR[5] */
|
||||
#endif
|
||||
mcrne p15, 1, r0, c9, c0, 2
|
||||
|
||||
b _exit_init_l2_a15
|
||||
|
||||
_enable_actlr_smp: /* R8A7794 only (CA7) */
|
||||
#ifndef CONFIG_DCACHE_OFF
|
||||
mrc p15, 0, r0, c1, c0, 1
|
||||
orr r0, r0, #0x40
|
||||
mcr p15, 0, r0, c1, c0, 1
|
||||
#endif
|
||||
|
||||
_exit_init_l2_a15:
|
||||
ldr r3, =(CONFIG_SYS_INIT_SP_ADDR)
|
||||
sub sp, r3, #4
|
||||
|
|
|
@ -31,9 +31,12 @@
|
|||
*************************************************************************/
|
||||
|
||||
.globl reset
|
||||
.globl save_boot_params_ret
|
||||
|
||||
reset:
|
||||
bl save_boot_params
|
||||
/* Allow the board to save important registers */
|
||||
b save_boot_params
|
||||
save_boot_params_ret:
|
||||
/*
|
||||
* disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode,
|
||||
* except if in HYP mode already
|
||||
|
@ -52,10 +55,10 @@ reset:
|
|||
* Continue to use ROM code vector only in OMAP4 spl)
|
||||
*/
|
||||
#if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD))
|
||||
/* Set V=0 in CP15 SCTRL register - for VBAR to point to vector */
|
||||
mrc p15, 0, r0, c1, c0, 0 @ Read CP15 SCTRL Register
|
||||
/* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
|
||||
mrc p15, 0, r0, c1, c0, 0 @ Read CP15 SCTLR Register
|
||||
bic r0, #CR_V @ V = 0
|
||||
mcr p15, 0, r0, c1, c0, 0 @ Write CP15 SCTRL Register
|
||||
mcr p15, 0, r0, c1, c0, 0 @ Write CP15 SCTLR Register
|
||||
|
||||
/* Set vector address in CP15 VBAR register */
|
||||
ldr r0, =_start
|
||||
|
@ -96,7 +99,7 @@ ENDPROC(c_runtime_cpu_setup)
|
|||
*
|
||||
*************************************************************************/
|
||||
ENTRY(save_boot_params)
|
||||
bx lr @ back to my caller
|
||||
b save_boot_params_ret @ back to my caller
|
||||
ENDPROC(save_boot_params)
|
||||
.weak save_boot_params
|
||||
|
||||
|
|
|
@ -11,12 +11,15 @@ obj-y += timer.o
|
|||
obj-y += board.o
|
||||
obj-y += clock.o
|
||||
obj-y += cpu_info.o
|
||||
obj-y += dram_helpers.o
|
||||
obj-y += pinmux.o
|
||||
obj-y += usbc.o
|
||||
obj-$(CONFIG_MACH_SUN6I) += prcm.o
|
||||
obj-$(CONFIG_MACH_SUN8I) += prcm.o
|
||||
obj-$(CONFIG_MACH_SUN9I) += prcm.o
|
||||
obj-$(CONFIG_MACH_SUN6I) += p2wi.o
|
||||
obj-$(CONFIG_MACH_SUN8I) += rsb.o
|
||||
obj-$(CONFIG_MACH_SUN9I) += rsb.o
|
||||
obj-$(CONFIG_MACH_SUN4I) += clock_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN5I) += clock_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN6I) += clock_sun6i.o
|
||||
|
@ -36,7 +39,5 @@ obj-$(CONFIG_MACH_SUN5I) += dram_sun4i.o
|
|||
obj-$(CONFIG_MACH_SUN6I) += dram_sun6i.o
|
||||
obj-$(CONFIG_MACH_SUN7I) += dram_sun4i.o
|
||||
obj-$(CONFIG_MACH_SUN8I) += dram_sun8i.o
|
||||
ifdef CONFIG_SPL_FEL
|
||||
obj-y += start.o
|
||||
endif
|
||||
obj-y += fel_utils.o
|
||||
endif
|
||||
|
|
|
@ -27,6 +27,17 @@
|
|||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
struct fel_stash {
|
||||
uint32_t sp;
|
||||
uint32_t lr;
|
||||
uint32_t cpsr;
|
||||
uint32_t sctlr;
|
||||
uint32_t vbar;
|
||||
uint32_t cr;
|
||||
};
|
||||
|
||||
struct fel_stash fel_stash __attribute__((section(".data")));
|
||||
|
||||
static int gpio_init(void)
|
||||
{
|
||||
#if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F)
|
||||
|
@ -65,6 +76,12 @@ static int gpio_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void spl_board_load_image(void)
|
||||
{
|
||||
debug("Returning to FEL sp=%x, lr=%x\n", fel_stash.sp, fel_stash.lr);
|
||||
return_to_fel(fel_stash.sp, fel_stash.lr);
|
||||
}
|
||||
|
||||
void s_init(void)
|
||||
{
|
||||
#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
|
||||
|
@ -95,7 +112,34 @@ void s_init(void)
|
|||
*/
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
return BOOT_DEVICE_MMC1;
|
||||
#ifdef CONFIG_SPL_FEL
|
||||
/*
|
||||
* This is the legacy compile time configuration for a special FEL
|
||||
* enabled build. It has many restrictions and can only boot over USB.
|
||||
*/
|
||||
return BOOT_DEVICE_BOARD;
|
||||
#else
|
||||
/*
|
||||
* When booting from the SD card, the "eGON.BT0" signature is expected
|
||||
* to be found in memory at the address 0x0004 (see the "mksunxiboot"
|
||||
* tool, which generates this header).
|
||||
*
|
||||
* When booting in the FEL mode over USB, this signature is patched in
|
||||
* memory and replaced with something else by the 'fel' tool. This other
|
||||
* signature is selected in such a way, that it can't be present in a
|
||||
* valid bootable SD card image (because the BROM would refuse to
|
||||
* execute the SPL in this case).
|
||||
*
|
||||
* This branch is just making a decision at runtime whether to load
|
||||
* the main u-boot binary from the SD card (if the "eGON.BT0" signature
|
||||
* is found) or return to the FEL code in the BROM to wait and receive
|
||||
* the main u-boot binary over USB.
|
||||
*/
|
||||
if (readl(4) == 0x4E4F4765 && readl(8) == 0x3054422E) /* eGON.BT0 */
|
||||
return BOOT_DEVICE_MMC1;
|
||||
else
|
||||
return BOOT_DEVICE_BOARD;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* No confirmation data available in SPL yet. Hardcode bootmode */
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# Build a combined spl + u-boot image
|
||||
ifdef CONFIG_SPL
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ifndef CONFIG_SPL_FEL
|
||||
ALL-y += u-boot-sunxi-with-spl.bin
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
|
37
arch/arm/cpu/armv7/sunxi/dram_helpers.c
Normal file
37
arch/arm/cpu/armv7/sunxi/dram_helpers.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* DRAM init helper functions
|
||||
*
|
||||
* (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/dram.h>
|
||||
|
||||
/*
|
||||
* Wait up to 1s for value to be set in given part of reg.
|
||||
*/
|
||||
void mctl_await_completion(u32 *reg, u32 mask, u32 val)
|
||||
{
|
||||
unsigned long tmo = timer_get_us() + 1000000;
|
||||
|
||||
while ((readl(reg) & mask) != val) {
|
||||
if (timer_get_us() > tmo)
|
||||
panic("Timeout initialising DRAM\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if memory at offset offset matches memory at begin of DRAM
|
||||
*/
|
||||
bool mctl_mem_matches(u32 offset)
|
||||
{
|
||||
/* Try to write different values to RAM at two addresses */
|
||||
writel(0, CONFIG_SYS_SDRAM_BASE);
|
||||
writel(0xaa55aa55, CONFIG_SYS_SDRAM_BASE + offset);
|
||||
/* Check if the same value is actually observed when reading back */
|
||||
return readl(CONFIG_SYS_SDRAM_BASE) ==
|
||||
readl(CONFIG_SYS_SDRAM_BASE + offset);
|
||||
}
|
42
arch/arm/cpu/armv7/sunxi/fel_utils.S
Normal file
42
arch/arm/cpu/armv7/sunxi/fel_utils.S
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Utility functions for FEL mode.
|
||||
*
|
||||
* Copyright (c) 2015 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <asm/system.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ENTRY(save_boot_params)
|
||||
ldr r0, =fel_stash
|
||||
str sp, [r0, #0]
|
||||
str lr, [r0, #4]
|
||||
mrs lr, cpsr @ Read CPSR
|
||||
str lr, [r0, #8]
|
||||
mrc p15, 0, lr, c1, c0, 0 @ Read CP15 SCTLR Register
|
||||
str lr, [r0, #12]
|
||||
mrc p15, 0, lr, c12, c0, 0 @ Read VBAR
|
||||
str lr, [r0, #16]
|
||||
mrc p15, 0, lr, c1, c0, 0 @ Read CP15 Control Register
|
||||
str lr, [r0, #20]
|
||||
b save_boot_params_ret
|
||||
ENDPROC(save_boot_params)
|
||||
|
||||
ENTRY(return_to_fel)
|
||||
mov sp, r0
|
||||
mov lr, r1
|
||||
ldr r0, =fel_stash
|
||||
ldr r1, [r0, #20]
|
||||
mcr p15, 0, r1, c1, c0, 0 @ Write CP15 Control Register
|
||||
ldr r1, [r0, #16]
|
||||
mcr p15, 0, r1, c12, c0, 0 @ Write VBAR
|
||||
ldr r1, [r0, #12]
|
||||
mcr p15, 0, r1, c1, c0, 0 @ Write CP15 SCTLR Register
|
||||
ldr r1, [r0, #8]
|
||||
msr cpsr, r1 @ Write CPSR
|
||||
bx lr
|
||||
ENDPROC(return_to_fel)
|
|
@ -16,14 +16,27 @@
|
|||
#include <asm/arch/prcm.h>
|
||||
#include <asm/arch/rsb.h>
|
||||
|
||||
static int rsb_set_device_mode(void);
|
||||
|
||||
static void rsb_cfg_io(void)
|
||||
{
|
||||
#ifdef CONFIG_MACH_SUN8I
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_GPL0_R_RSB_SCK);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_GPL1_R_RSB_SDA);
|
||||
sunxi_gpio_set_pull(SUNXI_GPL(0), 1);
|
||||
sunxi_gpio_set_pull(SUNXI_GPL(1), 1);
|
||||
sunxi_gpio_set_drv(SUNXI_GPL(0), 2);
|
||||
sunxi_gpio_set_drv(SUNXI_GPL(1), 2);
|
||||
#elif defined CONFIG_MACH_SUN9I
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPN(0), SUN9I_GPN0_R_RSB_SCK);
|
||||
sunxi_gpio_set_cfgpin(SUNXI_GPN(1), SUN9I_GPN1_R_RSB_SDA);
|
||||
sunxi_gpio_set_pull(SUNXI_GPN(0), 1);
|
||||
sunxi_gpio_set_pull(SUNXI_GPN(1), 1);
|
||||
sunxi_gpio_set_drv(SUNXI_GPN(0), 2);
|
||||
sunxi_gpio_set_drv(SUNXI_GPN(1), 2);
|
||||
#else
|
||||
#error unsupported MACH_SUNXI
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rsb_set_clk(void)
|
||||
|
@ -42,7 +55,7 @@ static void rsb_set_clk(void)
|
|||
writel((cd_odly << 8) | div, &rsb->ccr);
|
||||
}
|
||||
|
||||
void rsb_init(void)
|
||||
int rsb_init(void)
|
||||
{
|
||||
struct sunxi_rsb_reg * const rsb =
|
||||
(struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
|
||||
|
@ -54,6 +67,8 @@ void rsb_init(void)
|
|||
|
||||
writel(RSB_CTRL_SOFT_RST, &rsb->ctrl);
|
||||
rsb_set_clk();
|
||||
|
||||
return rsb_set_device_mode();
|
||||
}
|
||||
|
||||
static int rsb_await_trans(void)
|
||||
|
@ -88,13 +103,14 @@ static int rsb_await_trans(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int rsb_set_device_mode(u32 device_mode_data)
|
||||
static int rsb_set_device_mode(void)
|
||||
{
|
||||
struct sunxi_rsb_reg * const rsb =
|
||||
(struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
|
||||
unsigned long tmo = timer_get_us() + 1000000;
|
||||
|
||||
writel(RSB_DMCR_DEVICE_MODE_START | device_mode_data, &rsb->dmcr);
|
||||
writel(RSB_DMCR_DEVICE_MODE_START | RSB_DMCR_DEVICE_MODE_DATA,
|
||||
&rsb->dmcr);
|
||||
|
||||
while (readl(&rsb->dmcr) & RSB_DMCR_DEVICE_MODE_START) {
|
||||
if (timer_get_us() > tmo)
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2013
|
||||
* Henrik Nordstrom <henrik@henriknordstrom.net>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(s_init)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00002000;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
{
|
||||
*(.text.s_init)
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : {
|
||||
*(.data*)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.u_boot_list : {
|
||||
KEEP(*(SORT(.u_boot_list*)));
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
. = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
.rel.dyn : {
|
||||
__rel_dyn_start = .;
|
||||
*(.rel*)
|
||||
__rel_dyn_end = .;
|
||||
}
|
||||
|
||||
.dynsym : {
|
||||
__dynsym_start = .;
|
||||
*(.dynsym)
|
||||
}
|
||||
|
||||
. = ALIGN(4);
|
||||
.note.gnu.build-id :
|
||||
{
|
||||
*(.note.gnu.build-id)
|
||||
}
|
||||
_end = .;
|
||||
|
||||
. = ALIGN(4096);
|
||||
.mmutable : {
|
||||
*(.mmutable)
|
||||
}
|
||||
|
||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||
KEEP(*(.__bss_start));
|
||||
__bss_base = .;
|
||||
}
|
||||
|
||||
.bss __bss_base (OVERLAY) : {
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
__bss_limit = .;
|
||||
}
|
||||
|
||||
.bss_end __bss_limit (OVERLAY) : {
|
||||
KEEP(*(.__bss_end));
|
||||
}
|
||||
|
||||
/DISCARD/ : { *(.dynstr*) }
|
||||
/DISCARD/ : { *(.dynamic*) }
|
||||
/DISCARD/ : { *(.plt*) }
|
||||
/DISCARD/ : { *(.interp*) }
|
||||
/DISCARD/ : { *(.gnu*) }
|
||||
/DISCARD/ : { *(.note*) }
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
if TEGRA
|
||||
|
||||
choice
|
||||
prompt "Tegra SoC select"
|
||||
|
||||
config TEGRA20
|
||||
bool "Tegra20 family"
|
||||
|
||||
config TEGRA30
|
||||
bool "Tegra30 family"
|
||||
|
||||
config TEGRA114
|
||||
bool "Tegra114 family"
|
||||
|
||||
config TEGRA124
|
||||
bool "Tegra124 family"
|
||||
|
||||
endchoice
|
||||
|
||||
config USE_PRIVATE_LIBGCC
|
||||
default y if SPL_BUILD
|
||||
|
||||
source "arch/arm/cpu/armv7/tegra20/Kconfig"
|
||||
source "arch/arm/cpu/armv7/tegra30/Kconfig"
|
||||
source "arch/arm/cpu/armv7/tegra114/Kconfig"
|
||||
source "arch/arm/cpu/armv7/tegra124/Kconfig"
|
||||
|
||||
endif
|
|
@ -1,10 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2010,2011 Nvidia Corporation.
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_CMD_ENTERRCM) += cmd_enterrcm.o
|
|
@ -1,11 +0,0 @@
|
|||
#
|
||||
# (C) Copyright 2010,2011 Nvidia Corporation.
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_PWM_TEGRA) += pwm.o
|
||||
obj-$(CONFIG_VIDEO_TEGRA) += display.o
|
|
@ -48,23 +48,20 @@ config DCC_MICRO_SUPPORT_CARD
|
|||
|
||||
endchoice
|
||||
|
||||
config SYS_MALLOC_F
|
||||
default y
|
||||
|
||||
config SYS_MALLOC_F_LEN
|
||||
default 0x2000
|
||||
|
||||
config CMD_PINMON
|
||||
bool "Enable boot mode pins monitor command"
|
||||
depends on !SPL_BUILD
|
||||
default y
|
||||
help
|
||||
The command "pinmon" shows the state of the boot mode pins.
|
||||
The boot mode pins are latched when the system reset is deasserted
|
||||
and determine which device the system should load a boot image from.
|
||||
|
||||
config SOC_INIT
|
||||
bool
|
||||
default SPL_BUILD
|
||||
|
||||
config DRAM_INIT
|
||||
bool
|
||||
default SPL_BUILD
|
||||
|
||||
config CMD_DDRPHY_DUMP
|
||||
bool "Enable dump command of DDR PHY parameters"
|
||||
depends on !SPL_BUILD
|
||||
|
@ -74,7 +71,7 @@ config CMD_DDRPHY_DUMP
|
|||
|
||||
choice
|
||||
prompt "DDR3 Frequency select"
|
||||
depends on DRAM_INIT
|
||||
depends on SPL_BUILD
|
||||
|
||||
config DDR_FREQ_1600
|
||||
bool "DDR3 1600"
|
||||
|
|
|
@ -2,23 +2,32 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_SPL_BUILD) += lowlevel_init.o init_page_table.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
|
||||
obj-y += timer.o
|
||||
obj-y += reset.o
|
||||
obj-y += cache_uniphier.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o
|
||||
obj-y += dram_init.o
|
||||
obj-$(CONFIG_DRAM_INIT) += ddrphy_training.o
|
||||
obj-y += lowlevel_init.o
|
||||
obj-y += init_page_table.o
|
||||
obj-y += spl.o
|
||||
obj-y += ddrphy_training.o
|
||||
|
||||
else
|
||||
|
||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += board_early_init_f.o
|
||||
obj-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o
|
||||
obj-$(CONFIG_MISC_INIT_F) += print_misc_info.o
|
||||
obj-y += dram_init.o
|
||||
obj-y += board_common.o
|
||||
obj-$(CONFIG_BOARD_EARLY_INIT_R) += board_early_init_r.o
|
||||
obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o
|
||||
obj-y += reset.o
|
||||
obj-y += cache_uniphier.o
|
||||
obj-$(CONFIG_UNIPHIER_SMP) += smp.o
|
||||
obj-$(CONFIG_CMD_PINMON) += cmd_pinmon.o
|
||||
obj-$(CONFIG_CMD_DDRPHY_DUMP) += cmd_ddrphy.o
|
||||
|
||||
obj-y += board_common.o
|
||||
endif
|
||||
|
||||
obj-y += timer.o
|
||||
|
||||
obj-$(CONFIG_PFC_MICRO_SUPPORT_CARD) += support_card.o
|
||||
obj-$(CONFIG_DCC_MICRO_SUPPORT_CARD) += support_card.o
|
||||
|
||||
|
|
22
arch/arm/cpu/armv7/uniphier/board_early_init_f.c
Normal file
22
arch/arm/cpu/armv7/uniphier/board_early_init_f.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2015 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void pin_init(void);
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
led_write(U, 0, , );
|
||||
|
||||
pin_init();
|
||||
|
||||
led_write(U, 1, , );
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void __weak 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)
|
||||
{
|
||||
#ifdef CONFIG_SOC_INIT
|
||||
bcu_init();
|
||||
|
||||
sbc_init();
|
||||
|
||||
sg_init();
|
||||
|
||||
uniphier_board_reset();
|
||||
|
||||
pll_init();
|
||||
|
||||
uniphier_board_init();
|
||||
|
||||
led_write(B, 1, , );
|
||||
|
||||
clkrst_init();
|
||||
|
||||
led_write(B, 2, , );
|
||||
#endif
|
||||
pin_init();
|
||||
|
||||
led_write(B, 3, , );
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -11,20 +11,17 @@
|
|||
|
||||
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();
|
||||
int mode_sel, i;
|
||||
|
||||
printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF");
|
||||
|
||||
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++;
|
||||
}
|
||||
for (i = 0; boot_device_table[i].info; i++)
|
||||
printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i,
|
||||
boot_device_table[i].info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,37 +1,16 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Copyright (C) 2012-2015 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;
|
||||
|
||||
#ifdef CONFIG_DRAM_INIT
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
obj-y += boot-mode.o
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
|
||||
obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
|
||||
clkrst_init.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o
|
||||
obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
obj-y += bcu_init.o sbc_init.o sg_init.o pll_init.o clkrst_init.o \
|
||||
pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
else
|
||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
endif
|
||||
|
||||
obj-y += boot-mode.o
|
||||
|
|
|
@ -2,10 +2,13 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
obj-y += boot-mode.o
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
|
||||
obj-$(CONFIG_SOC_INIT) += sbc_init.o sg_init.o pll_init.o clkrst_init.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o
|
||||
obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
obj-y += sbc_init.o sg_init.o pll_init.o clkrst_init.o \
|
||||
pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
else
|
||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
endif
|
||||
|
||||
obj-y += boot-mode.o
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* 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();
|
||||
}
|
|
@ -45,17 +45,17 @@ struct boot_device_info boot_device_table[] = {
|
|||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, "Reserved"},
|
||||
{BOOT_DEVICE_NONE, ""}
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
u32 get_boot_mode_sel(void)
|
||||
int get_boot_mode_sel(void)
|
||||
{
|
||||
return (readl(SG_PINMON0) >> 1) & 0x1f;
|
||||
}
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
u32 boot_mode;
|
||||
int boot_mode;
|
||||
|
||||
if (boot_is_swapped())
|
||||
return BOOT_DEVICE_NOR;
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
obj-y += boot-mode.o
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-$(CONFIG_DEBUG_LL) += lowlevel_debug.o
|
||||
obj-$(CONFIG_SOC_INIT) += bcu_init.o sbc_init.o sg_init.o pll_init.o \
|
||||
clkrst_init.o
|
||||
obj-$(CONFIG_BOARD_POSTCLK_INIT) += pinctrl.o
|
||||
obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
obj-y += bcu_init.o sbc_init.o sg_init.o pll_init.o clkrst_init.o \
|
||||
pll_spectrum.o umc_init.o ddrphy_init.o
|
||||
else
|
||||
obj-$(CONFIG_BOARD_EARLY_INIT_F) += pinctrl.o
|
||||
obj-$(if $(CONFIG_OF_CONTROL),,y) += platdevice.o
|
||||
endif
|
||||
|
||||
obj-y += boot-mode.o
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* 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();
|
||||
}
|
|
@ -26,6 +26,15 @@ void pin_init(void)
|
|||
sg_set_pinsel(111, 1); /* SBI0 -> RXD3 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_I2C_UNIPHIER
|
||||
{
|
||||
u32 tmp;
|
||||
tmp = readl(SG_IECTRL);
|
||||
tmp |= 0xc00; /* enable SCL0, SDA0, SCL1, SDA1 */
|
||||
writel(tmp, SG_IECTRL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NAND_DENALI
|
||||
sg_set_pinsel(15, 0); /* XNFRE_GB -> XNFRE_GB */
|
||||
sg_set_pinsel(16, 0); /* XNFWE_GB -> XNFWE_GB */
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2014 Panasonic Corporation
|
||||
* Copyright (C) 2015 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)
|
||||
int misc_init_f(void)
|
||||
{
|
||||
puts("Board: PH1-LD4 Board\n");
|
||||
|
||||
return check_support_card();
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2014 Panasonic Corporation
|
||||
* Copyright (C) 2013-2015 Panasonic Corporation
|
||||
* Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
|
@ -7,11 +7,53 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <spl.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/arch/led.h>
|
||||
#include <asm/arch/board.h>
|
||||
|
||||
void __weak bcu_init(void)
|
||||
{
|
||||
};
|
||||
void sbc_init(void);
|
||||
void sg_init(void);
|
||||
void pll_init(void);
|
||||
void pin_init(void);
|
||||
void clkrst_init(void);
|
||||
int umc_init(void);
|
||||
void enable_dpll_ssc(void);
|
||||
|
||||
void spl_board_init(void)
|
||||
{
|
||||
#if defined(CONFIG_BOARD_POSTCLK_INIT)
|
||||
board_postclk_init();
|
||||
#endif
|
||||
dram_init();
|
||||
bcu_init();
|
||||
|
||||
sbc_init();
|
||||
|
||||
sg_init();
|
||||
|
||||
uniphier_board_reset();
|
||||
|
||||
pll_init();
|
||||
|
||||
uniphier_board_init();
|
||||
|
||||
led_write(L, 0, , );
|
||||
|
||||
clkrst_init();
|
||||
|
||||
led_write(L, 1, , );
|
||||
|
||||
{
|
||||
int res;
|
||||
|
||||
res = umc_init();
|
||||
if (res < 0) {
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
}
|
||||
led_write(L, 2, , );
|
||||
|
||||
enable_dpll_ssc();
|
||||
|
||||
led_write(L, 3, , );
|
||||
}
|
||||
|
|
|
@ -51,56 +51,64 @@
|
|||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <0 0 0>;
|
||||
reg = <0x13860000 0x100>;
|
||||
interrupts = <0 56 0>;
|
||||
};
|
||||
|
||||
i2c@13870000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <1 1 0>;
|
||||
reg = <0x13870000 0x100>;
|
||||
interrupts = <1 57 0>;
|
||||
};
|
||||
|
||||
i2c@13880000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <2 2 0>;
|
||||
reg = <0x13880000 0x100>;
|
||||
interrupts = <2 58 0>;
|
||||
};
|
||||
|
||||
i2c@13890000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <3 3 0>;
|
||||
reg = <0x13890000 0x100>;
|
||||
interrupts = <3 59 0>;
|
||||
};
|
||||
|
||||
i2c@138a0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <4 4 0>;
|
||||
reg = <0x138a0000 0x100>;
|
||||
interrupts = <4 60 0>;
|
||||
};
|
||||
|
||||
i2c@138b0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <5 5 0>;
|
||||
reg = <0x138b0000 0x100>;
|
||||
interrupts = <5 61 0>;
|
||||
};
|
||||
|
||||
i2c@138c0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <6 6 0>;
|
||||
reg = <0x138c0000 0x100>;
|
||||
interrupts = <6 62 0>;
|
||||
};
|
||||
|
||||
i2c@138d0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <7 7 0>;
|
||||
reg = <0x138d0000 0x100>;
|
||||
interrupts = <7 63 0>;
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
|
@ -143,11 +151,4 @@
|
|||
interrupts = <0 131 0>;
|
||||
};
|
||||
|
||||
gpio: gpio {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0xA2 0>;
|
||||
cd-gpios = <&gpk2 2 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 146 0>;
|
||||
pwr-gpios = <&gpk0 2 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
|
@ -111,7 +111,7 @@
|
|||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 284 0>;
|
||||
cd-gpios = <&gpx3 4 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 146 0>;
|
||||
pwr-gpios = <&gpk0 2 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
|
@ -34,7 +34,7 @@
|
|||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 284 0>;
|
||||
cd-gpios = <&gpx3 4 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
@ -43,10 +43,10 @@
|
|||
|
||||
soft-spi {
|
||||
compatible = "u-boot,soft-spi";
|
||||
cs-gpio = <&gpio 235 0>; /* Y43 */
|
||||
sclk-gpio = <&gpio 225 0>; /* Y31 */
|
||||
mosi-gpio = <&gpio 227 0>; /* Y33 */
|
||||
miso-gpio = <&gpio 224 0>; /* Y30 */
|
||||
cs-gpio = <&gpy4 3 0>;
|
||||
sclk-gpio = <&gpy3 1 0>;
|
||||
mosi-gpio = <&gpy3 3 0>;
|
||||
miso-gpio = <&gpy3 0 0>;
|
||||
spi-delay-us = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
|
||||
aliases {
|
||||
i2c0 = "/i2c@13860000";
|
||||
i2c1 = "/i2c@13870000";
|
||||
i2c2 = "/i2c@13880000";
|
||||
i2c3 = "/i2c@13890000";
|
||||
i2c4 = "/i2c@138a0000";
|
||||
i2c5 = "/i2c@138b0000";
|
||||
i2c6 = "/i2c@138c0000";
|
||||
i2c7 = "/i2c@138d0000";
|
||||
serial0 = "/serial@13800000";
|
||||
console = "/serial@13810000";
|
||||
mmc2 = "sdhci@12530000";
|
||||
|
@ -51,7 +58,7 @@
|
|||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 122 0>;
|
||||
cd-gpios = <&gpk2 2 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
@ -78,4 +85,9 @@
|
|||
reg = <0x125B0000 0x100>;
|
||||
};
|
||||
};
|
||||
|
||||
emmc-reset {
|
||||
compatible = "samsung,emmc-reset";
|
||||
reset-gpio = <&gpk1 2 0>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -416,7 +416,7 @@
|
|||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x6a 0>;
|
||||
pwr-gpios = <&gpk0 4 0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
@ -427,7 +427,7 @@
|
|||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x7a 0>;
|
||||
cd-gpios = <&gpk2 2 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
|
@ -437,7 +437,7 @@
|
|||
dwmmc@12550000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <2 1 0>;
|
||||
pwr-gpios = <&gpio 0x6a 0>;
|
||||
pwr-gpios = <&gpk0 4 0>;
|
||||
fifoth_val = <0x203f0040>;
|
||||
bus_hz = <400000000>;
|
||||
div = <0x3>;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
/ {
|
||||
compatible = "samsung,exynos5";
|
||||
|
@ -247,7 +248,4 @@
|
|||
u-boot,dm-pre-reloc;
|
||||
id = <3>;
|
||||
};
|
||||
|
||||
gpio: gpio {
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,6 +15,14 @@
|
|||
compatible = "samsung,arndale", "samsung,exynos5250";
|
||||
|
||||
aliases {
|
||||
i2c0 = "/i2c@12c60000";
|
||||
i2c1 = "/i2c@12c70000";
|
||||
i2c2 = "/i2c@12c80000";
|
||||
i2c3 = "/i2c@12c90000";
|
||||
i2c4 = "/i2c@12ca0000";
|
||||
i2c5 = "/i2c@12cb0000";
|
||||
i2c6 = "/i2c@12cc0000";
|
||||
i2c7 = "/i2c@12cd0000";
|
||||
serial0 = "/serial@12C20000";
|
||||
console = "/serial@12C20000";
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue