Compare commits
196 Commits
v2014.04-r
...
v2014.04
| Author | SHA1 | Date | |
|---|---|---|---|
| dda0dbfc69 | |||
| fc56da0b2f | |||
| 7a65768903 | |||
| 1b82491ee6 | |||
| 2347534450 | |||
| 1ea2301fcf | |||
| 24542528fe | |||
| 395e60cdc2 | |||
| 519fdde9e6 | |||
| c71645ad2b | |||
| 91290cf728 | |||
| 42ddfad6ab | |||
| 88590148fa | |||
| 0883b0b58e | |||
| 6c81a93db7 | |||
| c7098965e3 | |||
| 25839c0197 | |||
| 42f5e8a25a | |||
| 284bb60ed6 | |||
| 68659d649d | |||
| b7588e3bdc | |||
| f71cbfe3ca | |||
| 1e6ad55c05 | |||
| 83571bcab1 | |||
| f5222cfd49 | |||
| 2c67e0e7cf | |||
| ddfeb0aaf4 | |||
| 04d2f0a9f3 | |||
| 1a9df13d5b | |||
| 1cad23c5f4 | |||
| 5dd73bc0a4 | |||
| aafd2c5ddb | |||
| 39206382de | |||
| 89c8230dec | |||
| 4e4815feae | |||
| d718ded056 | |||
| a96a0e6153 | |||
| 3f62971162 | |||
| 00b132bf34 | |||
| 1336e2d343 | |||
| 8a573022c3 | |||
| fb823981c5 | |||
| 33ace362fd | |||
| 74c32ef58d | |||
| cd2bf4846c | |||
| fa9c021632 | |||
| e64348f5eb | |||
| bb2637be09 | |||
| da0c5748a3 | |||
| 9926eb31b7 | |||
| 65ed5e8572 | |||
| c494eaf409 | |||
| 97334c6616 | |||
| 2f844e76da | |||
| 31c832f93c | |||
| f79a023f41 | |||
| e919aa23ef | |||
| a778aeae05 | |||
| ed2f0e1ffa | |||
| 3e94380b75 | |||
| 2bbcccf552 | |||
| 53e6b14e03 | |||
| 9c2c8a3129 | |||
| 4642e0022b | |||
| b4722fefd0 | |||
| 96de041ed9 | |||
| 8a7d486d22 | |||
| 462d1883f7 | |||
| 82778e92c2 | |||
| f09d04aec3 | |||
| 0b2da7e209 | |||
| 423ec7fed2 | |||
| 68996b84b6 | |||
| 6bd04bb487 | |||
| 5a449d75bc | |||
| 36c4b1d980 | |||
| e0021706f6 | |||
| 0bd937248a | |||
| 680d8f03ea | |||
| 3c1c68cc03 | |||
| 01a0c64762 | |||
| 17b0da8019 | |||
| a7b26dbb49 | |||
| 028d65fb92 | |||
| 463bb19eeb | |||
| 254d68b601 | |||
| b97241b312 | |||
| 82b9547387 | |||
| 81b196bed8 | |||
| 352580870c | |||
| ab6423cae0 | |||
| eea4e6fe82 | |||
| 93bfd61677 | |||
| 22cb7d334e | |||
| ab769f227f | |||
| 7d0b605abb | |||
| 401341d621 | |||
| 001a831986 | |||
| a2199afea1 | |||
| 659c89da8e | |||
| def23217e4 | |||
| 5527f832c0 | |||
| 2c072c958b | |||
| 6e16d90aca | |||
| ab839dc3e6 | |||
| ffb87905cb | |||
| 20f86a0aea | |||
| a77bf70978 | |||
| 7d95f2a329 | |||
| c34c0246a3 | |||
| bbc09bf27e | |||
| bda7773f04 | |||
| 47f5fcfb41 | |||
| b2a668b523 | |||
| 86bf601d04 | |||
| df93d90aea | |||
| 2ab83f0d75 | |||
| a607028331 | |||
| 2d8ede58ca | |||
| e8c1266236 | |||
| 836bb6e827 | |||
| 1c266b9214 | |||
| e0dd81e3aa | |||
| 4ff9b461a8 | |||
| d7f25f35f4 | |||
| 41364f0fbe | |||
| 006e73b9ca | |||
| cecb19c03f | |||
| 39741c01e6 | |||
| 95fac6ab45 | |||
| 9f6044256e | |||
| 66bd1cff90 | |||
| bf64035a15 | |||
| 7dfc4dbd2d | |||
| c6136aad91 | |||
| cc56f13392 | |||
| cfa90a636b | |||
| c1f9325965 | |||
| 194ba5d4ec | |||
| 19bb5e4ba0 | |||
| 63f347ec4c | |||
| 08798026f2 | |||
| b627eb461b | |||
| 18f3e0eb4f | |||
| 47c9c76b8a | |||
| 2e50f6dccb | |||
| 37bdf35978 | |||
| 5ee828ca95 | |||
| 01286329b2 | |||
| 4379ac6148 | |||
| f5c66bdb18 | |||
| 4ab3fc5eba | |||
| e4536f8e37 | |||
| 323762e54a | |||
| c2e5b6a090 | |||
| b6e53eb320 | |||
| 22dbf14f5d | |||
| 07e27ce013 | |||
| dd11acaa74 | |||
| 9a6a109f07 | |||
| a743415f12 | |||
| eddf6d2868 | |||
| df4fb1c36d | |||
| 440a574239 | |||
| 4b774ff114 | |||
| 23869bf80b | |||
| aadf3192f8 | |||
| ec716e33d6 | |||
| ef59bb7cc8 | |||
| 7bb6e29bff | |||
| e317675417 | |||
| ce6889a997 | |||
| d73f38f7ba | |||
| 1ecab0f30f | |||
| fe60164792 | |||
| 3f41ffe4b5 | |||
| bf7716d6a3 | |||
| 431a1c569c | |||
| d31b388859 | |||
| 8e5e1e6a92 | |||
| 4c1dd99852 | |||
| 3577fe8be9 | |||
| 1591ee7352 | |||
| de461c526e | |||
| b8dfcdb7d3 | |||
| 81a1d6173c | |||
| 59189a8b26 | |||
| f351eb0f18 | |||
| 31f1b654b2 | |||
| 1ad6364eeb | |||
| 335143c766 | |||
| 67a9abe914 | |||
| 2fb639646d | |||
| 3c7ca9670b | |||
| afb9266568 | |||
| 91baa6f7ff |
8
Kbuild
8
Kbuild
@ -42,13 +42,13 @@ $(obj)/$(generic-offsets-file): lib/asm-offsets.s Kbuild
|
||||
# 2) Generate asm-offsets.h
|
||||
#
|
||||
|
||||
ifneq ($(wildcard $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c),)
|
||||
ifneq ($(wildcard $(srctree)/arch/$(ARCH)/lib/asm-offsets.c),)
|
||||
offsets-file := include/generated/asm-offsets.h
|
||||
endif
|
||||
|
||||
always += $(offsets-file)
|
||||
targets += $(offsets-file)
|
||||
targets += $(CPUDIR)/$(SOC)/asm-offsets.s
|
||||
targets += arch/$(ARCH)/lib/asm-offsets.s
|
||||
|
||||
|
||||
# Default sed regexp - multiline due to syntax constraints
|
||||
@ -79,9 +79,9 @@ define cmd_offsets
|
||||
endef
|
||||
|
||||
# We use internal kbuild rules to avoid the "is up to date" message from make
|
||||
$(CPUDIR)/$(SOC)/asm-offsets.s: $(CPUDIR)/$(SOC)/asm-offsets.c FORCE
|
||||
arch/$(ARCH)/lib/asm-offsets.s: arch/$(ARCH)/lib/asm-offsets.c FORCE
|
||||
$(Q)mkdir -p $(dir $@)
|
||||
$(call if_changed_dep,cc_s_c)
|
||||
|
||||
$(obj)/$(offsets-file): $(CPUDIR)/$(SOC)/asm-offsets.s
|
||||
$(obj)/$(offsets-file): arch/$(ARCH)/lib/asm-offsets.s Kbuild
|
||||
$(call cmd,offsets)
|
||||
|
||||
73
Makefile
73
Makefile
@ -8,7 +8,7 @@
|
||||
VERSION = 2014
|
||||
PATCHLEVEL = 04
|
||||
SUBLEVEL =
|
||||
EXTRAVERSION = -rc2
|
||||
EXTRAVERSION =
|
||||
NAME =
|
||||
|
||||
# *DOCUMENTATION*
|
||||
@ -124,7 +124,8 @@ ifneq ($(KBUILD_OUTPUT),)
|
||||
# Invoke a second make in the output directory, passing relevant variables
|
||||
# check that the output directory actually exists
|
||||
saved-output := $(KBUILD_OUTPUT)
|
||||
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
|
||||
KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
|
||||
&& /bin/pwd)
|
||||
$(if $(KBUILD_OUTPUT),, \
|
||||
$(error output directory "$(saved-output)" does not exist))
|
||||
|
||||
@ -165,14 +166,7 @@ VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
|
||||
|
||||
export srctree objtree VPATH
|
||||
|
||||
OBJTREE := $(objtree)
|
||||
SPLTREE := $(OBJTREE)/spl
|
||||
TPLTREE := $(OBJTREE)/tpl
|
||||
SRCTREE := $(srctree)
|
||||
TOPDIR := $(SRCTREE)
|
||||
export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
|
||||
|
||||
MKCONFIG := $(SRCTREE)/mkconfig
|
||||
MKCONFIG := $(srctree)/mkconfig
|
||||
export MKCONFIG
|
||||
|
||||
# Make sure CDPATH settings don't interfere
|
||||
@ -415,7 +409,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
|
||||
|
||||
no-dot-config-targets := clean clobber mrproper distclean \
|
||||
help %docs check% coccicheck \
|
||||
ubootversion backup
|
||||
ubootversion backup tools-only
|
||||
|
||||
config-targets := 0
|
||||
mixed-targets := 0
|
||||
@ -490,7 +484,7 @@ endif
|
||||
# standard location.
|
||||
|
||||
ifndef LDSCRIPT
|
||||
#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
|
||||
#LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds.debug
|
||||
ifdef CONFIG_SYS_LDSCRIPT
|
||||
# need to strip off double quotes
|
||||
LDSCRIPT := $(srctree)/$(CONFIG_SYS_LDSCRIPT:"%"=%)
|
||||
@ -500,19 +494,19 @@ endif
|
||||
# If there is no specified link script, we look in a number of places for it
|
||||
ifndef LDSCRIPT
|
||||
ifeq ($(CONFIG_NAND_U_BOOT),y)
|
||||
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
|
||||
LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot-nand.lds
|
||||
ifeq ($(wildcard $(LDSCRIPT)),)
|
||||
LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
|
||||
LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot-nand.lds
|
||||
endif
|
||||
endif
|
||||
ifeq ($(wildcard $(LDSCRIPT)),)
|
||||
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
|
||||
LDSCRIPT := $(srctree)/board/$(BOARDDIR)/u-boot.lds
|
||||
endif
|
||||
ifeq ($(wildcard $(LDSCRIPT)),)
|
||||
LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
|
||||
LDSCRIPT := $(srctree)/$(CPUDIR)/u-boot.lds
|
||||
endif
|
||||
ifeq ($(wildcard $(LDSCRIPT)),)
|
||||
LDSCRIPT := $(TOPDIR)/arch/$(ARCH)/cpu/u-boot.lds
|
||||
LDSCRIPT := $(srctree)/arch/$(ARCH)/cpu/u-boot.lds
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -556,11 +550,9 @@ export CONFIG_SYS_TEXT_BASE
|
||||
|
||||
# Use UBOOTINCLUDE when you must reference the include/ directory.
|
||||
# Needed to be compatible with the O= option
|
||||
UBOOTINCLUDE :=
|
||||
ifneq ($(OBJTREE),$(SRCTREE))
|
||||
UBOOTINCLUDE += -I$(OBJTREE)/include
|
||||
endif
|
||||
UBOOTINCLUDE += -I$(srctree)/include \
|
||||
UBOOTINCLUDE := \
|
||||
-Iinclude \
|
||||
$(if $(KBUILD_SRC), -I$(srctree)/include) \
|
||||
-I$(srctree)/arch/$(ARCH)/include
|
||||
|
||||
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
|
||||
@ -668,7 +660,7 @@ export PLATFORM_LIBS
|
||||
# Pass the version down so we can handle backwards compatibility
|
||||
# on the fly.
|
||||
LDPPFLAGS += \
|
||||
-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
|
||||
-include $(srctree)/include/u-boot/u-boot.lds.h \
|
||||
-DCPUDIR=$(CPUDIR) \
|
||||
$(shell $(LD) --version | \
|
||||
sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
|
||||
@ -737,7 +729,7 @@ endif
|
||||
quiet_cmd_objcopy = OBJCOPY $@
|
||||
cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
||||
|
||||
quiet_cmd_mkimage = UIMAGE $@
|
||||
quiet_cmd_mkimage = MKIMAGE $@
|
||||
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
@ -758,6 +750,9 @@ dtbs dts/dt.dtb: checkdtc u-boot
|
||||
u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
|
||||
$(call if_changed,cat)
|
||||
|
||||
%.imx: %.bin
|
||||
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
|
||||
|
||||
quiet_cmd_copy = COPY $@
|
||||
cmd_copy = cp $< $@
|
||||
|
||||
@ -802,18 +797,15 @@ MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
|
||||
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
|
||||
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
|
||||
|
||||
MKIMAGEFLAGS_u-boot.kwb = -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
|
||||
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
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.pbl = -n $(CONFIG_SYS_FSL_PBL_RCW) \
|
||||
-R $(CONFIG_SYS_FSL_PBL_PBI) -T pblimage
|
||||
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.imx: u-boot.bin
|
||||
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
|
||||
|
||||
u-boot.sha1: u-boot.bin
|
||||
tools/ubsha1 u-boot.bin
|
||||
|
||||
@ -857,8 +849,10 @@ OBJCOPYFLAGS_u-boot.ais = -I binary -O binary --pad-to=$(CONFIG_SPL_MAX_SIZE)
|
||||
u-boot.ais: spl/u-boot-spl.ais u-boot.img FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
u-boot-signed.sb: u-boot.bin spl/u-boot-spl.bin
|
||||
$(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs u-boot-signed.sb
|
||||
u-boot.sb: u-boot.bin spl/u-boot-spl.bin
|
||||
$(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs $(objtree)/u-boot.sb
|
||||
$(Q)$(MAKE) $(build)=arch/arm/cpu/arm926ejs/mxs u-boot.sb
|
||||
|
||||
# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
|
||||
# Both images are created using mkimage (crc etc), so that the ROM
|
||||
@ -1059,11 +1053,11 @@ depend dep:
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
quiet_cmd_cpp_lds = LDS $@
|
||||
cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
|
||||
-x assembler-with-cpp -P -o $@ $<
|
||||
cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
|
||||
-D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $<
|
||||
|
||||
u-boot.lds: $(LDSCRIPT) prepare FORCE
|
||||
$(call if_changed,cpp_lds)
|
||||
$(call if_changed_dep,cpp_lds)
|
||||
|
||||
PHONY += nand_spl
|
||||
nand_spl: prepare
|
||||
@ -1136,6 +1130,9 @@ checkarmreloc: u-boot
|
||||
env: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=tools/$@
|
||||
|
||||
tools-only: scripts_basic $(version_h) $(timestamp_h)
|
||||
$(Q)$(MAKE) $(build)=tools
|
||||
|
||||
tools-all: export HOST_TOOLS_ALL=y
|
||||
tools-all: env tools ;
|
||||
|
||||
@ -1181,7 +1178,7 @@ MRPROPER_FILES += .config .config.old \
|
||||
clean: rm-dirs := $(CLEAN_DIRS)
|
||||
clean: rm-files := $(CLEAN_FILES)
|
||||
|
||||
clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $f/Makefile),$f))
|
||||
clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $(srctree)/$f/Makefile),$f))
|
||||
|
||||
clean-dirs := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
|
||||
|
||||
@ -1237,12 +1234,12 @@ distclean: mrproper
|
||||
@find $(srctree) $(RCS_FIND_IGNORE) \
|
||||
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
|
||||
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
|
||||
-o -name '.*.rej' \
|
||||
-o -name '.*.rej' -o -name '*.pyc' \
|
||||
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
|
||||
-type f -print | xargs rm -f
|
||||
|
||||
backup:
|
||||
F=`basename $(TOPDIR)` ; cd .. ; \
|
||||
F=`basename $(srctree)` ; cd .. ; \
|
||||
gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
|
||||
|
||||
help:
|
||||
|
||||
14
README
14
README
@ -566,6 +566,8 @@ The following options need to be configured:
|
||||
CONFIG_ARM_ERRATA_742230
|
||||
CONFIG_ARM_ERRATA_743622
|
||||
CONFIG_ARM_ERRATA_751472
|
||||
CONFIG_ARM_ERRATA_794072
|
||||
CONFIG_ARM_ERRATA_761320
|
||||
|
||||
If set, the workarounds for these ARM errata are applied early
|
||||
during U-Boot startup. Note that these options force the
|
||||
@ -1012,7 +1014,7 @@ The following options need to be configured:
|
||||
CONFIG_CMD_CDP * Cisco Discover Protocol support
|
||||
CONFIG_CMD_MFSL * Microblaze FSL support
|
||||
CONFIG_CMD_XIMG Load part of Multi Image
|
||||
|
||||
CONFIG_CMD_UUID * Generate random UUID or GUID string
|
||||
|
||||
EXAMPLE: If you want all functions except of network
|
||||
support you can write:
|
||||
@ -1525,6 +1527,16 @@ The following options need to be configured:
|
||||
this to the maximum filesize (in bytes) for the buffer.
|
||||
Default is 4 MiB if undefined.
|
||||
|
||||
DFU_DEFAULT_POLL_TIMEOUT
|
||||
Poll timeout [ms], is the timeout a device can send to the
|
||||
host. The host must wait for this timeout before sending
|
||||
a subsequent DFU_GET_STATUS request to the device.
|
||||
|
||||
DFU_MANIFEST_POLL_TIMEOUT
|
||||
Poll timeout [ms], which the device sends to the host when
|
||||
entering dfuMANIFEST state. Host waits this timeout, before
|
||||
sending again an USB request to the device.
|
||||
|
||||
- Journaling Flash filesystem support:
|
||||
CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE,
|
||||
CONFIG_JFFS2_NAND_DEV
|
||||
|
||||
@ -23,8 +23,6 @@ endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -DCONFIG_ARC -gdwarf-2
|
||||
|
||||
LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
|
||||
|
||||
# Needed for relocation
|
||||
LDFLAGS_FINAL += -pie
|
||||
|
||||
|
||||
@ -5,10 +5,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
ifeq ($(CROSS_COMPILE),)
|
||||
CROSS_COMPILE := arm-linux-
|
||||
endif
|
||||
|
||||
ifndef CONFIG_STANDALONE_LOAD_ADDR
|
||||
ifneq ($(CONFIG_OMAP_COMMON),)
|
||||
CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
|
||||
@ -126,6 +122,10 @@ ifndef CONFIG_SPL_BUILD
|
||||
ALL-y += SPL
|
||||
endif
|
||||
else
|
||||
ifeq ($(CONFIG_OF_SEPARATE),y)
|
||||
ALL-y += u-boot-dtb.imx
|
||||
else
|
||||
ALL-y += u-boot.imx
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* Round up to make sure size gives nice stack alignment */
|
||||
DEFINE(CLKCTL_CCMR, offsetof(struct ccm_regs, ccmr));
|
||||
DEFINE(CLKCTL_PDR0, offsetof(struct ccm_regs, pdr0));
|
||||
DEFINE(CLKCTL_PDR1, offsetof(struct ccm_regs, pdr1));
|
||||
DEFINE(CLKCTL_PDR2, offsetof(struct ccm_regs, pdr2));
|
||||
DEFINE(CLKCTL_PDR3, offsetof(struct ccm_regs, pdr3));
|
||||
DEFINE(CLKCTL_PDR4, offsetof(struct ccm_regs, pdr4));
|
||||
DEFINE(CLKCTL_RCSR, offsetof(struct ccm_regs, rcsr));
|
||||
DEFINE(CLKCTL_MPCTL, offsetof(struct ccm_regs, mpctl));
|
||||
DEFINE(CLKCTL_PPCTL, offsetof(struct ccm_regs, ppctl));
|
||||
DEFINE(CLKCTL_ACMR, offsetof(struct ccm_regs, acmr));
|
||||
DEFINE(CLKCTL_COSR, offsetof(struct ccm_regs, cosr));
|
||||
DEFINE(CLKCTL_CGR0, offsetof(struct ccm_regs, cgr0));
|
||||
DEFINE(CLKCTL_CGR1, offsetof(struct ccm_regs, cgr1));
|
||||
DEFINE(CLKCTL_CGR2, offsetof(struct ccm_regs, cgr2));
|
||||
DEFINE(CLKCTL_CGR3, offsetof(struct ccm_regs, cgr3));
|
||||
|
||||
/* Multi-Layer AHB Crossbar Switch */
|
||||
DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
|
||||
DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
|
||||
DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
|
||||
DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
|
||||
DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
|
||||
DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
|
||||
DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
|
||||
DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
|
||||
DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
|
||||
DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
|
||||
DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
|
||||
DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
|
||||
DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
|
||||
DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
|
||||
DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
|
||||
DEFINE(MAX_MGPCR5, offsetof(struct max_regs, mgpcr5));
|
||||
|
||||
/* AHB <-> IP-Bus Interface */
|
||||
DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
|
||||
DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
|
||||
DEFINE(AIPS_PACR_0_7, offsetof(struct aips_regs, pacr_0_7));
|
||||
DEFINE(AIPS_PACR_8_15, offsetof(struct aips_regs, pacr_8_15));
|
||||
DEFINE(AIPS_PACR_16_23, offsetof(struct aips_regs, pacr_16_23));
|
||||
DEFINE(AIPS_PACR_24_31, offsetof(struct aips_regs, pacr_24_31));
|
||||
DEFINE(AIPS_OPACR_0_7, offsetof(struct aips_regs, opacr_0_7));
|
||||
DEFINE(AIPS_OPACR_8_15, offsetof(struct aips_regs, opacr_8_15));
|
||||
DEFINE(AIPS_OPACR_16_23, offsetof(struct aips_regs, opacr_16_23));
|
||||
DEFINE(AIPS_OPACR_24_31, offsetof(struct aips_regs, opacr_24_31));
|
||||
DEFINE(AIPS_OPACR_32_39, offsetof(struct aips_regs, opacr_32_39));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/mb86r0x.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* ddr2 controller */
|
||||
DEFINE(DDR2_DRIC, offsetof(struct mb86r0x_ddr2c, dric));
|
||||
DEFINE(DDR2_DRIC1, offsetof(struct mb86r0x_ddr2c, dric1));
|
||||
DEFINE(DDR2_DRIC2, offsetof(struct mb86r0x_ddr2c, dric2));
|
||||
DEFINE(DDR2_DRCA, offsetof(struct mb86r0x_ddr2c, drca));
|
||||
DEFINE(DDR2_DRCM, offsetof(struct mb86r0x_ddr2c, drcm));
|
||||
DEFINE(DDR2_DRCST1, offsetof(struct mb86r0x_ddr2c, drcst1));
|
||||
DEFINE(DDR2_DRCST2, offsetof(struct mb86r0x_ddr2c, drcst2));
|
||||
DEFINE(DDR2_DRCR, offsetof(struct mb86r0x_ddr2c, drcr));
|
||||
DEFINE(DDR2_DRCF, offsetof(struct mb86r0x_ddr2c, drcf));
|
||||
DEFINE(DDR2_DRASR, offsetof(struct mb86r0x_ddr2c, drasr));
|
||||
DEFINE(DDR2_DRIMS, offsetof(struct mb86r0x_ddr2c, drims));
|
||||
DEFINE(DDR2_DROS, offsetof(struct mb86r0x_ddr2c, dros));
|
||||
DEFINE(DDR2_DRIBSODT1, offsetof(struct mb86r0x_ddr2c, dribsodt1));
|
||||
DEFINE(DDR2_DROABA, offsetof(struct mb86r0x_ddr2c, droaba));
|
||||
DEFINE(DDR2_DROBS, offsetof(struct mb86r0x_ddr2c, drobs));
|
||||
|
||||
/* clock reset generator */
|
||||
DEFINE(CRG_CRPR, offsetof(struct mb86r0x_crg, crpr));
|
||||
DEFINE(CRG_CRHA, offsetof(struct mb86r0x_crg, crha));
|
||||
DEFINE(CRG_CRPA, offsetof(struct mb86r0x_crg, crpa));
|
||||
DEFINE(CRG_CRPB, offsetof(struct mb86r0x_crg, crpb));
|
||||
DEFINE(CRG_CRHB, offsetof(struct mb86r0x_crg, crhb));
|
||||
DEFINE(CRG_CRAM, offsetof(struct mb86r0x_crg, cram));
|
||||
|
||||
/* chip control module */
|
||||
DEFINE(CCNT_CDCRC, offsetof(struct mb86r0x_ccnt, cdcrc));
|
||||
|
||||
/* external bus interface */
|
||||
DEFINE(MEMC_MCFMODE0, offsetof(struct mb86r0x_memc, mcfmode[0]));
|
||||
DEFINE(MEMC_MCFMODE2, offsetof(struct mb86r0x_memc, mcfmode[2]));
|
||||
DEFINE(MEMC_MCFMODE4, offsetof(struct mb86r0x_memc, mcfmode[4]));
|
||||
DEFINE(MEMC_MCFTIM0, offsetof(struct mb86r0x_memc, mcftim[0]));
|
||||
DEFINE(MEMC_MCFTIM2, offsetof(struct mb86r0x_memc, mcftim[2]));
|
||||
DEFINE(MEMC_MCFTIM4, offsetof(struct mb86r0x_memc, mcftim[4]));
|
||||
DEFINE(MEMC_MCFAREA0, offsetof(struct mb86r0x_memc, mcfarea[0]));
|
||||
DEFINE(MEMC_MCFAREA2, offsetof(struct mb86r0x_memc, mcfarea[2]));
|
||||
DEFINE(MEMC_MCFAREA4, offsetof(struct mb86r0x_memc, mcfarea[4]));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* Clock Control Module */
|
||||
DEFINE(CCM_CCTL, offsetof(struct ccm_regs, cctl));
|
||||
DEFINE(CCM_CGCR0, offsetof(struct ccm_regs, cgr0));
|
||||
DEFINE(CCM_CGCR1, offsetof(struct ccm_regs, cgr1));
|
||||
DEFINE(CCM_CGCR2, offsetof(struct ccm_regs, cgr2));
|
||||
DEFINE(CCM_PCDR2, offsetof(struct ccm_regs, pcdr[2]));
|
||||
DEFINE(CCM_MCR, offsetof(struct ccm_regs, mcr));
|
||||
|
||||
/* Enhanced SDRAM Controller */
|
||||
DEFINE(ESDRAMC_ESDCTL0, offsetof(struct esdramc_regs, ctl0));
|
||||
DEFINE(ESDRAMC_ESDCFG0, offsetof(struct esdramc_regs, cfg0));
|
||||
DEFINE(ESDRAMC_ESDMISC, offsetof(struct esdramc_regs, misc));
|
||||
|
||||
/* Multi-Layer AHB Crossbar Switch */
|
||||
DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
|
||||
DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
|
||||
DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
|
||||
DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
|
||||
DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
|
||||
DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
|
||||
DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
|
||||
DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
|
||||
DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
|
||||
DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
|
||||
DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
|
||||
DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
|
||||
DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
|
||||
DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
|
||||
DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
|
||||
|
||||
/* AHB <-> IP-Bus Interface */
|
||||
DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
|
||||
DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
DEFINE(AIPI1_PSR0, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr0));
|
||||
DEFINE(AIPI1_PSR1, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr1));
|
||||
DEFINE(AIPI2_PSR0, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr0));
|
||||
DEFINE(AIPI2_PSR1, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr1));
|
||||
|
||||
DEFINE(CSCR, IMX_PLL_BASE + offsetof(struct pll_regs, cscr));
|
||||
DEFINE(MPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, mpctl0));
|
||||
DEFINE(SPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, spctl0));
|
||||
DEFINE(PCDR0, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr0));
|
||||
DEFINE(PCDR1, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr1));
|
||||
DEFINE(PCCR0, IMX_PLL_BASE + offsetof(struct pll_regs, pccr0));
|
||||
DEFINE(PCCR1, IMX_PLL_BASE + offsetof(struct pll_regs, pccr1));
|
||||
|
||||
DEFINE(ESDCTL0_ROF, offsetof(struct esdramc_regs, esdctl0));
|
||||
DEFINE(ESDCFG0_ROF, offsetof(struct esdramc_regs, esdcfg0));
|
||||
DEFINE(ESDCTL1_ROF, offsetof(struct esdramc_regs, esdctl1));
|
||||
DEFINE(ESDCFG1_ROF, offsetof(struct esdramc_regs, esdcfg1));
|
||||
DEFINE(ESDMISC_ROF, offsetof(struct esdramc_regs, esdmisc));
|
||||
|
||||
DEFINE(GPCR, IMX_SYSTEM_CTL_BASE +
|
||||
offsetof(struct system_control_regs, gpcr));
|
||||
DEFINE(FMCR, IMX_SYSTEM_CTL_BASE +
|
||||
offsetof(struct system_control_regs, fmcr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -14,11 +14,72 @@ obj-y += spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o
|
||||
endif
|
||||
|
||||
# Specify the target for use in elftosb call
|
||||
MKIMAGE_TARGET-$(CONFIG_MX23) = mx23
|
||||
MKIMAGE_TARGET-$(CONFIG_MX28) = mx28
|
||||
MKIMAGE_TARGET-$(CONFIG_MX23) = mxsimage.mx23.cfg
|
||||
MKIMAGE_TARGET-$(CONFIG_MX28) = mxsimage.mx28.cfg
|
||||
|
||||
$(OBJTREE)/mxsimage.cfg: $(SRCTREE)/$(CPUDIR)/$(SOC)/mxsimage.$(MKIMAGE_TARGET-y).cfg
|
||||
sed "s@OBJTREE@$(OBJTREE)@g" $^ > $@
|
||||
# Generate HAB-capable IVT
|
||||
#
|
||||
# Note on computing the post-IVT size field value for the U-Boot binary.
|
||||
# The value is the result of adding the following:
|
||||
# -> The size of U-Boot binary aligned to 64B (u-boot.bin)
|
||||
# -> The size of IVT block aligned to 64B (u-boot.ivt)
|
||||
# -> The size of U-Boot signature (u-boot.sig), 3904 B
|
||||
# -> The 64B hole in front of U-Boot binary for 'struct mxs_spl_data' passing
|
||||
#
|
||||
quiet_cmd_mkivt_mxs = MXSIVT $@
|
||||
cmd_mkivt_mxs = \
|
||||
sz=`expr \`stat -c "%s" $^\` + 64 + 3904 + 128` ; \
|
||||
echo -n "0x402000d1 $2 0 0 0 $3 $4 0 $$sz 0 0 0 0 0 0 0" | \
|
||||
tr -s " " | xargs -d " " -i printf "%08x\n" "{}" | rev | \
|
||||
sed "s/\(.\)\(.\)/\\\\\\\\x\2\1\n/g" | xargs -i printf "{}" >$@
|
||||
|
||||
$(OBJTREE)/u-boot.sb: $(OBJTREE)/u-boot.bin $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/mxsimage.cfg
|
||||
$(OBJTREE)/tools/mkimage -n $(OBJTREE)/mxsimage.cfg -T mxsimage $@
|
||||
# Align binary to 64B
|
||||
quiet_cmd_mkalign_mxs = MXSALGN $@
|
||||
cmd_mkalign_mxs = \
|
||||
dd if=$^ of=$@ ibs=64 conv=sync 2>/dev/null && \
|
||||
mv $@ $^
|
||||
|
||||
# Assemble the CSF file
|
||||
quiet_cmd_mkcsfreq_mxs = MXSCSFR $@
|
||||
cmd_mkcsfreq_mxs = \
|
||||
ivt=$(word 1,$^) ; \
|
||||
bin=$(word 2,$^) ; \
|
||||
csf=$(word 3,$^) ; \
|
||||
sed "s@VENDOR@$(VENDOR)@g;s@BOARD@$(BOARD)@g" "$$csf" | \
|
||||
sed '/^\#\#Blocks/ d' > $@ ; \
|
||||
echo " Blocks = $2 0x0 `stat -c '%s' $$bin` \"$$bin\" , \\" >> $@ ; \
|
||||
echo " $3 0x0 0x40 \"$$ivt\"" >> $@
|
||||
|
||||
# Sign files
|
||||
quiet_cmd_mkcst_mxs = MXSCST $@
|
||||
cmd_mkcst_mxs = cst -o $@ < $^ \
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
spl/u-boot-spl.ivt: spl/u-boot-spl.bin
|
||||
$(call if_changed,mkalign_mxs)
|
||||
$(call if_changed,mkivt_mxs,$(CONFIG_SPL_TEXT_BASE),\
|
||||
0x00008000,0x00008040)
|
||||
|
||||
u-boot.ivt: u-boot.bin
|
||||
$(call if_changed,mkalign_mxs)
|
||||
$(call if_changed,mkivt_mxs,$(CONFIG_SYS_TEXT_BASE),\
|
||||
0x40001000,0x40001040)
|
||||
|
||||
spl/u-boot-spl.csf: spl/u-boot-spl.ivt spl/u-boot-spl.bin board/$(VENDOR)/$(BOARD)/sign/u-boot-spl.csf
|
||||
$(call if_changed,mkcsfreq_mxs,$(CONFIG_SPL_TEXT_BASE),0x8000)
|
||||
|
||||
u-boot.csf: u-boot.ivt u-boot.bin board/$(VENDOR)/$(BOARD)/sign/u-boot.csf
|
||||
$(call if_changed,mkcsfreq_mxs,$(CONFIG_SYS_TEXT_BASE),0x40001000)
|
||||
|
||||
%.sig: %.csf
|
||||
$(call if_changed,mkcst_mxs)
|
||||
|
||||
quiet_cmd_mkimage_mxs = MKIMAGE $@
|
||||
cmd_mkimage_mxs = $(objtree)/tools/mkimage -n $< -T mxsimage $@ \
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
u-boot.sb: $(src)/$(MKIMAGE_TARGET-y) u-boot.bin spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage_mxs)
|
||||
|
||||
u-boot-signed.sb: $(src)/mxsimage-signed.cfg u-boot.ivt u-boot.sig spl/u-boot-spl.ivt spl/u-boot-spl.sig FORCE
|
||||
$(call if_changed,mkimage_mxs)
|
||||
|
||||
10
arch/arm/cpu/arm926ejs/mxs/mxsimage-signed.cfg
Normal file
10
arch/arm/cpu/arm926ejs/mxs/mxsimage-signed.cfg
Normal file
@ -0,0 +1,10 @@
|
||||
SECTION 0x0 BOOTABLE
|
||||
TAG LAST
|
||||
LOAD 0x1000 spl/u-boot-spl.bin
|
||||
LOAD 0x8000 spl/u-boot-spl.ivt
|
||||
LOAD 0x8040 spl/u-boot-spl.sig
|
||||
CALL HAB 0x8000 0x0
|
||||
LOAD 0x40002000 u-boot.bin
|
||||
LOAD 0x40001000 u-boot.ivt
|
||||
LOAD 0x40001040 u-boot.sig
|
||||
CALL HAB 0x40001000 0x0
|
||||
@ -1,6 +1,6 @@
|
||||
SECTION 0x0 BOOTABLE
|
||||
TAG LAST
|
||||
LOAD 0x0 OBJTREE/spl/u-boot-spl.bin
|
||||
CALL 0x14 0x0
|
||||
LOAD 0x40000100 OBJTREE/u-boot.bin
|
||||
CALL 0x40000100 0x0
|
||||
LOAD 0x1000 spl/u-boot-spl.bin
|
||||
CALL 0x1000 0x0
|
||||
LOAD 0x40002000 u-boot.bin
|
||||
CALL 0x40002000 0x0
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
SECTION 0x0 BOOTABLE
|
||||
TAG LAST
|
||||
LOAD 0x0 OBJTREE/spl/u-boot-spl.bin
|
||||
LOAD IVT 0x8000 0x14
|
||||
LOAD 0x1000 spl/u-boot-spl.bin
|
||||
LOAD IVT 0x8000 0x1000
|
||||
CALL HAB 0x8000 0x0
|
||||
LOAD 0x40000100 OBJTREE/u-boot.bin
|
||||
LOAD IVT 0x8000 0x40000100
|
||||
LOAD 0x40002000 u-boot.bin
|
||||
LOAD IVT 0x8000 0x40002000
|
||||
CALL HAB 0x8000 0x0
|
||||
|
||||
@ -13,9 +13,16 @@
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#include "mxs_init.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
static gd_t gdata __section(".data");
|
||||
#ifdef CONFIG_SPL_SERIAL_SUPPORT
|
||||
static bd_t bdata __section(".data");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This delay function is intended to be used only in early stage of boot, where
|
||||
* clock are not set up yet. The timer used here is reset on every boot and
|
||||
@ -102,6 +109,28 @@ static uint8_t mxs_get_bootmode_index(void)
|
||||
return i;
|
||||
}
|
||||
|
||||
static void mxs_spl_fixup_vectors(void)
|
||||
{
|
||||
/*
|
||||
* Copy our vector table to 0x0, since due to HAB, we cannot
|
||||
* be loaded to 0x0. We want to have working vectoring though,
|
||||
* thus this fixup. Our vectoring table is PIC, so copying is
|
||||
* fine.
|
||||
*/
|
||||
extern uint32_t _start;
|
||||
memcpy(0x0, &_start, 0x60);
|
||||
}
|
||||
|
||||
static void mxs_spl_console_init(void)
|
||||
{
|
||||
#ifdef CONFIG_SPL_SERIAL_SUPPORT
|
||||
gd->bd = &bdata;
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
serial_init();
|
||||
gd->have_console = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
||||
const iomux_cfg_t *iomux_setup,
|
||||
const unsigned int iomux_size)
|
||||
@ -109,8 +138,14 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
||||
struct mxs_spl_data *data = (struct mxs_spl_data *)
|
||||
((CONFIG_SYS_TEXT_BASE - sizeof(struct mxs_spl_data)) & ~0xf);
|
||||
uint8_t bootmode = mxs_get_bootmode_index();
|
||||
gd = &gdata;
|
||||
|
||||
mxs_spl_fixup_vectors();
|
||||
|
||||
mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
|
||||
|
||||
mxs_spl_console_init();
|
||||
|
||||
mxs_power_init();
|
||||
|
||||
mxs_mem_init();
|
||||
|
||||
@ -4,8 +4,8 @@ options {
|
||||
}
|
||||
|
||||
sources {
|
||||
u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
|
||||
u_boot="OBJTREE/u-boot.bin";
|
||||
u_boot_spl="spl/u-boot-spl.bin";
|
||||
u_boot="u-boot.bin";
|
||||
}
|
||||
|
||||
section (0) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
sources {
|
||||
u_boot_spl="OBJTREE/spl/u-boot-spl.bin";
|
||||
u_boot="OBJTREE/u-boot.bin";
|
||||
u_boot_spl="spl/u-boot-spl.bin";
|
||||
u_boot="u-boot.bin";
|
||||
}
|
||||
|
||||
section (0) {
|
||||
|
||||
@ -16,7 +16,7 @@ OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x00000000;
|
||||
. = CONFIG_SPL_TEXT_BASE;
|
||||
|
||||
. = ALIGN(4);
|
||||
.text :
|
||||
|
||||
@ -202,6 +202,7 @@ static void watchdog_disable(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
void s_init(void)
|
||||
{
|
||||
/*
|
||||
@ -220,22 +221,19 @@ void s_init(void)
|
||||
#ifdef CONFIG_SPL_BUILD
|
||||
save_omap_boot_params();
|
||||
#endif
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
watchdog_disable();
|
||||
timer_init();
|
||||
set_uart_mux_conf();
|
||||
setup_clocks_for_console();
|
||||
uart_soft_reset();
|
||||
#endif
|
||||
#ifdef CONFIG_NOR_BOOT
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
serial_init();
|
||||
gd->have_console = 1;
|
||||
#else
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
gd = &gdata;
|
||||
preloader_console_init();
|
||||
#endif
|
||||
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
|
||||
prcm_init();
|
||||
set_mux_conf_regs();
|
||||
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
|
||||
@ -243,8 +241,8 @@ void s_init(void)
|
||||
rtc32k_enable();
|
||||
#endif
|
||||
sdram_init();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
void enable_caches(void)
|
||||
|
||||
@ -39,6 +39,9 @@ static void exynos5_uart_config(int peripheral)
|
||||
start = 4;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return;
|
||||
}
|
||||
for (i = start; i < start + count; i++) {
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
@ -74,6 +77,9 @@ static void exynos5420_uart_config(int peripheral)
|
||||
start = 4;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = start; i < start + count; i++) {
|
||||
@ -110,6 +116,9 @@ static int exynos5_mmc_config(int peripheral, int flags)
|
||||
bank = &gpio1->c4;
|
||||
bank_ext = NULL;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return -1;
|
||||
}
|
||||
if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) {
|
||||
debug("SDMMC device %d does not support 8bit mode",
|
||||
@ -683,6 +692,9 @@ static void exynos4_uart_config(int peripheral)
|
||||
start = 4;
|
||||
count = 2;
|
||||
break;
|
||||
default:
|
||||
debug("%s: invalid peripheral %d", __func__, peripheral);
|
||||
return;
|
||||
}
|
||||
for (i = start; i < start + count; i++) {
|
||||
s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
|
||||
@ -741,6 +753,21 @@ int exynos_pinmux_config(int peripheral, int flags)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
|
||||
{
|
||||
int err;
|
||||
u32 cell[3];
|
||||
|
||||
err = fdtdec_get_int_array(blob, node, "interrupts", cell,
|
||||
ARRAY_SIZE(cell));
|
||||
if (err) {
|
||||
debug(" invalid peripheral id\n");
|
||||
return PERIPH_ID_NONE;
|
||||
}
|
||||
|
||||
return cell[1];
|
||||
}
|
||||
|
||||
static int exynos5_pinmux_decode_periph_id(const void *blob, int node)
|
||||
{
|
||||
int err;
|
||||
@ -758,6 +785,8 @@ int pinmux_decode_periph_id(const void *blob, int node)
|
||||
{
|
||||
if (cpu_is_exynos5())
|
||||
return exynos5_pinmux_decode_periph_id(blob, node);
|
||||
else if (cpu_is_exynos4())
|
||||
return exynos4_pinmux_decode_periph_id(blob, node);
|
||||
else
|
||||
return PERIPH_ID_NONE;
|
||||
}
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
||||
/* Round up to make sure size gives nice stack alignment */
|
||||
DEFINE(CLKCTL_CCMR, offsetof(struct clkctl, ccr));
|
||||
DEFINE(CLKCTL_CCDR, offsetof(struct clkctl, ccdr));
|
||||
DEFINE(CLKCTL_CSR, offsetof(struct clkctl, csr));
|
||||
DEFINE(CLKCTL_CCSR, offsetof(struct clkctl, ccsr));
|
||||
DEFINE(CLKCTL_CACRR, offsetof(struct clkctl, cacrr));
|
||||
DEFINE(CLKCTL_CBCDR, offsetof(struct clkctl, cbcdr));
|
||||
DEFINE(CLKCTL_CBCMR, offsetof(struct clkctl, cbcmr));
|
||||
DEFINE(CLKCTL_CSCMR1, offsetof(struct clkctl, cscmr1));
|
||||
DEFINE(CLKCTL_CSCMR2, offsetof(struct clkctl, cscmr2));
|
||||
DEFINE(CLKCTL_CSCDR1, offsetof(struct clkctl, cscdr1));
|
||||
DEFINE(CLKCTL_CS1CDR, offsetof(struct clkctl, cs1cdr));
|
||||
DEFINE(CLKCTL_CS2CDR, offsetof(struct clkctl, cs2cdr));
|
||||
DEFINE(CLKCTL_CDCDR, offsetof(struct clkctl, cdcdr));
|
||||
DEFINE(CLKCTL_CHSCCDR, offsetof(struct clkctl, chsccdr));
|
||||
DEFINE(CLKCTL_CSCDR2, offsetof(struct clkctl, cscdr2));
|
||||
DEFINE(CLKCTL_CSCDR3, offsetof(struct clkctl, cscdr3));
|
||||
DEFINE(CLKCTL_CSCDR4, offsetof(struct clkctl, cscdr4));
|
||||
DEFINE(CLKCTL_CWDR, offsetof(struct clkctl, cwdr));
|
||||
DEFINE(CLKCTL_CDHIPR, offsetof(struct clkctl, cdhipr));
|
||||
DEFINE(CLKCTL_CDCR, offsetof(struct clkctl, cdcr));
|
||||
DEFINE(CLKCTL_CTOR, offsetof(struct clkctl, ctor));
|
||||
DEFINE(CLKCTL_CLPCR, offsetof(struct clkctl, clpcr));
|
||||
DEFINE(CLKCTL_CISR, offsetof(struct clkctl, cisr));
|
||||
DEFINE(CLKCTL_CIMR, offsetof(struct clkctl, cimr));
|
||||
DEFINE(CLKCTL_CCOSR, offsetof(struct clkctl, ccosr));
|
||||
DEFINE(CLKCTL_CGPR, offsetof(struct clkctl, cgpr));
|
||||
DEFINE(CLKCTL_CCGR0, offsetof(struct clkctl, ccgr0));
|
||||
DEFINE(CLKCTL_CCGR1, offsetof(struct clkctl, ccgr1));
|
||||
DEFINE(CLKCTL_CCGR2, offsetof(struct clkctl, ccgr2));
|
||||
DEFINE(CLKCTL_CCGR3, offsetof(struct clkctl, ccgr3));
|
||||
DEFINE(CLKCTL_CCGR4, offsetof(struct clkctl, ccgr4));
|
||||
DEFINE(CLKCTL_CCGR5, offsetof(struct clkctl, ccgr5));
|
||||
DEFINE(CLKCTL_CCGR6, offsetof(struct clkctl, ccgr6));
|
||||
DEFINE(CLKCTL_CMEOR, offsetof(struct clkctl, cmeor));
|
||||
#if defined(CONFIG_MX53)
|
||||
DEFINE(CLKCTL_CCGR7, offsetof(struct clkctl, ccgr7));
|
||||
#endif
|
||||
|
||||
/* DPLL */
|
||||
DEFINE(PLL_DP_CTL, offsetof(struct dpll, dp_ctl));
|
||||
DEFINE(PLL_DP_CONFIG, offsetof(struct dpll, dp_config));
|
||||
DEFINE(PLL_DP_OP, offsetof(struct dpll, dp_op));
|
||||
DEFINE(PLL_DP_MFD, offsetof(struct dpll, dp_mfd));
|
||||
DEFINE(PLL_DP_MFN, offsetof(struct dpll, dp_mfn));
|
||||
DEFINE(PLL_DP_HFS_OP, offsetof(struct dpll, dp_hfs_op));
|
||||
DEFINE(PLL_DP_HFS_MFD, offsetof(struct dpll, dp_hfs_mfd));
|
||||
DEFINE(PLL_DP_HFS_MFN, offsetof(struct dpll, dp_hfs_mfn));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -8,5 +8,5 @@
|
||||
#
|
||||
|
||||
obj-y := lowlevel_init.o
|
||||
obj-y += misc.o timer.o reset_manager.o system_manager.o
|
||||
obj-y += misc.o timer.o reset_manager.o system_manager.o clock_manager.o
|
||||
obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
|
||||
|
||||
361
arch/arm/cpu/armv7/socfpga/clock_manager.c
Normal file
361
arch/arm/cpu/armv7/socfpga/clock_manager.c
Normal file
@ -0,0 +1,361 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Altera Corporation <www.altera.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/clock_manager.h>
|
||||
|
||||
static const struct socfpga_clock_manager *clock_manager_base =
|
||||
(void *)SOCFPGA_CLKMGR_ADDRESS;
|
||||
|
||||
#define CLKMGR_BYPASS_ENABLE 1
|
||||
#define CLKMGR_BYPASS_DISABLE 0
|
||||
#define CLKMGR_STAT_IDLE 0
|
||||
#define CLKMGR_STAT_BUSY 1
|
||||
#define CLKMGR_BYPASS_PERPLLSRC_SELECT_EOSC1 0
|
||||
#define CLKMGR_BYPASS_PERPLLSRC_SELECT_INPUT_MUX 1
|
||||
#define CLKMGR_BYPASS_SDRPLLSRC_SELECT_EOSC1 0
|
||||
#define CLKMGR_BYPASS_SDRPLLSRC_SELECT_INPUT_MUX 1
|
||||
|
||||
#define CLEAR_BGP_EN_PWRDN \
|
||||
(CLKMGR_MAINPLLGRP_VCO_PWRDN_SET(0)| \
|
||||
CLKMGR_MAINPLLGRP_VCO_EN_SET(0)| \
|
||||
CLKMGR_MAINPLLGRP_VCO_BGPWRDN_SET(0))
|
||||
|
||||
#define VCO_EN_BASE \
|
||||
(CLKMGR_MAINPLLGRP_VCO_PWRDN_SET(0)| \
|
||||
CLKMGR_MAINPLLGRP_VCO_EN_SET(1)| \
|
||||
CLKMGR_MAINPLLGRP_VCO_BGPWRDN_SET(0))
|
||||
|
||||
static inline void cm_wait_for_lock(uint32_t mask)
|
||||
{
|
||||
register uint32_t inter_val;
|
||||
do {
|
||||
inter_val = readl(&clock_manager_base->inter) & mask;
|
||||
} while (inter_val != mask);
|
||||
}
|
||||
|
||||
/* function to poll in the fsm busy bit */
|
||||
static inline void cm_wait_for_fsm(void)
|
||||
{
|
||||
while (readl(&clock_manager_base->stat) & CLKMGR_STAT_BUSY)
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* function to write the bypass register which requires a poll of the
|
||||
* busy bit
|
||||
*/
|
||||
static inline void cm_write_bypass(uint32_t val)
|
||||
{
|
||||
writel(val, &clock_manager_base->bypass);
|
||||
cm_wait_for_fsm();
|
||||
}
|
||||
|
||||
/* function to write the ctrl register which requires a poll of the busy bit */
|
||||
static inline void cm_write_ctrl(uint32_t val)
|
||||
{
|
||||
writel(val, &clock_manager_base->ctrl);
|
||||
cm_wait_for_fsm();
|
||||
}
|
||||
|
||||
/* function to write a clock register that has phase information */
|
||||
static inline void cm_write_with_phase(uint32_t value,
|
||||
uint32_t reg_address, uint32_t mask)
|
||||
{
|
||||
/* poll until phase is zero */
|
||||
while (readl(reg_address) & mask)
|
||||
;
|
||||
|
||||
writel(value, reg_address);
|
||||
|
||||
while (readl(reg_address) & mask)
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup clocks while making no assumptions about previous state of the clocks.
|
||||
*
|
||||
* Start by being paranoid and gate all sw managed clocks
|
||||
* Put all plls in bypass
|
||||
* Put all plls VCO registers back to reset value (bandgap power down).
|
||||
* Put peripheral and main pll src to reset value to avoid glitch.
|
||||
* Delay 5 us.
|
||||
* Deassert bandgap power down and set numerator and denominator
|
||||
* Start 7 us timer.
|
||||
* set internal dividers
|
||||
* Wait for 7 us timer.
|
||||
* Enable plls
|
||||
* Set external dividers while plls are locking
|
||||
* Wait for pll lock
|
||||
* Assert/deassert outreset all.
|
||||
* Take all pll's out of bypass
|
||||
* Clear safe mode
|
||||
* set source main and peripheral clocks
|
||||
* Ungate clocks
|
||||
*/
|
||||
|
||||
void cm_basic_init(const cm_config_t *cfg)
|
||||
{
|
||||
uint32_t start, timeout;
|
||||
|
||||
/* Start by being paranoid and gate all sw managed clocks */
|
||||
|
||||
/*
|
||||
* We need to disable nandclk
|
||||
* and then do another apb access before disabling
|
||||
* gatting off the rest of the periperal clocks.
|
||||
*/
|
||||
writel(~CLKMGR_PERPLLGRP_EN_NANDCLK_MASK &
|
||||
readl(&clock_manager_base->per_pll_en),
|
||||
&clock_manager_base->per_pll_en);
|
||||
|
||||
/* DO NOT GATE OFF DEBUG CLOCKS & BRIDGE CLOCKS */
|
||||
writel(CLKMGR_MAINPLLGRP_EN_DBGTIMERCLK_MASK |
|
||||
CLKMGR_MAINPLLGRP_EN_DBGTRACECLK_MASK |
|
||||
CLKMGR_MAINPLLGRP_EN_DBGCLK_MASK |
|
||||
CLKMGR_MAINPLLGRP_EN_DBGATCLK_MASK |
|
||||
CLKMGR_MAINPLLGRP_EN_S2FUSER0CLK_MASK |
|
||||
CLKMGR_MAINPLLGRP_EN_L4MPCLK_MASK,
|
||||
&clock_manager_base->main_pll_en);
|
||||
|
||||
writel(0, &clock_manager_base->sdr_pll_en);
|
||||
|
||||
/* now we can gate off the rest of the peripheral clocks */
|
||||
writel(0, &clock_manager_base->per_pll_en);
|
||||
|
||||
/* Put all plls in bypass */
|
||||
cm_write_bypass(
|
||||
CLKMGR_BYPASS_PERPLLSRC_SET(
|
||||
CLKMGR_BYPASS_PERPLLSRC_SELECT_EOSC1) |
|
||||
CLKMGR_BYPASS_SDRPLLSRC_SET(
|
||||
CLKMGR_BYPASS_SDRPLLSRC_SELECT_EOSC1) |
|
||||
CLKMGR_BYPASS_PERPLL_SET(CLKMGR_BYPASS_ENABLE) |
|
||||
CLKMGR_BYPASS_SDRPLL_SET(CLKMGR_BYPASS_ENABLE) |
|
||||
CLKMGR_BYPASS_MAINPLL_SET(CLKMGR_BYPASS_ENABLE));
|
||||
|
||||
/*
|
||||
* Put all plls VCO registers back to reset value.
|
||||
* Some code might have messed with them.
|
||||
*/
|
||||
writel(CLKMGR_MAINPLLGRP_VCO_RESET_VALUE,
|
||||
&clock_manager_base->main_pll_vco);
|
||||
writel(CLKMGR_PERPLLGRP_VCO_RESET_VALUE,
|
||||
&clock_manager_base->per_pll_vco);
|
||||
writel(CLKMGR_SDRPLLGRP_VCO_RESET_VALUE,
|
||||
&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
/*
|
||||
* The clocks to the flash devices and the L4_MAIN clocks can
|
||||
* glitch when coming out of safe mode if their source values
|
||||
* are different from their reset value. So the trick it to
|
||||
* put them back to their reset state, and change input
|
||||
* after exiting safe mode but before ungating the clocks.
|
||||
*/
|
||||
writel(CLKMGR_PERPLLGRP_SRC_RESET_VALUE,
|
||||
&clock_manager_base->per_pll_src);
|
||||
writel(CLKMGR_MAINPLLGRP_L4SRC_RESET_VALUE,
|
||||
&clock_manager_base->main_pll_l4src);
|
||||
|
||||
/* read back for the required 5 us delay. */
|
||||
readl(&clock_manager_base->main_pll_vco);
|
||||
readl(&clock_manager_base->per_pll_vco);
|
||||
readl(&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
|
||||
/*
|
||||
* We made sure bgpwr down was assert for 5 us. Now deassert BG PWR DN
|
||||
* with numerator and denominator.
|
||||
*/
|
||||
writel(cfg->main_vco_base | CLEAR_BGP_EN_PWRDN |
|
||||
CLKMGR_MAINPLLGRP_VCO_REGEXTSEL_MASK,
|
||||
&clock_manager_base->main_pll_vco);
|
||||
|
||||
writel(cfg->peri_vco_base | CLEAR_BGP_EN_PWRDN |
|
||||
CLKMGR_PERPLLGRP_VCO_REGEXTSEL_MASK,
|
||||
&clock_manager_base->per_pll_vco);
|
||||
|
||||
writel(CLKMGR_SDRPLLGRP_VCO_OUTRESET_SET(0) |
|
||||
CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(0) |
|
||||
cfg->sdram_vco_base | CLEAR_BGP_EN_PWRDN |
|
||||
CLKMGR_SDRPLLGRP_VCO_REGEXTSEL_MASK,
|
||||
&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
/*
|
||||
* Time starts here
|
||||
* must wait 7 us from BGPWRDN_SET(0) to VCO_ENABLE_SET(1)
|
||||
*/
|
||||
reset_timer();
|
||||
start = get_timer(0);
|
||||
/* timeout in unit of us as CONFIG_SYS_HZ = 1000*1000 */
|
||||
timeout = 7;
|
||||
|
||||
/* main mpu */
|
||||
writel(cfg->mpuclk, &clock_manager_base->main_pll_mpuclk);
|
||||
|
||||
/* main main clock */
|
||||
writel(cfg->mainclk, &clock_manager_base->main_pll_mainclk);
|
||||
|
||||
/* main for dbg */
|
||||
writel(cfg->dbgatclk, &clock_manager_base->main_pll_dbgatclk);
|
||||
|
||||
/* main for cfgs2fuser0clk */
|
||||
writel(cfg->cfg2fuser0clk,
|
||||
&clock_manager_base->main_pll_cfgs2fuser0clk);
|
||||
|
||||
/* Peri emac0 50 MHz default to RMII */
|
||||
writel(cfg->emac0clk, &clock_manager_base->per_pll_emac0clk);
|
||||
|
||||
/* Peri emac1 50 MHz default to RMII */
|
||||
writel(cfg->emac1clk, &clock_manager_base->per_pll_emac1clk);
|
||||
|
||||
/* Peri QSPI */
|
||||
writel(cfg->mainqspiclk, &clock_manager_base->main_pll_mainqspiclk);
|
||||
|
||||
writel(cfg->perqspiclk, &clock_manager_base->per_pll_perqspiclk);
|
||||
|
||||
/* Peri pernandsdmmcclk */
|
||||
writel(cfg->pernandsdmmcclk,
|
||||
&clock_manager_base->per_pll_pernandsdmmcclk);
|
||||
|
||||
/* Peri perbaseclk */
|
||||
writel(cfg->perbaseclk, &clock_manager_base->per_pll_perbaseclk);
|
||||
|
||||
/* Peri s2fuser1clk */
|
||||
writel(cfg->s2fuser1clk, &clock_manager_base->per_pll_s2fuser1clk);
|
||||
|
||||
/* 7 us must have elapsed before we can enable the VCO */
|
||||
while (get_timer(start) < timeout)
|
||||
;
|
||||
|
||||
/* Enable vco */
|
||||
/* main pll vco */
|
||||
writel(cfg->main_vco_base | VCO_EN_BASE,
|
||||
&clock_manager_base->main_pll_vco);
|
||||
|
||||
/* periferal pll */
|
||||
writel(cfg->peri_vco_base | VCO_EN_BASE,
|
||||
&clock_manager_base->per_pll_vco);
|
||||
|
||||
/* sdram pll vco */
|
||||
writel(CLKMGR_SDRPLLGRP_VCO_OUTRESET_SET(0) |
|
||||
CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(0) |
|
||||
cfg->sdram_vco_base | VCO_EN_BASE,
|
||||
&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
/* L3 MP and L3 SP */
|
||||
writel(cfg->maindiv, &clock_manager_base->main_pll_maindiv);
|
||||
|
||||
writel(cfg->dbgdiv, &clock_manager_base->main_pll_dbgdiv);
|
||||
|
||||
writel(cfg->tracediv, &clock_manager_base->main_pll_tracediv);
|
||||
|
||||
/* L4 MP, L4 SP, can0, and can1 */
|
||||
writel(cfg->perdiv, &clock_manager_base->per_pll_div);
|
||||
|
||||
writel(cfg->gpiodiv, &clock_manager_base->per_pll_gpiodiv);
|
||||
|
||||
#define LOCKED_MASK \
|
||||
(CLKMGR_INTER_SDRPLLLOCKED_MASK | \
|
||||
CLKMGR_INTER_PERPLLLOCKED_MASK | \
|
||||
CLKMGR_INTER_MAINPLLLOCKED_MASK)
|
||||
|
||||
cm_wait_for_lock(LOCKED_MASK);
|
||||
|
||||
/* write the sdram clock counters before toggling outreset all */
|
||||
writel(cfg->ddrdqsclk & CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_MASK,
|
||||
&clock_manager_base->sdr_pll_ddrdqsclk);
|
||||
|
||||
writel(cfg->ddr2xdqsclk & CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_MASK,
|
||||
&clock_manager_base->sdr_pll_ddr2xdqsclk);
|
||||
|
||||
writel(cfg->ddrdqclk & CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_MASK,
|
||||
&clock_manager_base->sdr_pll_ddrdqclk);
|
||||
|
||||
writel(cfg->s2fuser2clk & CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_MASK,
|
||||
&clock_manager_base->sdr_pll_s2fuser2clk);
|
||||
|
||||
/*
|
||||
* after locking, but before taking out of bypass
|
||||
* assert/deassert outresetall
|
||||
*/
|
||||
uint32_t mainvco = readl(&clock_manager_base->main_pll_vco);
|
||||
|
||||
/* assert main outresetall */
|
||||
writel(mainvco | CLKMGR_MAINPLLGRP_VCO_OUTRESETALL_MASK,
|
||||
&clock_manager_base->main_pll_vco);
|
||||
|
||||
uint32_t periphvco = readl(&clock_manager_base->per_pll_vco);
|
||||
|
||||
/* assert pheriph outresetall */
|
||||
writel(periphvco | CLKMGR_PERPLLGRP_VCO_OUTRESETALL_MASK,
|
||||
&clock_manager_base->per_pll_vco);
|
||||
|
||||
/* assert sdram outresetall */
|
||||
writel(cfg->sdram_vco_base | VCO_EN_BASE|
|
||||
CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(1),
|
||||
&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
/* deassert main outresetall */
|
||||
writel(mainvco & ~CLKMGR_MAINPLLGRP_VCO_OUTRESETALL_MASK,
|
||||
&clock_manager_base->main_pll_vco);
|
||||
|
||||
/* deassert pheriph outresetall */
|
||||
writel(periphvco & ~CLKMGR_PERPLLGRP_VCO_OUTRESETALL_MASK,
|
||||
&clock_manager_base->per_pll_vco);
|
||||
|
||||
/* deassert sdram outresetall */
|
||||
writel(CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(0) |
|
||||
cfg->sdram_vco_base | VCO_EN_BASE,
|
||||
&clock_manager_base->sdr_pll_vco);
|
||||
|
||||
/*
|
||||
* now that we've toggled outreset all, all the clocks
|
||||
* are aligned nicely; so we can change any phase.
|
||||
*/
|
||||
cm_write_with_phase(cfg->ddrdqsclk,
|
||||
(uint32_t)&clock_manager_base->sdr_pll_ddrdqsclk,
|
||||
CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_MASK);
|
||||
|
||||
/* SDRAM DDR2XDQSCLK */
|
||||
cm_write_with_phase(cfg->ddr2xdqsclk,
|
||||
(uint32_t)&clock_manager_base->sdr_pll_ddr2xdqsclk,
|
||||
CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_MASK);
|
||||
|
||||
cm_write_with_phase(cfg->ddrdqclk,
|
||||
(uint32_t)&clock_manager_base->sdr_pll_ddrdqclk,
|
||||
CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_MASK);
|
||||
|
||||
cm_write_with_phase(cfg->s2fuser2clk,
|
||||
(uint32_t)&clock_manager_base->sdr_pll_s2fuser2clk,
|
||||
CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_MASK);
|
||||
|
||||
/* Take all three PLLs out of bypass when safe mode is cleared. */
|
||||
cm_write_bypass(
|
||||
CLKMGR_BYPASS_PERPLLSRC_SET(
|
||||
CLKMGR_BYPASS_PERPLLSRC_SELECT_EOSC1) |
|
||||
CLKMGR_BYPASS_SDRPLLSRC_SET(
|
||||
CLKMGR_BYPASS_SDRPLLSRC_SELECT_EOSC1) |
|
||||
CLKMGR_BYPASS_PERPLL_SET(CLKMGR_BYPASS_DISABLE) |
|
||||
CLKMGR_BYPASS_SDRPLL_SET(CLKMGR_BYPASS_DISABLE) |
|
||||
CLKMGR_BYPASS_MAINPLL_SET(CLKMGR_BYPASS_DISABLE));
|
||||
|
||||
/* clear safe mode */
|
||||
cm_write_ctrl(readl(&clock_manager_base->ctrl) |
|
||||
CLKMGR_CTRL_SAFEMODE_SET(CLKMGR_CTRL_SAFEMODE_MASK));
|
||||
|
||||
/*
|
||||
* now that safe mode is clear with clocks gated
|
||||
* it safe to change the source mux for the flashes the the L4_MAIN
|
||||
*/
|
||||
writel(cfg->persrc, &clock_manager_base->per_pll_src);
|
||||
writel(cfg->l4src, &clock_manager_base->main_pll_l4src);
|
||||
|
||||
/* Now ungate non-hw-managed clocks */
|
||||
writel(~0, &clock_manager_base->main_pll_en);
|
||||
writel(~0, &clock_manager_base->per_pll_en);
|
||||
writel(~0, &clock_manager_base->sdr_pll_en);
|
||||
}
|
||||
@ -28,10 +28,99 @@ u32 spl_boot_device(void)
|
||||
void spl_board_init(void)
|
||||
{
|
||||
#ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET
|
||||
cm_config_t cm_default_cfg = {
|
||||
/* main group */
|
||||
MAIN_VCO_BASE,
|
||||
CLKMGR_MAINPLLGRP_MPUCLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MPUCLK_CNT),
|
||||
CLKMGR_MAINPLLGRP_MAINCLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINCLK_CNT),
|
||||
CLKMGR_MAINPLLGRP_DBGATCLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_DBGATCLK_CNT),
|
||||
CLKMGR_MAINPLLGRP_MAINQSPICLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINQSPICLK_CNT),
|
||||
CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINNANDSDMMCCLK_CNT),
|
||||
CLKMGR_MAINPLLGRP_CFGS2FUSER0CLK_CNT_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_CFGS2FUSER0CLK_CNT),
|
||||
CLKMGR_MAINPLLGRP_MAINDIV_L3MPCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINDIV_L3MPCLK) |
|
||||
CLKMGR_MAINPLLGRP_MAINDIV_L3SPCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINDIV_L3SPCLK) |
|
||||
CLKMGR_MAINPLLGRP_MAINDIV_L4MPCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINDIV_L4MPCLK) |
|
||||
CLKMGR_MAINPLLGRP_MAINDIV_L4SPCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_MAINDIV_L4SPCLK),
|
||||
CLKMGR_MAINPLLGRP_DBGDIV_DBGATCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGATCLK) |
|
||||
CLKMGR_MAINPLLGRP_DBGDIV_DBGCLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGCLK),
|
||||
CLKMGR_MAINPLLGRP_TRACEDIV_TRACECLK_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_TRACEDIV_TRACECLK),
|
||||
CLKMGR_MAINPLLGRP_L4SRC_L4MP_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_L4SRC_L4MP) |
|
||||
CLKMGR_MAINPLLGRP_L4SRC_L4SP_SET(
|
||||
CONFIG_HPS_MAINPLLGRP_L4SRC_L4SP),
|
||||
|
||||
/* peripheral group */
|
||||
PERI_VCO_BASE,
|
||||
CLKMGR_PERPLLGRP_EMAC0CLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_EMAC0CLK_CNT),
|
||||
CLKMGR_PERPLLGRP_EMAC1CLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_EMAC1CLK_CNT),
|
||||
CLKMGR_PERPLLGRP_PERQSPICLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_PERQSPICLK_CNT),
|
||||
CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_PERNANDSDMMCCLK_CNT),
|
||||
CLKMGR_PERPLLGRP_PERBASECLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_PERBASECLK_CNT),
|
||||
CLKMGR_PERPLLGRP_S2FUSER1CLK_CNT_SET(
|
||||
CONFIG_HPS_PERPLLGRP_S2FUSER1CLK_CNT),
|
||||
CLKMGR_PERPLLGRP_DIV_USBCLK_SET(
|
||||
CONFIG_HPS_PERPLLGRP_DIV_USBCLK) |
|
||||
CLKMGR_PERPLLGRP_DIV_SPIMCLK_SET(
|
||||
CONFIG_HPS_PERPLLGRP_DIV_SPIMCLK) |
|
||||
CLKMGR_PERPLLGRP_DIV_CAN0CLK_SET(
|
||||
CONFIG_HPS_PERPLLGRP_DIV_CAN0CLK) |
|
||||
CLKMGR_PERPLLGRP_DIV_CAN1CLK_SET(
|
||||
CONFIG_HPS_PERPLLGRP_DIV_CAN1CLK),
|
||||
CLKMGR_PERPLLGRP_GPIODIV_GPIODBCLK_SET(
|
||||
CONFIG_HPS_PERPLLGRP_GPIODIV_GPIODBCLK),
|
||||
CLKMGR_PERPLLGRP_SRC_QSPI_SET(
|
||||
CONFIG_HPS_PERPLLGRP_SRC_QSPI) |
|
||||
CLKMGR_PERPLLGRP_SRC_NAND_SET(
|
||||
CONFIG_HPS_PERPLLGRP_SRC_NAND) |
|
||||
CLKMGR_PERPLLGRP_SRC_SDMMC_SET(
|
||||
CONFIG_HPS_PERPLLGRP_SRC_SDMMC),
|
||||
|
||||
/* sdram pll group */
|
||||
SDR_VCO_BASE,
|
||||
CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_PHASE) |
|
||||
CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_CNT),
|
||||
CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_PHASE) |
|
||||
CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_CNT),
|
||||
CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDRDQCLK_PHASE) |
|
||||
CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_DDRDQCLK_CNT),
|
||||
CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_PHASE) |
|
||||
CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_SET(
|
||||
CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_CNT),
|
||||
};
|
||||
|
||||
debug("Freezing all I/O banks\n");
|
||||
/* freeze all IO banks */
|
||||
sys_mgr_frzctrl_freeze_req();
|
||||
|
||||
debug("Reconfigure Clock Manager\n");
|
||||
/* reconfigure the PLLs */
|
||||
cm_basic_init(&cm_default_cfg);
|
||||
|
||||
/* configure the pin muxing through system manager */
|
||||
sysmgr_pinmux_init();
|
||||
#endif /* CONFIG_SOCFPGA_VIRTUAL_TARGET */
|
||||
|
||||
@ -205,7 +205,7 @@ ENTRY(cpu_init_cp15)
|
||||
mcr p15, 0, r0, c1, c0, 0 @ write system control register
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARM_ERRATA_742230
|
||||
#if (defined(CONFIG_ARM_ERRATA_742230) || defined(CONFIG_ARM_ERRATA_794072))
|
||||
mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
|
||||
orr r0, r0, #1 << 4 @ set bit #4
|
||||
mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
|
||||
@ -222,6 +222,11 @@ ENTRY(cpu_init_cp15)
|
||||
orr r0, r0, #1 << 11 @ set bit #11
|
||||
mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
|
||||
#endif
|
||||
#ifdef CONFIG_ARM_ERRATA_761320
|
||||
mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
|
||||
orr r0, r0, #1 << 21 @ set bit #21
|
||||
mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
|
||||
#endif
|
||||
|
||||
mov pc, lr @ back to my caller
|
||||
ENDPROC(cpu_init_cp15)
|
||||
|
||||
@ -13,5 +13,4 @@ obj-y += cache_v8.o
|
||||
obj-y += exceptions.o
|
||||
obj-y += cache.o
|
||||
obj-y += tlb.o
|
||||
obj-y += gic.o
|
||||
obj-y += transition.o
|
||||
|
||||
@ -19,23 +19,22 @@
|
||||
* clean and invalidate one level cache.
|
||||
*
|
||||
* x0: cache level
|
||||
* x1~x9: clobbered
|
||||
* x1: 0 flush & invalidate, 1 invalidate only
|
||||
* x2~x9: clobbered
|
||||
*/
|
||||
ENTRY(__asm_flush_dcache_level)
|
||||
lsl x1, x0, #1
|
||||
msr csselr_el1, x1 /* select cache level */
|
||||
lsl x12, x0, #1
|
||||
msr csselr_el1, x12 /* select cache level */
|
||||
isb /* sync change of cssidr_el1 */
|
||||
mrs x6, ccsidr_el1 /* read the new cssidr_el1 */
|
||||
and x2, x6, #7 /* x2 <- log2(cache line size)-4 */
|
||||
add x2, x2, #4 /* x2 <- log2(cache line size) */
|
||||
mov x3, #0x3ff
|
||||
and x3, x3, x6, lsr #3 /* x3 <- max number of #ways */
|
||||
add w4, w3, w3
|
||||
sub w4, w4, 1 /* round up log2(#ways + 1) */
|
||||
clz w5, w4 /* bit position of #ways */
|
||||
clz w5, w3 /* bit position of #ways */
|
||||
mov x4, #0x7fff
|
||||
and x4, x4, x6, lsr #13 /* x4 <- max number of #sets */
|
||||
/* x1 <- cache level << 1 */
|
||||
/* x12 <- cache level << 1 */
|
||||
/* x2 <- line length offset */
|
||||
/* x3 <- number of cache ways - 1 */
|
||||
/* x4 <- number of cache sets - 1 */
|
||||
@ -45,11 +44,14 @@ loop_set:
|
||||
mov x6, x3 /* x6 <- working copy of #ways */
|
||||
loop_way:
|
||||
lsl x7, x6, x5
|
||||
orr x9, x1, x7 /* map way and level to cisw value */
|
||||
orr x9, x12, x7 /* map way and level to cisw value */
|
||||
lsl x7, x4, x2
|
||||
orr x9, x9, x7 /* map set number to cisw value */
|
||||
dc cisw, x9 /* clean & invalidate by set/way */
|
||||
subs x6, x6, #1 /* decrement the way */
|
||||
tbz w1, #0, 1f
|
||||
dc isw, x9
|
||||
b 2f
|
||||
1: dc cisw, x9 /* clean & invalidate by set/way */
|
||||
2: subs x6, x6, #1 /* decrement the way */
|
||||
b.ge loop_way
|
||||
subs x4, x4, #1 /* decrement the set */
|
||||
b.ge loop_set
|
||||
@ -58,11 +60,14 @@ loop_way:
|
||||
ENDPROC(__asm_flush_dcache_level)
|
||||
|
||||
/*
|
||||
* void __asm_flush_dcache_all(void)
|
||||
* void __asm_flush_dcache_all(int invalidate_only)
|
||||
*
|
||||
* x0: 0 flush & invalidate, 1 invalidate only
|
||||
*
|
||||
* clean and invalidate all data cache by SET/WAY.
|
||||
*/
|
||||
ENTRY(__asm_flush_dcache_all)
|
||||
ENTRY(__asm_dcache_all)
|
||||
mov x1, x0
|
||||
dsb sy
|
||||
mrs x10, clidr_el1 /* read clidr_el1 */
|
||||
lsr x11, x10, #24
|
||||
@ -76,13 +81,13 @@ ENTRY(__asm_flush_dcache_all)
|
||||
/* x15 <- return address */
|
||||
|
||||
loop_level:
|
||||
lsl x1, x0, #1
|
||||
add x1, x1, x0 /* x0 <- tripled cache level */
|
||||
lsr x1, x10, x1
|
||||
and x1, x1, #7 /* x1 <- cache type */
|
||||
cmp x1, #2
|
||||
lsl x12, x0, #1
|
||||
add x12, x12, x0 /* x0 <- tripled cache level */
|
||||
lsr x12, x10, x12
|
||||
and x12, x12, #7 /* x12 <- cache type */
|
||||
cmp x12, #2
|
||||
b.lt skip /* skip if no cache or icache */
|
||||
bl __asm_flush_dcache_level
|
||||
bl __asm_flush_dcache_level /* x1 = 0 flush, 1 invalidate */
|
||||
skip:
|
||||
add x0, x0, #1 /* increment cache level */
|
||||
cmp x11, x0
|
||||
@ -96,8 +101,24 @@ skip:
|
||||
|
||||
finished:
|
||||
ret
|
||||
ENDPROC(__asm_dcache_all)
|
||||
|
||||
ENTRY(__asm_flush_dcache_all)
|
||||
mov x16, lr
|
||||
mov x0, #0
|
||||
bl __asm_dcache_all
|
||||
mov lr, x16
|
||||
ret
|
||||
ENDPROC(__asm_flush_dcache_all)
|
||||
|
||||
ENTRY(__asm_invalidate_dcache_all)
|
||||
mov x16, lr
|
||||
mov x0, #0xffff
|
||||
bl __asm_dcache_all
|
||||
mov lr, x16
|
||||
ret
|
||||
ENDPROC(__asm_invalidate_dcache_all)
|
||||
|
||||
/*
|
||||
* void __asm_flush_dcache_range(start, end)
|
||||
*
|
||||
|
||||
@ -45,15 +45,31 @@ static void mmu_setup(void)
|
||||
|
||||
/* load TTBR0 */
|
||||
el = current_el();
|
||||
if (el == 1)
|
||||
if (el == 1) {
|
||||
asm volatile("msr ttbr0_el1, %0"
|
||||
: : "r" (gd->arch.tlb_addr) : "memory");
|
||||
else if (el == 2)
|
||||
asm volatile("msr tcr_el1, %0"
|
||||
: : "r" (TCR_FLAGS | TCR_EL1_IPS_BITS)
|
||||
: "memory");
|
||||
asm volatile("msr mair_el1, %0"
|
||||
: : "r" (MEMORY_ATTRIBUTES) : "memory");
|
||||
} else if (el == 2) {
|
||||
asm volatile("msr ttbr0_el2, %0"
|
||||
: : "r" (gd->arch.tlb_addr) : "memory");
|
||||
else
|
||||
asm volatile("msr tcr_el2, %0"
|
||||
: : "r" (TCR_FLAGS | TCR_EL2_IPS_BITS)
|
||||
: "memory");
|
||||
asm volatile("msr mair_el2, %0"
|
||||
: : "r" (MEMORY_ATTRIBUTES) : "memory");
|
||||
} else {
|
||||
asm volatile("msr ttbr0_el3, %0"
|
||||
: : "r" (gd->arch.tlb_addr) : "memory");
|
||||
asm volatile("msr tcr_el3, %0"
|
||||
: : "r" (TCR_FLAGS | TCR_EL2_IPS_BITS)
|
||||
: "memory");
|
||||
asm volatile("msr mair_el3, %0"
|
||||
: : "r" (MEMORY_ATTRIBUTES) : "memory");
|
||||
}
|
||||
|
||||
/* enable the mmu */
|
||||
set_sctlr(get_sctlr() | CR_M);
|
||||
@ -64,7 +80,7 @@ static void mmu_setup(void)
|
||||
*/
|
||||
void invalidate_dcache_all(void)
|
||||
{
|
||||
__asm_flush_dcache_all();
|
||||
__asm_invalidate_dcache_all();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -161,6 +177,7 @@ int dcache_status(void)
|
||||
|
||||
void icache_enable(void)
|
||||
{
|
||||
__asm_invalidate_icache_all();
|
||||
set_sctlr(get_sctlr() | CR_I);
|
||||
}
|
||||
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
/*
|
||||
* GIC Initialization Routines.
|
||||
*
|
||||
* (C) Copyright 2013
|
||||
* David Feng <fenghua@phytium.com.cn>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/macro.h>
|
||||
#include <asm/gic.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void gic_init(void) __attribute__((weak));
|
||||
*
|
||||
* Currently, this routine only initialize secure copy of GIC
|
||||
* with Security Extensions at EL3.
|
||||
*
|
||||
*************************************************************************/
|
||||
WEAK(gic_init)
|
||||
branch_if_slave x0, 2f
|
||||
|
||||
/* Initialize Distributor and SPIs */
|
||||
ldr x1, =GICD_BASE
|
||||
mov w0, #0x3 /* EnableGrp0 | EnableGrp1 */
|
||||
str w0, [x1, GICD_CTLR] /* Secure GICD_CTLR */
|
||||
ldr w0, [x1, GICD_TYPER]
|
||||
and w2, w0, #0x1f /* ITLinesNumber */
|
||||
cbz w2, 2f /* No SPIs */
|
||||
add x1, x1, (GICD_IGROUPRn + 4)
|
||||
mov w0, #~0 /* Config SPIs as Grp1 */
|
||||
1: str w0, [x1], #0x4
|
||||
sub w2, w2, #0x1
|
||||
cbnz w2, 1b
|
||||
|
||||
/* Initialize SGIs and PPIs */
|
||||
2: ldr x1, =GICD_BASE
|
||||
mov w0, #~0 /* Config SGIs and PPIs as Grp1 */
|
||||
str w0, [x1, GICD_IGROUPRn] /* GICD_IGROUPR0 */
|
||||
mov w0, #0x1 /* Enable SGI 0 */
|
||||
str w0, [x1, GICD_ISENABLERn]
|
||||
|
||||
/* Initialize Cpu Interface */
|
||||
ldr x1, =GICC_BASE
|
||||
mov w0, #0x1e7 /* Disable IRQ/FIQ Bypass & */
|
||||
/* Enable Ack Group1 Interrupt & */
|
||||
/* EnableGrp0 & EnableGrp1 */
|
||||
str w0, [x1, GICC_CTLR] /* Secure GICC_CTLR */
|
||||
|
||||
mov w0, #0x1 << 7 /* Non-Secure access to GICC_PMR */
|
||||
str w0, [x1, GICC_PMR]
|
||||
|
||||
ret
|
||||
ENDPROC(gic_init)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void gic_send_sgi(u64 sgi) __attribute__((weak));
|
||||
*
|
||||
*************************************************************************/
|
||||
WEAK(gic_send_sgi)
|
||||
ldr x1, =GICD_BASE
|
||||
mov w2, #0x8000
|
||||
movk w2, #0x100, lsl #16
|
||||
orr w2, w2, w0
|
||||
str w2, [x1, GICD_SGIR]
|
||||
ret
|
||||
ENDPROC(gic_send_sgi)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void wait_for_wakeup(void) __attribute__((weak));
|
||||
*
|
||||
* Wait for SGI 0 from master.
|
||||
*
|
||||
*************************************************************************/
|
||||
WEAK(wait_for_wakeup)
|
||||
ldr x1, =GICC_BASE
|
||||
0: wfi
|
||||
ldr w0, [x1, GICC_AIAR]
|
||||
str w0, [x1, GICC_AEOIR]
|
||||
cbnz w0, 0b
|
||||
ret
|
||||
ENDPROC(wait_for_wakeup)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void smp_kick_all_cpus(void) __attribute__((weak));
|
||||
*
|
||||
*************************************************************************/
|
||||
WEAK(smp_kick_all_cpus)
|
||||
/* Kick secondary cpus up by SGI 0 interrupt */
|
||||
mov x0, xzr /* SGI 0 */
|
||||
mov x29, lr /* Save LR */
|
||||
bl gic_send_sgi
|
||||
mov lr, x29 /* Restore LR */
|
||||
ret
|
||||
ENDPROC(smp_kick_all_cpus)
|
||||
@ -50,7 +50,10 @@ reset:
|
||||
*/
|
||||
adr x0, vectors
|
||||
switch_el x1, 3f, 2f, 1f
|
||||
3: msr vbar_el3, x0
|
||||
3: mrs x0, scr_el3
|
||||
orr x0, x0, #0xf /* SCR_EL3.NS|IRQ|FIQ|EA */
|
||||
msr scr_el3, x0
|
||||
msr vbar_el3, x0
|
||||
msr cptr_el3, xzr /* Enable FP/SIMD */
|
||||
ldr x0, =COUNTER_FREQUENCY
|
||||
msr cntfrq_el0, x0 /* Initialize CNTFRQ */
|
||||
@ -64,10 +67,12 @@ reset:
|
||||
msr cpacr_el1, x0 /* Enable FP/SIMD */
|
||||
0:
|
||||
|
||||
/* Cache/BPB/TLB Invalidate */
|
||||
bl __asm_flush_dcache_all /* dCache clean&invalidate */
|
||||
bl __asm_invalidate_icache_all /* iCache invalidate */
|
||||
bl __asm_invalidate_tlb_all /* invalidate TLBs */
|
||||
/*
|
||||
* Cache/BPB/TLB Invalidate
|
||||
* i-cache is invalidated before enabled in icache_enable()
|
||||
* tlb is invalidated before mmu is enabled in dcache_enable()
|
||||
* d-cache is invalidated before enabled in dcache_enable()
|
||||
*/
|
||||
|
||||
/* Processor specific initialization */
|
||||
bl lowlevel_init
|
||||
@ -93,63 +98,64 @@ master_cpu:
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
WEAK(lowlevel_init)
|
||||
/* Initialize GIC Secure Bank Status */
|
||||
mov x29, lr /* Save LR */
|
||||
bl gic_init
|
||||
|
||||
branch_if_master x0, x1, 1f
|
||||
#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
|
||||
branch_if_slave x0, 1f
|
||||
ldr x0, =GICD_BASE
|
||||
bl gic_init_secure
|
||||
1:
|
||||
#if defined(CONFIG_GICV3)
|
||||
ldr x0, =GICR_BASE
|
||||
bl gic_init_secure_percpu
|
||||
#elif defined(CONFIG_GICV2)
|
||||
ldr x0, =GICD_BASE
|
||||
ldr x1, =GICC_BASE
|
||||
bl gic_init_secure_percpu
|
||||
#endif
|
||||
#endif
|
||||
|
||||
branch_if_master x0, x1, 2f
|
||||
|
||||
/*
|
||||
* Slave should wait for master clearing spin table.
|
||||
* This sync prevent salves observing incorrect
|
||||
* value of spin table and jumping to wrong place.
|
||||
*/
|
||||
bl wait_for_wakeup
|
||||
#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
|
||||
#ifdef CONFIG_GICV2
|
||||
ldr x0, =GICC_BASE
|
||||
#endif
|
||||
bl gic_wait_for_interrupt
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All processors will enter EL2 and optionally EL1.
|
||||
* All slaves will enter EL2 and optionally EL1.
|
||||
*/
|
||||
bl armv8_switch_to_el2
|
||||
#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
|
||||
bl armv8_switch_to_el1
|
||||
#endif
|
||||
|
||||
1:
|
||||
2:
|
||||
mov lr, x29 /* Restore LR */
|
||||
ret
|
||||
ENDPROC(lowlevel_init)
|
||||
|
||||
WEAK(smp_kick_all_cpus)
|
||||
/* Kick secondary cpus up by SGI 0 interrupt */
|
||||
mov x29, lr /* Save LR */
|
||||
#if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
|
||||
ldr x0, =GICD_BASE
|
||||
bl gic_kick_secondary_cpus
|
||||
#endif
|
||||
mov lr, x29 /* Restore LR */
|
||||
ret
|
||||
ENDPROC(smp_kick_all_cpus)
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
ENTRY(c_runtime_cpu_setup)
|
||||
/* If I-cache is enabled invalidate it */
|
||||
#ifndef CONFIG_SYS_ICACHE_OFF
|
||||
ic iallu /* I+BTB cache invalidate */
|
||||
isb sy
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
/*
|
||||
* Setup MAIR and TCR.
|
||||
*/
|
||||
ldr x0, =MEMORY_ATTRIBUTES
|
||||
ldr x1, =TCR_FLAGS
|
||||
|
||||
switch_el x2, 3f, 2f, 1f
|
||||
3: orr x1, x1, TCR_EL3_IPS_BITS
|
||||
msr mair_el3, x0
|
||||
msr tcr_el3, x1
|
||||
b 0f
|
||||
2: orr x1, x1, TCR_EL2_IPS_BITS
|
||||
msr mair_el2, x0
|
||||
msr tcr_el2, x1
|
||||
b 0f
|
||||
1: orr x1, x1, TCR_EL1_IPS_BITS
|
||||
msr mair_el1, x0
|
||||
msr tcr_el1, x1
|
||||
0:
|
||||
#endif
|
||||
|
||||
/* Relocate vBAR */
|
||||
adr x0, vectors
|
||||
switch_el x1, 3f, 2f, 1f
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
# The AVP is ARMv4T architecture so we must use special compiler
|
||||
# flags for any startup files it might use.
|
||||
CFLAGS_arch/arm/cpu/tegra20-common/warmboot_avp.o += -march=armv4t
|
||||
CFLAGS_warmboot_avp.o += -march=armv4t
|
||||
|
||||
obj-y += clock.o funcmux.o pinmux.o
|
||||
obj-$(CONFIG_TEGRA_LP0) += warmboot.o crypto.o warmboot_avp.o
|
||||
|
||||
@ -102,6 +102,7 @@ SECTIONS
|
||||
.dynamic : { *(.dynamic*) }
|
||||
.plt : { *(.plt*) }
|
||||
.interp : { *(.interp*) }
|
||||
.gnu.hash : { *(.gnu.hash) }
|
||||
.gnu : { *(.gnu*) }
|
||||
.ARM.exidx : { *(.ARM.exidx*) }
|
||||
.gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) }
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
|
||||
exynos4210-universal_c210.dtb \
|
||||
exynos4210-trats.dtb \
|
||||
exynos4412-trats2.dtb
|
||||
|
||||
dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
|
||||
exynos5250-snow.dtb \
|
||||
exynos5250-smdk5250.dtb \
|
||||
exynos5420-smdk5420.dtb
|
||||
dtb-$(CONFIG_MX6) += imx6q-sabreauto.dtb
|
||||
dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
|
||||
tegra20-medcom-wide.dtb \
|
||||
tegra20-paz00.dtb \
|
||||
|
||||
138
arch/arm/dts/exynos4.dtsi
Normal file
138
arch/arm/dts/exynos4.dtsi
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Samsung's Exynos4 SoC common device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
serial@13800000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0x13800000 0x3c>;
|
||||
id = <0>;
|
||||
};
|
||||
|
||||
serial@13810000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0x13810000 0x3c>;
|
||||
id = <1>;
|
||||
};
|
||||
|
||||
serial@13820000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0x13820000 0x3c>;
|
||||
id = <2>;
|
||||
};
|
||||
|
||||
serial@13830000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0x13830000 0x3c>;
|
||||
id = <3>;
|
||||
};
|
||||
|
||||
serial@13840000 {
|
||||
compatible = "samsung,exynos4210-uart";
|
||||
reg = <0x13840000 0x3c>;
|
||||
id = <4>;
|
||||
};
|
||||
|
||||
i2c@13860000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <0 0 0>;
|
||||
};
|
||||
|
||||
i2c@13870000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <1 1 0>;
|
||||
};
|
||||
|
||||
i2c@13880000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <2 2 0>;
|
||||
};
|
||||
|
||||
i2c@13890000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <3 3 0>;
|
||||
};
|
||||
|
||||
i2c@138a0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <4 4 0>;
|
||||
};
|
||||
|
||||
i2c@138b0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <5 5 0>;
|
||||
};
|
||||
|
||||
i2c@138c0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <6 6 0>;
|
||||
};
|
||||
|
||||
i2c@138d0000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,s3c2440-i2c";
|
||||
interrupts = <7 7 0>;
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-mmc";
|
||||
reg = <0x12510000 0x1000>;
|
||||
interrupts = <0 75 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-mmc";
|
||||
reg = <0x12520000 0x1000>;
|
||||
interrupts = <0 76 0>;
|
||||
};
|
||||
|
||||
sdhci@12530000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-mmc";
|
||||
reg = <0x12530000 0x1000>;
|
||||
interrupts = <0 77 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "samsung,exynos-mmc";
|
||||
reg = <0x12540000 0x1000>;
|
||||
interrupts = <0 78 0>;
|
||||
};
|
||||
|
||||
gpio: gpio {
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
};
|
||||
45
arch/arm/dts/exynos4210-origen.dts
Normal file
45
arch/arm/dts/exynos4210-origen.dts
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Samsung's Exynos4210 based Origen board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "skeleton.dtsi"
|
||||
/include/ "exynos4.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Insignal Origen evaluation board based on Exynos4210";
|
||||
compatible = "insignal,origen", "samsung,exynos4210";
|
||||
|
||||
chosen {
|
||||
bootargs ="";
|
||||
};
|
||||
|
||||
aliases {
|
||||
serial0 = "/serial@13800000";
|
||||
console = "/serial@13820000";
|
||||
mmc2 = "sdhci@12530000";
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x2008002 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
120
arch/arm/dts/exynos4210-trats.dts
Normal file
120
arch/arm/dts/exynos4210-trats.dts
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Samsung's Exynos4210 based Trats board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "exynos4.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung Trats based on Exynos4210";
|
||||
compatible = "samsung,trats", "samsung,exynos4210";
|
||||
|
||||
config {
|
||||
samsung,dsim-device-name = "s6e8ax0";
|
||||
};
|
||||
|
||||
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@13820000";
|
||||
mmc0 = "sdhci@12510000";
|
||||
mmc2 = "sdhci@12530000";
|
||||
};
|
||||
|
||||
fimd@11c00000 {
|
||||
compatible = "samsung,exynos-fimd";
|
||||
reg = <0x11c00000 0xa4>;
|
||||
|
||||
samsung,vl-freq = <60>;
|
||||
samsung,vl-col = <720>;
|
||||
samsung,vl-row = <1280>;
|
||||
samsung,vl-width = <720>;
|
||||
samsung,vl-height = <1280>;
|
||||
|
||||
samsung,vl-clkp = <0>;
|
||||
samsung,vl-oep = <0>;
|
||||
samsung,vl-hsp = <1>;
|
||||
samsung,vl-vsp = <1>;
|
||||
samsung,vl-dp = <1>;
|
||||
samsung,vl-bpix = <4>;
|
||||
|
||||
samsung,vl-hspw = <5>;
|
||||
samsung,vl-hbpd = <10>;
|
||||
samsung,vl-hfpd = <10>;
|
||||
samsung,vl-vspw = <2>;
|
||||
samsung,vl-vbpd = <1>;
|
||||
samsung,vl-vfpd = <13>;
|
||||
samsung,vl-cmd-allow-len = <0xf>;
|
||||
|
||||
samsung,winid = <3>;
|
||||
samsung,power-on-delay = <30>;
|
||||
samsung,interface-mode = <1>;
|
||||
samsung,mipi-enabled = <1>;
|
||||
samsung,dp-enabled;
|
||||
samsung,dual-lcd-enabled;
|
||||
|
||||
samsung,logo-on = <1>;
|
||||
samsung,resolution = <0>;
|
||||
samsung,rgb-mode = <0>;
|
||||
};
|
||||
|
||||
mipidsi@11c80000 {
|
||||
compatible = "samsung,exynos-mipi-dsi";
|
||||
reg = <0x11c80000 0x5c>;
|
||||
|
||||
samsung,dsim-config-e-interface = <1>;
|
||||
samsung,dsim-config-e-virtual-ch = <0>;
|
||||
samsung,dsim-config-e-pixel-format = <7>;
|
||||
samsung,dsim-config-e-burst-mode = <1>;
|
||||
samsung,dsim-config-e-no-data-lane = <3>;
|
||||
samsung,dsim-config-e-byte-clk = <0>;
|
||||
samsung,dsim-config-hfp = <1>;
|
||||
|
||||
samsung,dsim-config-p = <3>;
|
||||
samsung,dsim-config-m = <120>;
|
||||
samsung,dsim-config-s = <1>;
|
||||
|
||||
samsung,dsim-config-pll-stable-time = <500>;
|
||||
samsung,dsim-config-esc-clk = <20000000>;
|
||||
samsung,dsim-config-stop-holding-cnt = <0x7ff>;
|
||||
samsung,dsim-config-bta-timeout = <0xff>;
|
||||
samsung,dsim-config-rx-timeout = <0xffff>;
|
||||
|
||||
samsung,dsim-device-id = <0xffffffff>;
|
||||
samsung,dsim-device-bus-id = <0>;
|
||||
|
||||
samsung,dsim-device-reverse-panel = <1>;
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x2008002 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x20c6004 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
83
arch/arm/dts/exynos4210-universal_c210.dts
Normal file
83
arch/arm/dts/exynos4210-universal_c210.dts
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Samsung's Exynos4210 based Universal C210 board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "exynos4.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung Universal C210 based on Exynos4210 rev0";
|
||||
compatible = "samsung,universal_c210", "samsung,exynos4210";
|
||||
|
||||
aliases {
|
||||
serial0 = "/serial@13800000";
|
||||
console = "/serial@13820000";
|
||||
mmc0 = "sdhci@12510000";
|
||||
mmc2 = "sdhci@12530000";
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x2008002 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x20c6004 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
fimd@11c00000 {
|
||||
compatible = "samsung,exynos-fimd";
|
||||
reg = <0x11c00000 0xa4>;
|
||||
|
||||
samsung,vl-freq = <60>;
|
||||
samsung,vl-col = <480>;
|
||||
samsung,vl-row = <800>;
|
||||
samsung,vl-width = <480>;
|
||||
samsung,vl-height = <800>;
|
||||
|
||||
samsung,vl-clkp = <0>;
|
||||
samsung,vl-oep = <0>;
|
||||
samsung,vl-hsp = <1>;
|
||||
samsung,vl-vsp = <1>;
|
||||
samsung,vl-dp = <1>;
|
||||
samsung,vl-bpix = <4>;
|
||||
|
||||
samsung,vl-hspw = <2>;
|
||||
samsung,vl-hbpd = <16>;
|
||||
samsung,vl-hfpd = <16>;
|
||||
samsung,vl-vspw = <2>;
|
||||
samsung,vl-vbpd = <8>;
|
||||
samsung,vl-vfpd = <8>;
|
||||
samsung,vl-cmd-allow-len = <0xf>;
|
||||
|
||||
samsung,pclk_name = <1>;
|
||||
samsung,sclk_div = <1>;
|
||||
|
||||
samsung,winid = <0>;
|
||||
samsung,power-on-delay = <10000>;
|
||||
samsung,interface-mode = <1>;
|
||||
samsung,mipi-enabled = <0>;
|
||||
samsung,dp-enabled;
|
||||
samsung,dual-lcd-enabled;
|
||||
|
||||
samsung,logo-on = <1>;
|
||||
samsung,resolution = <0>;
|
||||
samsung,rgb-mode = <0>;
|
||||
};
|
||||
};
|
||||
434
arch/arm/dts/exynos4412-trats2.dts
Normal file
434
arch/arm/dts/exynos4412-trats2.dts
Normal file
@ -0,0 +1,434 @@
|
||||
/*
|
||||
* Samsung's Exynos4412 based Trats2 board device tree source
|
||||
*
|
||||
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/include/ "exynos4.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Samsung Trats2 based on Exynos4412";
|
||||
compatible = "samsung,trats2", "samsung,exynos4412";
|
||||
|
||||
config {
|
||||
samsung,dsim-device-name = "s6e8ax0";
|
||||
};
|
||||
|
||||
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@13820000";
|
||||
mmc0 = "sdhci@12510000";
|
||||
mmc2 = "sdhci@12530000";
|
||||
};
|
||||
|
||||
i2c@138d0000 {
|
||||
samsung,i2c-sda-delay = <100>;
|
||||
samsung,i2c-slave-addr = <0x10>;
|
||||
samsung,i2c-max-bus-freq = <100000>;
|
||||
status = "okay";
|
||||
|
||||
max77686_pmic@09 {
|
||||
compatible = "maxim,max77686_pmic";
|
||||
interrupts = <7 0>;
|
||||
reg = <0x09 0 0>;
|
||||
#clock-cells = <1>;
|
||||
|
||||
voltage-regulators {
|
||||
ldo1_reg: ldo1 {
|
||||
regulator-compatible = "LDO1";
|
||||
regulator-name = "VALIVE_1.0V_AP";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo2_reg: ldo2 {
|
||||
regulator-compatible = "LDO2";
|
||||
regulator-name = "VM1M2_1.2V_AP";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo3_reg: ldo3 {
|
||||
regulator-compatible = "LDO3";
|
||||
regulator-name = "VCC_1.8V_AP";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo4_reg: ldo4 {
|
||||
regulator-compatible = "LDO4";
|
||||
regulator-name = "VCC_2.8V_AP";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo5_reg: ldo5 {
|
||||
regulator-compatible = "LDO5";
|
||||
regulator-name = "VCC_1.8V_IO";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo6_reg: ldo6 {
|
||||
regulator-compatible = "LDO6";
|
||||
regulator-name = "VMPLL_1.0V_AP";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo7_reg: ldo7 {
|
||||
regulator-compatible = "LDO7";
|
||||
regulator-name = "VPLL_1.0V_AP";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-on;
|
||||
};
|
||||
|
||||
ldo8_reg: ldo8 {
|
||||
regulator-compatible = "LDO8";
|
||||
regulator-name = "VMIPI_1.0V";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo9_reg: ldo9 {
|
||||
regulator-compatible = "LDO9";
|
||||
regulator-name = "CAM_ISP_MIPI_1.2V";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo10_reg: ldo10 {
|
||||
regulator-compatible = "LDO10";
|
||||
regulator-name = "VMIPI_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo11_reg: ldo11 {
|
||||
regulator-compatible = "LDO11";
|
||||
regulator-name = "VABB1_1.95V";
|
||||
regulator-min-microvolt = <1950000>;
|
||||
regulator-max-microvolt = <1950000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo12_reg: ldo12 {
|
||||
regulator-compatible = "LDO12";
|
||||
regulator-name = "VUOTG_3.0V";
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo13_reg: ldo13 {
|
||||
regulator-compatible = "LDO13";
|
||||
regulator-name = "NFC_AVDD_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo14_reg: ldo14 {
|
||||
regulator-compatible = "LDO14";
|
||||
regulator-name = "VABB2_1.95V";
|
||||
regulator-min-microvolt = <1950000>;
|
||||
regulator-max-microvolt = <1950000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo15_reg: ldo15 {
|
||||
regulator-compatible = "LDO15";
|
||||
regulator-name = "VHSIC_1.0V";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1000000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo16_reg: ldo16 {
|
||||
regulator-compatible = "LDO16";
|
||||
regulator-name = "VHSIC_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo17_reg: ldo17 {
|
||||
regulator-compatible = "LDO17";
|
||||
regulator-name = "CAM_SENSOR_CORE_1.2V";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo18_reg: ldo18 {
|
||||
regulator-compatible = "LDO18";
|
||||
regulator-name = "CAM_ISP_SEN_IO_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo19_reg: ldo19 {
|
||||
regulator-compatible = "LDO19";
|
||||
regulator-name = "VT_CAM_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo20_reg: ldo20 {
|
||||
regulator-compatible = "LDO20";
|
||||
regulator-name = "VDDQ_PRE_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo21_reg: ldo21 {
|
||||
regulator-compatible = "LDO21";
|
||||
regulator-name = "VTF_2.8V";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo22_reg: ldo22 {
|
||||
regulator-compatible = "LDO22";
|
||||
regulator-name = "VMEM_VDD_2.8V";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
ldo23_reg: ldo23 {
|
||||
regulator-compatible = "LDO23";
|
||||
regulator-name = "TSP_AVDD_3.3V";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo24_reg: ldo24 {
|
||||
regulator-compatible = "LDO24";
|
||||
regulator-name = "TSP_VDD_1.8V";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo25_reg: ldo25 {
|
||||
regulator-compatible = "LDO25";
|
||||
regulator-name = "LCD_VCC_3.3V";
|
||||
regulator-min-microvolt = <2800000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
ldo26_reg: ldo26 {
|
||||
regulator-compatible = "LDO26";
|
||||
regulator-name = "MOTOR_VCC_3.0V";
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-mem-idle;
|
||||
};
|
||||
|
||||
buck1_reg: buck1 {
|
||||
regulator-compatible = "BUCK1";
|
||||
regulator-name = "vdd_mif";
|
||||
regulator-min-microvolt = <850000>;
|
||||
regulator-max-microvolt = <1100000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
buck2_reg: buck2 {
|
||||
regulator-compatible = "BUCK2";
|
||||
regulator-name = "vdd_arm";
|
||||
regulator-min-microvolt = <850000>;
|
||||
regulator-max-microvolt = <1500000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
buck3_reg: buck3 {
|
||||
regulator-compatible = "BUCK3";
|
||||
regulator-name = "vdd_int";
|
||||
regulator-min-microvolt = <850000>;
|
||||
regulator-max-microvolt = <1150000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
buck4_reg: buck4 {
|
||||
regulator-compatible = "BUCK4";
|
||||
regulator-name = "vdd_g3d";
|
||||
regulator-min-microvolt = <850000>;
|
||||
regulator-max-microvolt = <1150000>;
|
||||
regulator-boot-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
buck5_reg: buck5 {
|
||||
regulator-compatible = "BUCK5";
|
||||
regulator-name = "VMEM_1.2V_AP";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
buck6_reg: buck6 {
|
||||
regulator-compatible = "BUCK6";
|
||||
regulator-name = "VCC_SUB_1.35V";
|
||||
regulator-min-microvolt = <1350000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
buck7_reg: buck7 {
|
||||
regulator-compatible = "BUCK7";
|
||||
regulator-name = "VCC_SUB_2.0V";
|
||||
regulator-min-microvolt = <2000000>;
|
||||
regulator-max-microvolt = <2000000>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
buck8_reg: buck8 {
|
||||
regulator-compatible = "BUCK8";
|
||||
regulator-name = "VMEM_VDDF_3.0V";
|
||||
regulator-min-microvolt = <2850000>;
|
||||
regulator-max-microvolt = <2850000>;
|
||||
regulator-always-on;
|
||||
regulator-mem-off;
|
||||
};
|
||||
|
||||
buck9_reg: buck9 {
|
||||
regulator-compatible = "BUCK9";
|
||||
regulator-name = "CAM_ISP_CORE_1.2V";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <1200000>;
|
||||
regulator-mem-off;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fimd@11c00000 {
|
||||
compatible = "samsung,exynos-fimd";
|
||||
reg = <0x11c00000 0xa4>;
|
||||
|
||||
samsung,vl-freq = <60>;
|
||||
samsung,vl-col = <720>;
|
||||
samsung,vl-row = <1280>;
|
||||
samsung,vl-width = <720>;
|
||||
samsung,vl-height = <1280>;
|
||||
|
||||
samsung,vl-clkp = <0>;
|
||||
samsung,vl-oep = <0>;
|
||||
samsung,vl-hsp = <1>;
|
||||
samsung,vl-vsp = <1>;
|
||||
samsung,vl-dp = <1>;
|
||||
samsung,vl-bpix = <4>;
|
||||
|
||||
samsung,vl-hspw = <5>;
|
||||
samsung,vl-hbpd = <10>;
|
||||
samsung,vl-hfpd = <10>;
|
||||
samsung,vl-vspw = <2>;
|
||||
samsung,vl-vbpd = <1>;
|
||||
samsung,vl-vfpd = <13>;
|
||||
samsung,vl-cmd-allow-len = <0xf>;
|
||||
|
||||
samsung,winid = <0>;
|
||||
samsung,power-on-delay = <30>;
|
||||
samsung,interface-mode = <1>;
|
||||
samsung,mipi-enabled = <1>;
|
||||
samsung,dp-enabled;
|
||||
samsung,dual-lcd-enabled;
|
||||
|
||||
samsung,logo-on = <1>;
|
||||
samsung,resolution = <0>;
|
||||
samsung,rgb-mode = <0>;
|
||||
};
|
||||
|
||||
mipidsi@11c80000 {
|
||||
compatible = "samsung,exynos-mipi-dsi";
|
||||
reg = <0x11c80000 0x5c>;
|
||||
|
||||
samsung,dsim-config-e-interface = <1>;
|
||||
samsung,dsim-config-e-virtual-ch = <0>;
|
||||
samsung,dsim-config-e-pixel-format = <7>;
|
||||
samsung,dsim-config-e-burst-mode = <1>;
|
||||
samsung,dsim-config-e-no-data-lane = <3>;
|
||||
samsung,dsim-config-e-byte-clk = <0>;
|
||||
samsung,dsim-config-hfp = <1>;
|
||||
|
||||
samsung,dsim-config-p = <3>;
|
||||
samsung,dsim-config-m = <120>;
|
||||
samsung,dsim-config-s = <1>;
|
||||
|
||||
samsung,dsim-config-pll-stable-time = <500>;
|
||||
samsung,dsim-config-esc-clk = <20000000>;
|
||||
samsung,dsim-config-stop-holding-cnt = <0x7ff>;
|
||||
samsung,dsim-config-bta-timeout = <0xff>;
|
||||
samsung,dsim-config-rx-timeout = <0xffff>;
|
||||
|
||||
samsung,dsim-device-id = <0xffffffff>;
|
||||
samsung,dsim-device-bus-id = <0>;
|
||||
|
||||
samsung,dsim-device-reverse-panel = <1>;
|
||||
};
|
||||
|
||||
sdhci@12510000 {
|
||||
samsung,bus-width = <8>;
|
||||
samsung,timing = <1 3 3>;
|
||||
pwr-gpios = <&gpio 0x2004002 0>;
|
||||
};
|
||||
|
||||
sdhci@12520000 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sdhci@12530000 {
|
||||
samsung,bus-width = <4>;
|
||||
samsung,timing = <1 2 3>;
|
||||
cd-gpios = <&gpio 0x20C6004 0>;
|
||||
};
|
||||
|
||||
sdhci@12540000 {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
13
arch/arm/dts/imx6q-sabreauto.dts
Normal file
13
arch/arm/dts/imx6q-sabreauto.dts
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
+ * Copyright 2012 Freescale Semiconductor, Inc.
|
||||
+ * Copyright 2011 Linaro Ltd.
|
||||
+ *
|
||||
+ * SPDX-License-Identifier: GPL-2.0+
|
||||
+ */
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
model = "Freescale i.MX6 Quad SABRE Automotive Board";
|
||||
compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
|
||||
};
|
||||
@ -32,7 +32,7 @@ $(IMX_CONFIG): %.cfgtmp: % FORCE
|
||||
$(Q)mkdir -p $(dir $@)
|
||||
$(call if_changed_dep,cpp_cfg)
|
||||
|
||||
quiet_cmd_mkimage = UIMAGE $@
|
||||
quiet_cmd_mkimage = MKIMAGE $@
|
||||
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
@ -42,6 +42,14 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
|
||||
u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
ifeq ($(CONFIG_OF_SEPARATE),y)
|
||||
MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
|
||||
-e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) FORCE
|
||||
$(call if_changed,mkimage)
|
||||
endif
|
||||
|
||||
MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \
|
||||
-e $(CONFIG_SPL_TEXT_BASE)
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#if defined(CONFIG_TI816X)
|
||||
#define BOOT_DEVICE_XIP 2
|
||||
|
||||
@ -151,6 +151,7 @@ struct davinci_mmc {
|
||||
uint host_caps; /* Host capabilities */
|
||||
uint voltages; /* Host supported voltages */
|
||||
uint version; /* MMC Controller version */
|
||||
struct mmc_config cfg;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NAND 1
|
||||
#define BOOT_DEVICE_SPI 2
|
||||
|
||||
@ -14,4 +14,16 @@
|
||||
*/
|
||||
int exynos_init(void);
|
||||
|
||||
/*
|
||||
* Exynos board specific changes for
|
||||
* board_early_init_f
|
||||
*/
|
||||
int exynos_early_init_f(void);
|
||||
|
||||
/*
|
||||
* Exynos board specific changes for
|
||||
* board_power_init
|
||||
*/
|
||||
int exynos_power_init(void);
|
||||
|
||||
#endif /* EXYNOS_BOARD_H */
|
||||
|
||||
@ -25,8 +25,9 @@
|
||||
#define EXYNOS4_SYSTIMER_BASE 0x10050000
|
||||
#define EXYNOS4_WATCHDOG_BASE 0x10060000
|
||||
#define EXYNOS4_TZPC_BASE 0x10110000
|
||||
#define EXYNOS4_MIU_BASE 0x10600000
|
||||
#define EXYNOS4_DMC_CTRL_BASE 0x10400000
|
||||
#define EXYNOS4_MIU_BASE 0x10600000
|
||||
#define EXYNOS4_ACE_SFR_BASE 0x10830000
|
||||
#define EXYNOS4_GPIO_PART2_BASE 0x11000000
|
||||
#define EXYNOS4_GPIO_PART1_BASE 0x11400000
|
||||
#define EXYNOS4_FIMD_BASE 0x11C00000
|
||||
@ -48,7 +49,6 @@
|
||||
#define EXYNOS4_GPIO_PART4_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_DP_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_SPI_ISP_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_ACE_SFR_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_DMC_PHY_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_AUDIOSS_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4_USB_HOST_XHCI_BASE DEVICE_NOT_AVAILABLE
|
||||
@ -68,6 +68,7 @@
|
||||
#define EXYNOS4X12_TZPC_BASE 0x10110000
|
||||
#define EXYNOS4X12_DMC_CTRL_BASE 0x10600000
|
||||
#define EXYNOS4X12_GPIO_PART4_BASE 0x106E0000
|
||||
#define EXYNOS4X12_ACE_SFR_BASE 0x10830000
|
||||
#define EXYNOS4X12_GPIO_PART2_BASE 0x11000000
|
||||
#define EXYNOS4X12_GPIO_PART1_BASE 0x11400000
|
||||
#define EXYNOS4X12_FIMD_BASE 0x11C00000
|
||||
@ -87,7 +88,6 @@
|
||||
#define EXYNOS4X12_I2S_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_SPI_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_SPI_ISP_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_ACE_SFR_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_DMC_PHY_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_AUDIOSS_BASE DEVICE_NOT_AVAILABLE
|
||||
#define EXYNOS4X12_USB_HOST_XHCI_BASE DEVICE_NOT_AVAILABLE
|
||||
@ -106,7 +106,7 @@
|
||||
#define EXYNOS5_SYSREG_BASE 0x10050000
|
||||
#define EXYNOS5_TZPC_BASE 0x10100000
|
||||
#define EXYNOS5_WATCHDOG_BASE 0x101D0000
|
||||
#define EXYNOS5_ACE_SFR_BASE 0x10830000
|
||||
#define EXYNOS5_ACE_SFR_BASE 0x10830000
|
||||
#define EXYNOS5_DMC_PHY_BASE 0x10C00000
|
||||
#define EXYNOS5_GPIO_PART3_BASE 0x10D10000
|
||||
#define EXYNOS5_DMC_CTRL_BASE 0x10DD0000
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include <linux/list.h>
|
||||
#include <linux/fb.h>
|
||||
#include <lcd.h>
|
||||
|
||||
#define PANEL_NAME_SIZE (32)
|
||||
|
||||
@ -368,8 +369,12 @@ int exynos_mipi_dsi_register_lcd_device(struct mipi_dsim_lcd_device
|
||||
*lcd_dev);
|
||||
|
||||
void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd);
|
||||
void exynos_init_dsim_platform_data(vidinfo_t *vid);
|
||||
|
||||
/* panel driver init based on mipi dsi interface */
|
||||
void s6e8ax0_init(void);
|
||||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
extern int mipi_power(void);
|
||||
#endif
|
||||
#endif /* _DSIM_H */
|
||||
|
||||
@ -53,6 +53,8 @@
|
||||
#define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
|
||||
#define SDHCI_CTRL4_DRIVE_SHIFT (16)
|
||||
|
||||
#define SDHCI_MAX_HOSTS 4
|
||||
|
||||
int s5p_sdhci_init(u32 regbase, int index, int bus_width);
|
||||
|
||||
static inline int s5p_mmc_init(int index, int bus_width)
|
||||
@ -62,4 +64,9 @@ static inline int s5p_mmc_init(int index, int bus_width)
|
||||
|
||||
return s5p_sdhci_init(base, index, bus_width);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF_CONTROL
|
||||
int exynos_mmc_init(const void *blob);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
* CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
|
||||
*/
|
||||
#ifndef CONFIG_SYS_KWD_CONFIG
|
||||
#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
|
||||
#define CONFIG_SYS_KWD_CONFIG $(CONFIG_BOARDDIR)/kwbimage.cfg
|
||||
#endif /* CONFIG_SYS_KWD_CONFIG */
|
||||
|
||||
/* Kirkwood has 2k of Security SRAM, use it for SP */
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NONE 0
|
||||
#define BOOT_DEVICE_XIP 1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NONE 0
|
||||
#define BOOT_DEVICE_XIP 1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NONE 0
|
||||
#define BOOT_DEVICE_XIP 1
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
#ifndef _ASM_ARCH_SPL_H_
|
||||
#define _ASM_SPL_H_
|
||||
#define _ASM_ARCH_SPL_H_
|
||||
|
||||
#define BOOT_DEVICE_NONE 0
|
||||
#define BOOT_DEVICE_XIP 1
|
||||
|
||||
205
arch/arm/include/asm/arch-socfpga/clock_manager.h
Normal file
205
arch/arm/include/asm/arch-socfpga/clock_manager.h
Normal file
@ -0,0 +1,205 @@
|
||||
/*
|
||||
* Copyright (C) 2013 Altera Corporation <www.altera.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _CLOCK_MANAGER_H_
|
||||
#define _CLOCK_MANAGER_H_
|
||||
|
||||
typedef struct {
|
||||
/* main group */
|
||||
uint32_t main_vco_base;
|
||||
uint32_t mpuclk;
|
||||
uint32_t mainclk;
|
||||
uint32_t dbgatclk;
|
||||
uint32_t mainqspiclk;
|
||||
uint32_t mainnandsdmmcclk;
|
||||
uint32_t cfg2fuser0clk;
|
||||
uint32_t maindiv;
|
||||
uint32_t dbgdiv;
|
||||
uint32_t tracediv;
|
||||
uint32_t l4src;
|
||||
|
||||
/* peripheral group */
|
||||
uint32_t peri_vco_base;
|
||||
uint32_t emac0clk;
|
||||
uint32_t emac1clk;
|
||||
uint32_t perqspiclk;
|
||||
uint32_t pernandsdmmcclk;
|
||||
uint32_t perbaseclk;
|
||||
uint32_t s2fuser1clk;
|
||||
uint32_t perdiv;
|
||||
uint32_t gpiodiv;
|
||||
uint32_t persrc;
|
||||
|
||||
/* sdram pll group */
|
||||
uint32_t sdram_vco_base;
|
||||
uint32_t ddrdqsclk;
|
||||
uint32_t ddr2xdqsclk;
|
||||
uint32_t ddrdqclk;
|
||||
uint32_t s2fuser2clk;
|
||||
} cm_config_t;
|
||||
|
||||
extern void cm_basic_init(const cm_config_t *cfg);
|
||||
|
||||
struct socfpga_clock_manager {
|
||||
u32 ctrl;
|
||||
u32 bypass;
|
||||
u32 inter;
|
||||
u32 intren;
|
||||
u32 dbctrl;
|
||||
u32 stat;
|
||||
u32 _pad_0x18_0x3f[10];
|
||||
u32 mainpllgrp;
|
||||
u32 perpllgrp;
|
||||
u32 sdrpllgrp;
|
||||
u32 _pad_0xe0_0x200[72];
|
||||
|
||||
u32 main_pll_vco;
|
||||
u32 main_pll_misc;
|
||||
u32 main_pll_mpuclk;
|
||||
u32 main_pll_mainclk;
|
||||
u32 main_pll_dbgatclk;
|
||||
u32 main_pll_mainqspiclk;
|
||||
u32 main_pll_mainnandsdmmcclk;
|
||||
u32 main_pll_cfgs2fuser0clk;
|
||||
u32 main_pll_en;
|
||||
u32 main_pll_maindiv;
|
||||
u32 main_pll_dbgdiv;
|
||||
u32 main_pll_tracediv;
|
||||
u32 main_pll_l4src;
|
||||
u32 main_pll_stat;
|
||||
u32 main_pll__pad_0x38_0x40[2];
|
||||
|
||||
u32 per_pll_vco;
|
||||
u32 per_pll_misc;
|
||||
u32 per_pll_emac0clk;
|
||||
u32 per_pll_emac1clk;
|
||||
u32 per_pll_perqspiclk;
|
||||
u32 per_pll_pernandsdmmcclk;
|
||||
u32 per_pll_perbaseclk;
|
||||
u32 per_pll_s2fuser1clk;
|
||||
u32 per_pll_en;
|
||||
u32 per_pll_div;
|
||||
u32 per_pll_gpiodiv;
|
||||
u32 per_pll_src;
|
||||
u32 per_pll_stat;
|
||||
u32 per_pll__pad_0x34_0x40[3];
|
||||
|
||||
u32 sdr_pll_vco;
|
||||
u32 sdr_pll_ctrl;
|
||||
u32 sdr_pll_ddrdqsclk;
|
||||
u32 sdr_pll_ddr2xdqsclk;
|
||||
u32 sdr_pll_ddrdqclk;
|
||||
u32 sdr_pll_s2fuser2clk;
|
||||
u32 sdr_pll_en;
|
||||
u32 sdr_pll_stat;
|
||||
};
|
||||
|
||||
#define CLKMGR_MAINPLLGRP_EN_S2FUSER0CLK_MASK 0x00000200
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGTIMERCLK_MASK 0x00000080
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGTRACECLK_MASK 0x00000040
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGCLK_MASK 0x00000020
|
||||
#define CLKMGR_MAINPLLGRP_EN_DBGATCLK_MASK 0x00000010
|
||||
#define CLKMGR_MAINPLLGRP_EN_L4MPCLK_MASK 0x00000004
|
||||
#define CLKMGR_MAINPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
#define CLKMGR_PERPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
#define CLKMGR_SDRPLLGRP_VCO_RESET_VALUE 0x8001000d
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4MPCLK_SET(x) (((x) << 4) & 0x00000070)
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L4SPCLK_SET(x) (((x) << 7) & 0x00000380)
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4MP_SET(x) (((x) << 0) & 0x00000001)
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_L4SP_SET(x) (((x) << 1) & 0x00000002)
|
||||
#define CLKMGR_PERPLLGRP_SRC_QSPI_SET(x) (((x) << 4) & 0x00000030)
|
||||
#define CLKMGR_PERPLLGRP_SRC_NAND_SET(x) (((x) << 2) & 0x0000000c)
|
||||
#define CLKMGR_PERPLLGRP_SRC_SDMMC_SET(x) (((x) << 0) & 0x00000003)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_DENOM_SET(x) (((x) << 16) & 0x003f0000)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_NUMER_SET(x) (((x) << 3) & 0x0000fff8)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_PWRDN_SET(x) (((x) << 2) & 0x00000004)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_EN_SET(x) (((x) << 1) & 0x00000002)
|
||||
#define CLKMGR_MAINPLLGRP_VCO_BGPWRDN_SET(x) (((x) << 0) & 0x00000001)
|
||||
#define CLKMGR_PERPLLGRP_VCO_PSRC_SET(x) (((x) << 22) & 0x00c00000)
|
||||
#define CLKMGR_PERPLLGRP_VCO_DENOM_SET(x) (((x) << 16) & 0x003f0000)
|
||||
#define CLKMGR_PERPLLGRP_VCO_NUMER_SET(x) (((x) << 3) & 0x0000fff8)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESET_SET(x) (((x) << 25) & 0x7e000000)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(x) (((x) << 24) & 0x01000000)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_SSRC_SET(x) (((x) << 22) & 0x00c00000)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_DENOM_SET(x) (((x) << 16) & 0x003f0000)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_NUMER_SET(x) (((x) << 3) & 0x0000fff8)
|
||||
#define CLKMGR_MAINPLLGRP_MPUCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_MAINCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_DBGATCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_CFGS2FUSER0CLK_CNT_SET(x) \
|
||||
(((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_EMAC0CLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_EMAC1CLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_MAINQSPICLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_MAINNANDSDMMCCLK_CNT_SET(x) \
|
||||
(((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_PERBASECLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_S2FUSER1CLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_PERNANDSDMMCCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_SET(x) (((x) << 9) & 0x00000e00)
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_SET(x) (((x) << 9) & 0x00000e00)
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_SET(x) (((x) << 9) & 0x00000e00)
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_SET(x) (((x) << 9) & 0x00000e00)
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGCLK_SET(x) (((x) << 2) & 0x0000000c)
|
||||
#define CLKMGR_MAINPLLGRP_DBGDIV_DBGATCLK_SET(x) (((x) << 0) & 0x00000003)
|
||||
#define CLKMGR_MAINPLLGRP_TRACEDIV_TRACECLK_SET(x) (((x) << 0) & 0x00000007)
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3MPCLK_SET(x) (((x) << 0) & 0x00000003)
|
||||
#define CLKMGR_MAINPLLGRP_MAINDIV_L3SPCLK_SET(x) (((x) << 2) & 0x0000000c)
|
||||
#define CLKMGR_BYPASS_PERPLL_SET(x) (((x) << 3) & 0x00000008)
|
||||
#define CLKMGR_BYPASS_SDRPLL_SET(x) (((x) << 1) & 0x00000002)
|
||||
#define CLKMGR_BYPASS_MAINPLL_SET(x) (((x) << 0) & 0x00000001)
|
||||
#define CLKMGR_PERPLLGRP_DIV_USBCLK_SET(x) (((x) << 0) & 0x00000007)
|
||||
#define CLKMGR_PERPLLGRP_DIV_SPIMCLK_SET(x) (((x) << 3) & 0x00000038)
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN0CLK_SET(x) (((x) << 6) & 0x000001c0)
|
||||
#define CLKMGR_PERPLLGRP_DIV_CAN1CLK_SET(x) (((x) << 9) & 0x00000e00)
|
||||
#define CLKMGR_INTER_SDRPLLLOCKED_MASK 0x00000100
|
||||
#define CLKMGR_INTER_PERPLLLOCKED_MASK 0x00000080
|
||||
#define CLKMGR_INTER_MAINPLLLOCKED_MASK 0x00000040
|
||||
#define CLKMGR_CTRL_SAFEMODE_MASK 0x00000001
|
||||
#define CLKMGR_CTRL_SAFEMODE_SET(x) (((x) << 0) & 0x00000001)
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESET_MASK 0x7e000000
|
||||
#define CLKMGR_SDRPLLGRP_VCO_OUTRESETALL_SET(x) (((x) << 24) & 0x01000000)
|
||||
#define CLKMGR_PERPLLGRP_PERQSPICLK_CNT_SET(x) (((x) << 0) & 0x000001ff)
|
||||
#define CLKMGR_PERPLLGRP_DIV_SPIMCLK_SET(x) (((x) << 3) & 0x00000038)
|
||||
#define CLKMGR_PERPLLGRP_GPIODIV_GPIODBCLK_SET(x) (((x) << 0) & 0x00ffffff)
|
||||
#define CLKMGR_BYPASS_PERPLLSRC_SET(x) (((x) << 4) & 0x00000010)
|
||||
#define CLKMGR_BYPASS_SDRPLLSRC_SET(x) (((x) << 2) & 0x00000004)
|
||||
#define CLKMGR_PERPLLGRP_SRC_RESET_VALUE 0x00000015
|
||||
#define CLKMGR_MAINPLLGRP_L4SRC_RESET_VALUE 0x00000000
|
||||
#define CLKMGR_MAINPLLGRP_VCO_REGEXTSEL_MASK 0x80000000
|
||||
#define CLKMGR_PERPLLGRP_VCO_REGEXTSEL_MASK 0x80000000
|
||||
#define CLKMGR_SDRPLLGRP_VCO_REGEXTSEL_MASK 0x80000000
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_PHASE_MASK 0x001ffe00
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_PHASE_MASK 0x001ffe00
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_PHASE_MASK 0x001ffe00
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_PHASE_MASK 0x001ffe00
|
||||
#define CLKMGR_MAINPLLGRP_VCO_OUTRESETALL_MASK 0x01000000
|
||||
#define CLKMGR_PERPLLGRP_VCO_OUTRESETALL_MASK 0x01000000
|
||||
#define CLKMGR_PERPLLGRP_EN_NANDCLK_MASK 0x00000400
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQSCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_DDR2XDQSCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_DDRDQCLK_CNT_MASK 0x000001ff
|
||||
#define CLKMGR_SDRPLLGRP_S2FUSER2CLK_CNT_MASK 0x000001ff
|
||||
|
||||
#define MAIN_VCO_BASE \
|
||||
(CLKMGR_MAINPLLGRP_VCO_DENOM_SET(CONFIG_HPS_MAINPLLGRP_VCO_DENOM) | \
|
||||
CLKMGR_MAINPLLGRP_VCO_NUMER_SET(CONFIG_HPS_MAINPLLGRP_VCO_NUMER))
|
||||
|
||||
#define PERI_VCO_BASE \
|
||||
(CLKMGR_PERPLLGRP_VCO_PSRC_SET(CONFIG_HPS_PERPLLGRP_VCO_PSRC) | \
|
||||
CLKMGR_PERPLLGRP_VCO_DENOM_SET(CONFIG_HPS_PERPLLGRP_VCO_DENOM) | \
|
||||
CLKMGR_PERPLLGRP_VCO_NUMER_SET(CONFIG_HPS_PERPLLGRP_VCO_NUMER))
|
||||
|
||||
#define SDR_VCO_BASE \
|
||||
(CLKMGR_SDRPLLGRP_VCO_SSRC_SET(CONFIG_HPS_SDRPLLGRP_VCO_SSRC) | \
|
||||
CLKMGR_SDRPLLGRP_VCO_DENOM_SET(CONFIG_HPS_SDRPLLGRP_VCO_DENOM) | \
|
||||
CLKMGR_SDRPLLGRP_VCO_NUMER_SET(CONFIG_HPS_SDRPLLGRP_VCO_NUMER))
|
||||
|
||||
#endif /* _CLOCK_MANAGER_H_ */
|
||||
@ -11,6 +11,7 @@
|
||||
#define SOCFPGA_UART0_ADDRESS 0xffc02000
|
||||
#define SOCFPGA_UART1_ADDRESS 0xffc03000
|
||||
#define SOCFPGA_OSC1TIMER0_ADDRESS 0xffd00000
|
||||
#define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
|
||||
#define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
|
||||
#define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
|
||||
|
||||
|
||||
@ -11,6 +11,9 @@
|
||||
|
||||
#include <fdtdec.h>
|
||||
|
||||
/* for mmc_config definition */
|
||||
#include <mmc.h>
|
||||
|
||||
#define MAX_HOSTS 4 /* Max number of 'hosts'/controllers */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
@ -138,6 +141,7 @@ struct mmc_host {
|
||||
struct fdt_gpio_state wp_gpio; /* Write Protect GPIO */
|
||||
unsigned int version; /* SDHCI spec. version */
|
||||
unsigned int clock; /* Current clock (MHz) */
|
||||
struct mmc_config cfg; /* mmc configuration */
|
||||
};
|
||||
|
||||
void pad_init_mmc(struct mmc_host *host);
|
||||
|
||||
@ -55,57 +55,59 @@ struct ccm_reg {
|
||||
|
||||
/* Analog components control digital interface (ANADIG) */
|
||||
struct anadig_reg {
|
||||
u32 reserved_0x000[4];
|
||||
u32 pll3_ctrl;
|
||||
u32 resv0[3];
|
||||
u32 reserved_0x014[3];
|
||||
u32 pll7_ctrl;
|
||||
u32 resv1[3];
|
||||
u32 reserved_0x024[3];
|
||||
u32 pll2_ctrl;
|
||||
u32 resv2[3];
|
||||
u32 reserved_0x034[3];
|
||||
u32 pll2_ss;
|
||||
u32 resv3[3];
|
||||
u32 reserved_0x044[3];
|
||||
u32 pll2_num;
|
||||
u32 resv4[3];
|
||||
u32 reserved_0x054[3];
|
||||
u32 pll2_denom;
|
||||
u32 resv5[3];
|
||||
u32 reserved_0x064[3];
|
||||
u32 pll4_ctrl;
|
||||
u32 resv6[3];
|
||||
u32 reserved_0x074[3];
|
||||
u32 pll4_num;
|
||||
u32 resv7[3];
|
||||
u32 reserved_0x084[3];
|
||||
u32 pll4_denom;
|
||||
u32 reserved_0x094[3];
|
||||
u32 pll6_ctrl;
|
||||
u32 resv8[3];
|
||||
u32 reserved_0x0A4[3];
|
||||
u32 pll6_num;
|
||||
u32 resv9[3];
|
||||
u32 reserved_0x0B4[3];
|
||||
u32 pll6_denom;
|
||||
u32 resv10[3];
|
||||
u32 reserved_0x0C4[7];
|
||||
u32 pll5_ctrl;
|
||||
u32 resv11[3];
|
||||
u32 reserved_0x0E4[3];
|
||||
u32 pll3_pfd;
|
||||
u32 resv12[3];
|
||||
u32 reserved_0x0F4[3];
|
||||
u32 pll2_pfd;
|
||||
u32 resv13[3];
|
||||
u32 reserved_0x104[3];
|
||||
u32 reg_1p1;
|
||||
u32 resv14[3];
|
||||
u32 reserved_0x114[3];
|
||||
u32 reg_3p0;
|
||||
u32 resv15[3];
|
||||
u32 reserved_0x124[3];
|
||||
u32 reg_2p5;
|
||||
u32 resv16[7];
|
||||
u32 reserved_0x134[7];
|
||||
u32 ana_misc0;
|
||||
u32 resv17[3];
|
||||
u32 reserved_0x154[3];
|
||||
u32 ana_misc1;
|
||||
u32 resv18[63];
|
||||
u32 reserved_0x164[63];
|
||||
u32 anadig_digprog;
|
||||
u32 resv19[3];
|
||||
u32 reserved_0x264[3];
|
||||
u32 pll1_ctrl;
|
||||
u32 resv20[3];
|
||||
u32 reserved_0x274[3];
|
||||
u32 pll1_ss;
|
||||
u32 resv21[3];
|
||||
u32 reserved_0x284[3];
|
||||
u32 pll1_num;
|
||||
u32 resv22[3];
|
||||
u32 reserved_0x294[3];
|
||||
u32 pll1_denom;
|
||||
u32 resv23[3];
|
||||
u32 reserved_0x2A4[3];
|
||||
u32 pll1_pdf;
|
||||
u32 resv24[3];
|
||||
u32 reserved_0x2B4[3];
|
||||
u32 pll_lock;
|
||||
};
|
||||
#endif
|
||||
@ -164,6 +166,7 @@ struct anadig_reg {
|
||||
#define CCM_CSCMR2_RMII_CLK_SEL(v) (((v) & 0x3) << 4)
|
||||
|
||||
#define CCM_REG_CTRL_MASK 0xffffffff
|
||||
#define CCM_CCGR0_UART0_CTRL_MASK (0x3 << 14)
|
||||
#define CCM_CCGR0_UART1_CTRL_MASK (0x3 << 16)
|
||||
#define CCM_CCGR1_PIT_CTRL_MASK (0x3 << 14)
|
||||
#define CCM_CCGR1_WDOGA5_CTRL_MASK (0x3 << 28)
|
||||
@ -184,6 +187,10 @@ struct anadig_reg {
|
||||
#define CCM_CCGR9_FEC0_CTRL_MASK 0x3
|
||||
#define CCM_CCGR9_FEC1_CTRL_MASK (0x3 << 2)
|
||||
|
||||
#define ANADIG_PLL5_CTRL_BYPASS (1 << 16)
|
||||
#define ANADIG_PLL5_CTRL_ENABLE (1 << 13)
|
||||
#define ANADIG_PLL5_CTRL_POWERDOWN (1 << 12)
|
||||
#define ANADIG_PLL5_CTRL_DIV_SELECT 1
|
||||
#define ANADIG_PLL2_CTRL_ENABLE (1 << 13)
|
||||
#define ANADIG_PLL2_CTRL_POWERDOWN (1 << 12)
|
||||
#define ANADIG_PLL2_CTRL_DIV_SELECT 1
|
||||
|
||||
@ -85,6 +85,7 @@
|
||||
#define ESDHC0_BASE_ADDR (AIPS1_BASE_ADDR + 0x00031000)
|
||||
#define ESDHC1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00032000)
|
||||
#define ENET_BASE_ADDR (AIPS1_BASE_ADDR + 0x00050000)
|
||||
#define ENET1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00051000)
|
||||
|
||||
/* MUX mode and PAD ctrl are in one register */
|
||||
#define CONFIG_IOMUX_SHARE_CONF_REG
|
||||
|
||||
@ -22,8 +22,11 @@
|
||||
|
||||
enum {
|
||||
VF610_PAD_PTA6__RMII0_CLKIN = IOMUX_PAD(0x0000, 0x0000, 2, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTA6__RMII0_CLKOUT = IOMUX_PAD(0x0000, 0x0000, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTB4__UART1_TX = IOMUX_PAD(0x0068, 0x0068, 2, 0x0380, 0, VF610_UART_PAD_CTRL),
|
||||
VF610_PAD_PTB5__UART1_RX = IOMUX_PAD(0x006c, 0x006c, 2, 0x037c, 0, VF610_UART_PAD_CTRL),
|
||||
VF610_PAD_PTB10__UART0_TX = IOMUX_PAD(0x0080, 0x0080, 1, __NA_, 0, VF610_UART_PAD_CTRL),
|
||||
VF610_PAD_PTB11__UART0_RX = IOMUX_PAD(0x0084, 0x0084, 1, __NA_, 0, VF610_UART_PAD_CTRL),
|
||||
VF610_PAD_PTC1__RMII0_MDIO = IOMUX_PAD(0x00b8, 0x00b8, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC0__RMII0_MDC = IOMUX_PAD(0x00b4, 0x00b4, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC2__RMII0_CRS_DV = IOMUX_PAD(0x00bc, 0x00bc, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
@ -33,6 +36,15 @@ enum {
|
||||
VF610_PAD_PTC6__RMII0_TD1 = IOMUX_PAD(0x00cc, 0x00cc, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC7__RMII0_TD0 = IOMUX_PAD(0x00D0, 0x00D0, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC8__RMII0_TXEN = IOMUX_PAD(0x00D4, 0x00D4, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC10__RMII1_MDIO = IOMUX_PAD(0x00dc, 0x00dc, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC9__RMII1_MDC = IOMUX_PAD(0x00d8, 0x00d8, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC11__RMII1_CRS_DV = IOMUX_PAD(0x00e0, 0x00e0, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC12__RMII1_RD1 = IOMUX_PAD(0x00e4, 0x00e4, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC13__RMII1_RD0 = IOMUX_PAD(0x00e8, 0x00e8, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC14__RMII1_RXER = IOMUX_PAD(0x00ec, 0x00ec, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC15__RMII1_TD1 = IOMUX_PAD(0x00f0, 0x00f0, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC16__RMII1_TD0 = IOMUX_PAD(0x00f4, 0x00f4, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTC17__RMII1_TXEN = IOMUX_PAD(0x00f8, 0x00f8, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
|
||||
VF610_PAD_PTA24__ESDHC1_CLK = IOMUX_PAD(0x0038, 0x0038, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
|
||||
VF610_PAD_PTA25__ESDHC1_CMD = IOMUX_PAD(0x003c, 0x003c, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
|
||||
VF610_PAD_PTA26__ESDHC1_DAT0 = IOMUX_PAD(0x0040, 0x0040, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
|
||||
|
||||
@ -51,4 +51,60 @@
|
||||
#define GICC_IIDR 0x00fc
|
||||
#define GICC_DIR 0x1000
|
||||
|
||||
/* ReDistributor Registers for Control and Physical LPIs */
|
||||
#define GICR_CTLR 0x0000
|
||||
#define GICR_IIDR 0x0004
|
||||
#define GICR_TYPER 0x0008
|
||||
#define GICR_STATUSR 0x0010
|
||||
#define GICR_WAKER 0x0014
|
||||
#define GICR_SETLPIR 0x0040
|
||||
#define GICR_CLRLPIR 0x0048
|
||||
#define GICR_SEIR 0x0068
|
||||
#define GICR_PROPBASER 0x0070
|
||||
#define GICR_PENDBASER 0x0078
|
||||
#define GICR_INVLPIR 0x00a0
|
||||
#define GICR_INVALLR 0x00b0
|
||||
#define GICR_SYNCR 0x00c0
|
||||
#define GICR_MOVLPIR 0x0100
|
||||
#define GICR_MOVALLR 0x0110
|
||||
|
||||
/* ReDistributor Registers for SGIs and PPIs */
|
||||
#define GICR_IGROUPRn 0x0080
|
||||
#define GICR_ISENABLERn 0x0100
|
||||
#define GICR_ICENABLERn 0x0180
|
||||
#define GICR_ISPENDRn 0x0200
|
||||
#define GICR_ICPENDRn 0x0280
|
||||
#define GICR_ISACTIVERn 0x0300
|
||||
#define GICR_ICACTIVERn 0x0380
|
||||
#define GICR_IPRIORITYRn 0x0400
|
||||
#define GICR_ICFGR0 0x0c00
|
||||
#define GICR_ICFGR1 0x0c04
|
||||
#define GICR_IGROUPMODRn 0x0d00
|
||||
#define GICR_NSACRn 0x0e00
|
||||
|
||||
/* Cpu Interface System Registers */
|
||||
#define ICC_IAR0_EL1 S3_0_C12_C8_0
|
||||
#define ICC_IAR1_EL1 S3_0_C12_C12_0
|
||||
#define ICC_EOIR0_EL1 S3_0_C12_C8_1
|
||||
#define ICC_EOIR1_EL1 S3_0_C12_C12_1
|
||||
#define ICC_HPPIR0_EL1 S3_0_C12_C8_2
|
||||
#define ICC_HPPIR1_EL1 S3_0_C12_C12_2
|
||||
#define ICC_BPR0_EL1 S3_0_C12_C8_3
|
||||
#define ICC_BPR1_EL1 S3_0_C12_C12_3
|
||||
#define ICC_DIR_EL1 S3_0_C12_C11_1
|
||||
#define ICC_PMR_EL1 S3_0_C4_C6_0
|
||||
#define ICC_RPR_EL1 S3_0_C12_C11_3
|
||||
#define ICC_CTLR_EL1 S3_0_C12_C12_4
|
||||
#define ICC_CTLR_EL3 S3_6_C12_C12_4
|
||||
#define ICC_SRE_EL1 S3_0_C12_C12_5
|
||||
#define ICC_SRE_EL2 S3_4_C12_C9_5
|
||||
#define ICC_SRE_EL3 S3_6_C12_C12_5
|
||||
#define ICC_IGRPEN0_EL1 S3_0_C12_C12_6
|
||||
#define ICC_IGRPEN1_EL1 S3_0_C12_C12_7
|
||||
#define ICC_IGRPEN1_EL3 S3_6_C12_C12_7
|
||||
#define ICC_SEIEN_EL1 S3_0_C12_C13_0
|
||||
#define ICC_SGI0R_EL1 S3_0_C12_C11_7
|
||||
#define ICC_SGI1R_EL1 S3_0_C12_C11_5
|
||||
#define ICC_ASGI1R_EL1 S3_0_C12_C11_6
|
||||
|
||||
#endif /* __GIC_H__ */
|
||||
|
||||
@ -66,6 +66,7 @@ static inline void set_sctlr(unsigned int val)
|
||||
}
|
||||
|
||||
void __asm_flush_dcache_all(void);
|
||||
void __asm_invalidate_dcache_all(void);
|
||||
void __asm_flush_dcache_range(u64 start, u64 end);
|
||||
void __asm_invalidate_tlb_all(void);
|
||||
void __asm_invalidate_icache_all(void);
|
||||
|
||||
@ -35,6 +35,7 @@ endif
|
||||
|
||||
obj-y += sections.o
|
||||
ifdef CONFIG_ARM64
|
||||
obj-y += gic_64.o
|
||||
obj-y += interrupts_64.o
|
||||
else
|
||||
obj-y += interrupts.o
|
||||
|
||||
248
arch/arm/lib/asm-offsets.c
Normal file
248
arch/arm/lib/asm-offsets.c
Normal file
@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* This program is used to generate definitions needed by
|
||||
* assembly language modules.
|
||||
*
|
||||
* We use the technique used in the OSF Mach kernel code:
|
||||
* generate asm statements containing #defines,
|
||||
* compile this file to assembler, and then extract the
|
||||
* #defines from the assembly-language output.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
#if defined(CONFIG_MB86R0x)
|
||||
#include <asm/arch/mb86r0x.h>
|
||||
#endif
|
||||
#if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35) \
|
||||
|| defined(CONFIG_MX51) || defined(CONFIG_MX53)
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* TODO : Check if each entry in this file is really necessary.
|
||||
* - struct mb86r0x_ddr2
|
||||
* - struct mb86r0x_memc
|
||||
* - struct esdramc_regs
|
||||
* - struct max_regs
|
||||
* - struct aips_regs
|
||||
* - struct aipi_regs
|
||||
* - struct clkctl
|
||||
* - struct dpll
|
||||
* are used only for generating asm-offsets.h.
|
||||
* It means their offset addresses are referenced only from assembly
|
||||
* code. Is it better to define the macros directly in headers?
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_MB86R0x)
|
||||
/* ddr2 controller */
|
||||
DEFINE(DDR2_DRIC, offsetof(struct mb86r0x_ddr2c, dric));
|
||||
DEFINE(DDR2_DRIC1, offsetof(struct mb86r0x_ddr2c, dric1));
|
||||
DEFINE(DDR2_DRIC2, offsetof(struct mb86r0x_ddr2c, dric2));
|
||||
DEFINE(DDR2_DRCA, offsetof(struct mb86r0x_ddr2c, drca));
|
||||
DEFINE(DDR2_DRCM, offsetof(struct mb86r0x_ddr2c, drcm));
|
||||
DEFINE(DDR2_DRCST1, offsetof(struct mb86r0x_ddr2c, drcst1));
|
||||
DEFINE(DDR2_DRCST2, offsetof(struct mb86r0x_ddr2c, drcst2));
|
||||
DEFINE(DDR2_DRCR, offsetof(struct mb86r0x_ddr2c, drcr));
|
||||
DEFINE(DDR2_DRCF, offsetof(struct mb86r0x_ddr2c, drcf));
|
||||
DEFINE(DDR2_DRASR, offsetof(struct mb86r0x_ddr2c, drasr));
|
||||
DEFINE(DDR2_DRIMS, offsetof(struct mb86r0x_ddr2c, drims));
|
||||
DEFINE(DDR2_DROS, offsetof(struct mb86r0x_ddr2c, dros));
|
||||
DEFINE(DDR2_DRIBSODT1, offsetof(struct mb86r0x_ddr2c, dribsodt1));
|
||||
DEFINE(DDR2_DROABA, offsetof(struct mb86r0x_ddr2c, droaba));
|
||||
DEFINE(DDR2_DROBS, offsetof(struct mb86r0x_ddr2c, drobs));
|
||||
|
||||
/* clock reset generator */
|
||||
DEFINE(CRG_CRPR, offsetof(struct mb86r0x_crg, crpr));
|
||||
DEFINE(CRG_CRHA, offsetof(struct mb86r0x_crg, crha));
|
||||
DEFINE(CRG_CRPA, offsetof(struct mb86r0x_crg, crpa));
|
||||
DEFINE(CRG_CRPB, offsetof(struct mb86r0x_crg, crpb));
|
||||
DEFINE(CRG_CRHB, offsetof(struct mb86r0x_crg, crhb));
|
||||
DEFINE(CRG_CRAM, offsetof(struct mb86r0x_crg, cram));
|
||||
|
||||
/* chip control module */
|
||||
DEFINE(CCNT_CDCRC, offsetof(struct mb86r0x_ccnt, cdcrc));
|
||||
|
||||
/* external bus interface */
|
||||
DEFINE(MEMC_MCFMODE0, offsetof(struct mb86r0x_memc, mcfmode[0]));
|
||||
DEFINE(MEMC_MCFMODE2, offsetof(struct mb86r0x_memc, mcfmode[2]));
|
||||
DEFINE(MEMC_MCFMODE4, offsetof(struct mb86r0x_memc, mcfmode[4]));
|
||||
DEFINE(MEMC_MCFTIM0, offsetof(struct mb86r0x_memc, mcftim[0]));
|
||||
DEFINE(MEMC_MCFTIM2, offsetof(struct mb86r0x_memc, mcftim[2]));
|
||||
DEFINE(MEMC_MCFTIM4, offsetof(struct mb86r0x_memc, mcftim[4]));
|
||||
DEFINE(MEMC_MCFAREA0, offsetof(struct mb86r0x_memc, mcfarea[0]));
|
||||
DEFINE(MEMC_MCFAREA2, offsetof(struct mb86r0x_memc, mcfarea[2]));
|
||||
DEFINE(MEMC_MCFAREA4, offsetof(struct mb86r0x_memc, mcfarea[4]));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MX25)
|
||||
/* Clock Control Module */
|
||||
DEFINE(CCM_CCTL, offsetof(struct ccm_regs, cctl));
|
||||
DEFINE(CCM_CGCR0, offsetof(struct ccm_regs, cgr0));
|
||||
DEFINE(CCM_CGCR1, offsetof(struct ccm_regs, cgr1));
|
||||
DEFINE(CCM_CGCR2, offsetof(struct ccm_regs, cgr2));
|
||||
DEFINE(CCM_PCDR2, offsetof(struct ccm_regs, pcdr[2]));
|
||||
DEFINE(CCM_MCR, offsetof(struct ccm_regs, mcr));
|
||||
|
||||
/* Enhanced SDRAM Controller */
|
||||
DEFINE(ESDRAMC_ESDCTL0, offsetof(struct esdramc_regs, ctl0));
|
||||
DEFINE(ESDRAMC_ESDCFG0, offsetof(struct esdramc_regs, cfg0));
|
||||
DEFINE(ESDRAMC_ESDMISC, offsetof(struct esdramc_regs, misc));
|
||||
|
||||
/* Multi-Layer AHB Crossbar Switch */
|
||||
DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
|
||||
DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
|
||||
DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
|
||||
DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
|
||||
DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
|
||||
DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
|
||||
DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
|
||||
DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
|
||||
DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
|
||||
DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
|
||||
DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
|
||||
DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
|
||||
DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
|
||||
DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
|
||||
DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
|
||||
|
||||
/* AHB <-> IP-Bus Interface */
|
||||
DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
|
||||
DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MX27)
|
||||
DEFINE(AIPI1_PSR0, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr0));
|
||||
DEFINE(AIPI1_PSR1, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr1));
|
||||
DEFINE(AIPI2_PSR0, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr0));
|
||||
DEFINE(AIPI2_PSR1, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr1));
|
||||
|
||||
DEFINE(CSCR, IMX_PLL_BASE + offsetof(struct pll_regs, cscr));
|
||||
DEFINE(MPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, mpctl0));
|
||||
DEFINE(SPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, spctl0));
|
||||
DEFINE(PCDR0, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr0));
|
||||
DEFINE(PCDR1, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr1));
|
||||
DEFINE(PCCR0, IMX_PLL_BASE + offsetof(struct pll_regs, pccr0));
|
||||
DEFINE(PCCR1, IMX_PLL_BASE + offsetof(struct pll_regs, pccr1));
|
||||
|
||||
DEFINE(ESDCTL0_ROF, offsetof(struct esdramc_regs, esdctl0));
|
||||
DEFINE(ESDCFG0_ROF, offsetof(struct esdramc_regs, esdcfg0));
|
||||
DEFINE(ESDCTL1_ROF, offsetof(struct esdramc_regs, esdctl1));
|
||||
DEFINE(ESDCFG1_ROF, offsetof(struct esdramc_regs, esdcfg1));
|
||||
DEFINE(ESDMISC_ROF, offsetof(struct esdramc_regs, esdmisc));
|
||||
|
||||
DEFINE(GPCR, IMX_SYSTEM_CTL_BASE +
|
||||
offsetof(struct system_control_regs, gpcr));
|
||||
DEFINE(FMCR, IMX_SYSTEM_CTL_BASE +
|
||||
offsetof(struct system_control_regs, fmcr));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MX35)
|
||||
/* Round up to make sure size gives nice stack alignment */
|
||||
DEFINE(CLKCTL_CCMR, offsetof(struct ccm_regs, ccmr));
|
||||
DEFINE(CLKCTL_PDR0, offsetof(struct ccm_regs, pdr0));
|
||||
DEFINE(CLKCTL_PDR1, offsetof(struct ccm_regs, pdr1));
|
||||
DEFINE(CLKCTL_PDR2, offsetof(struct ccm_regs, pdr2));
|
||||
DEFINE(CLKCTL_PDR3, offsetof(struct ccm_regs, pdr3));
|
||||
DEFINE(CLKCTL_PDR4, offsetof(struct ccm_regs, pdr4));
|
||||
DEFINE(CLKCTL_RCSR, offsetof(struct ccm_regs, rcsr));
|
||||
DEFINE(CLKCTL_MPCTL, offsetof(struct ccm_regs, mpctl));
|
||||
DEFINE(CLKCTL_PPCTL, offsetof(struct ccm_regs, ppctl));
|
||||
DEFINE(CLKCTL_ACMR, offsetof(struct ccm_regs, acmr));
|
||||
DEFINE(CLKCTL_COSR, offsetof(struct ccm_regs, cosr));
|
||||
DEFINE(CLKCTL_CGR0, offsetof(struct ccm_regs, cgr0));
|
||||
DEFINE(CLKCTL_CGR1, offsetof(struct ccm_regs, cgr1));
|
||||
DEFINE(CLKCTL_CGR2, offsetof(struct ccm_regs, cgr2));
|
||||
DEFINE(CLKCTL_CGR3, offsetof(struct ccm_regs, cgr3));
|
||||
|
||||
/* Multi-Layer AHB Crossbar Switch */
|
||||
DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
|
||||
DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
|
||||
DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
|
||||
DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
|
||||
DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
|
||||
DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
|
||||
DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
|
||||
DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
|
||||
DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
|
||||
DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
|
||||
DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
|
||||
DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
|
||||
DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
|
||||
DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
|
||||
DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
|
||||
DEFINE(MAX_MGPCR5, offsetof(struct max_regs, mgpcr5));
|
||||
|
||||
/* AHB <-> IP-Bus Interface */
|
||||
DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
|
||||
DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
|
||||
DEFINE(AIPS_PACR_0_7, offsetof(struct aips_regs, pacr_0_7));
|
||||
DEFINE(AIPS_PACR_8_15, offsetof(struct aips_regs, pacr_8_15));
|
||||
DEFINE(AIPS_PACR_16_23, offsetof(struct aips_regs, pacr_16_23));
|
||||
DEFINE(AIPS_PACR_24_31, offsetof(struct aips_regs, pacr_24_31));
|
||||
DEFINE(AIPS_OPACR_0_7, offsetof(struct aips_regs, opacr_0_7));
|
||||
DEFINE(AIPS_OPACR_8_15, offsetof(struct aips_regs, opacr_8_15));
|
||||
DEFINE(AIPS_OPACR_16_23, offsetof(struct aips_regs, opacr_16_23));
|
||||
DEFINE(AIPS_OPACR_24_31, offsetof(struct aips_regs, opacr_24_31));
|
||||
DEFINE(AIPS_OPACR_32_39, offsetof(struct aips_regs, opacr_32_39));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MX51) || defined(CONFIG_MX53)
|
||||
/* Round up to make sure size gives nice stack alignment */
|
||||
DEFINE(CLKCTL_CCMR, offsetof(struct clkctl, ccr));
|
||||
DEFINE(CLKCTL_CCDR, offsetof(struct clkctl, ccdr));
|
||||
DEFINE(CLKCTL_CSR, offsetof(struct clkctl, csr));
|
||||
DEFINE(CLKCTL_CCSR, offsetof(struct clkctl, ccsr));
|
||||
DEFINE(CLKCTL_CACRR, offsetof(struct clkctl, cacrr));
|
||||
DEFINE(CLKCTL_CBCDR, offsetof(struct clkctl, cbcdr));
|
||||
DEFINE(CLKCTL_CBCMR, offsetof(struct clkctl, cbcmr));
|
||||
DEFINE(CLKCTL_CSCMR1, offsetof(struct clkctl, cscmr1));
|
||||
DEFINE(CLKCTL_CSCMR2, offsetof(struct clkctl, cscmr2));
|
||||
DEFINE(CLKCTL_CSCDR1, offsetof(struct clkctl, cscdr1));
|
||||
DEFINE(CLKCTL_CS1CDR, offsetof(struct clkctl, cs1cdr));
|
||||
DEFINE(CLKCTL_CS2CDR, offsetof(struct clkctl, cs2cdr));
|
||||
DEFINE(CLKCTL_CDCDR, offsetof(struct clkctl, cdcdr));
|
||||
DEFINE(CLKCTL_CHSCCDR, offsetof(struct clkctl, chsccdr));
|
||||
DEFINE(CLKCTL_CSCDR2, offsetof(struct clkctl, cscdr2));
|
||||
DEFINE(CLKCTL_CSCDR3, offsetof(struct clkctl, cscdr3));
|
||||
DEFINE(CLKCTL_CSCDR4, offsetof(struct clkctl, cscdr4));
|
||||
DEFINE(CLKCTL_CWDR, offsetof(struct clkctl, cwdr));
|
||||
DEFINE(CLKCTL_CDHIPR, offsetof(struct clkctl, cdhipr));
|
||||
DEFINE(CLKCTL_CDCR, offsetof(struct clkctl, cdcr));
|
||||
DEFINE(CLKCTL_CTOR, offsetof(struct clkctl, ctor));
|
||||
DEFINE(CLKCTL_CLPCR, offsetof(struct clkctl, clpcr));
|
||||
DEFINE(CLKCTL_CISR, offsetof(struct clkctl, cisr));
|
||||
DEFINE(CLKCTL_CIMR, offsetof(struct clkctl, cimr));
|
||||
DEFINE(CLKCTL_CCOSR, offsetof(struct clkctl, ccosr));
|
||||
DEFINE(CLKCTL_CGPR, offsetof(struct clkctl, cgpr));
|
||||
DEFINE(CLKCTL_CCGR0, offsetof(struct clkctl, ccgr0));
|
||||
DEFINE(CLKCTL_CCGR1, offsetof(struct clkctl, ccgr1));
|
||||
DEFINE(CLKCTL_CCGR2, offsetof(struct clkctl, ccgr2));
|
||||
DEFINE(CLKCTL_CCGR3, offsetof(struct clkctl, ccgr3));
|
||||
DEFINE(CLKCTL_CCGR4, offsetof(struct clkctl, ccgr4));
|
||||
DEFINE(CLKCTL_CCGR5, offsetof(struct clkctl, ccgr5));
|
||||
DEFINE(CLKCTL_CCGR6, offsetof(struct clkctl, ccgr6));
|
||||
DEFINE(CLKCTL_CMEOR, offsetof(struct clkctl, cmeor));
|
||||
#if defined(CONFIG_MX53)
|
||||
DEFINE(CLKCTL_CCGR7, offsetof(struct clkctl, ccgr7));
|
||||
#endif
|
||||
|
||||
/* DPLL */
|
||||
DEFINE(PLL_DP_CTL, offsetof(struct dpll, dp_ctl));
|
||||
DEFINE(PLL_DP_CONFIG, offsetof(struct dpll, dp_config));
|
||||
DEFINE(PLL_DP_OP, offsetof(struct dpll, dp_op));
|
||||
DEFINE(PLL_DP_MFD, offsetof(struct dpll, dp_mfd));
|
||||
DEFINE(PLL_DP_MFN, offsetof(struct dpll, dp_mfn));
|
||||
DEFINE(PLL_DP_HFS_OP, offsetof(struct dpll, dp_hfs_op));
|
||||
DEFINE(PLL_DP_HFS_MFD, offsetof(struct dpll, dp_hfs_mfd));
|
||||
DEFINE(PLL_DP_HFS_MFN, offsetof(struct dpll, dp_hfs_mfn));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -71,8 +71,7 @@ static void announce_and_cleanup(int fake)
|
||||
"(fake run for tracing)" : "");
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
|
||||
#ifdef CONFIG_BOOTSTAGE_FDT
|
||||
if (flag == BOOTM_STATE_OS_FAKE_GO)
|
||||
bootstage_fdt_add_report();
|
||||
bootstage_fdt_add_report();
|
||||
#endif
|
||||
#ifdef CONFIG_BOOTSTAGE_REPORT
|
||||
bootstage_report();
|
||||
@ -199,6 +198,7 @@ static void do_nonsec_virt_switch(void)
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
smp_kick_all_cpus();
|
||||
flush_dcache_all(); /* flush cache before swtiching to EL2 */
|
||||
armv8_switch_to_el2();
|
||||
#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
|
||||
armv8_switch_to_el1();
|
||||
|
||||
194
arch/arm/lib/gic_64.S
Normal file
194
arch/arm/lib/gic_64.S
Normal file
@ -0,0 +1,194 @@
|
||||
/*
|
||||
* GIC Initialization Routines.
|
||||
*
|
||||
* (C) Copyright 2013
|
||||
* David Feng <fenghua@phytium.com.cn>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/macro.h>
|
||||
#include <asm/gic.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void gic_init_secure(DistributorBase);
|
||||
*
|
||||
* Initialize secure copy of GIC at EL3.
|
||||
*
|
||||
*************************************************************************/
|
||||
ENTRY(gic_init_secure)
|
||||
/*
|
||||
* Initialize Distributor
|
||||
* x0: Distributor Base
|
||||
*/
|
||||
#if defined(CONFIG_GICV3)
|
||||
mov w9, #0x37 /* EnableGrp0 | EnableGrp1NS */
|
||||
/* EnableGrp1S | ARE_S | ARE_NS */
|
||||
str w9, [x0, GICD_CTLR] /* Secure GICD_CTLR */
|
||||
ldr w9, [x0, GICD_TYPER]
|
||||
and w10, w9, #0x1f /* ITLinesNumber */
|
||||
cbz w10, 1f /* No SPIs */
|
||||
add x11, x0, (GICD_IGROUPRn + 4)
|
||||
add x12, x0, (GICD_IGROUPMODRn + 4)
|
||||
mov w9, #~0
|
||||
0: str w9, [x11], #0x4
|
||||
str wzr, [x12], #0x4 /* Config SPIs as Group1NS */
|
||||
sub w10, w10, #0x1
|
||||
cbnz w10, 0b
|
||||
#elif defined(CONFIG_GICV2)
|
||||
mov w9, #0x3 /* EnableGrp0 | EnableGrp1 */
|
||||
str w9, [x0, GICD_CTLR] /* Secure GICD_CTLR */
|
||||
ldr w9, [x0, GICD_TYPER]
|
||||
and w10, w9, #0x1f /* ITLinesNumber */
|
||||
cbz w10, 1f /* No SPIs */
|
||||
add x11, x0, (GICD_IGROUPRn + 4)
|
||||
mov w9, #~0 /* Config SPIs as Grp1 */
|
||||
0: str w9, [x11], #0x4
|
||||
sub w10, w10, #0x1
|
||||
cbnz w10, 0b
|
||||
#endif
|
||||
1:
|
||||
ret
|
||||
ENDPROC(gic_init_secure)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* For Gicv2:
|
||||
* void gic_init_secure_percpu(DistributorBase, CpuInterfaceBase);
|
||||
* For Gicv3:
|
||||
* void gic_init_secure_percpu(ReDistributorBase);
|
||||
*
|
||||
* Initialize secure copy of GIC at EL3.
|
||||
*
|
||||
*************************************************************************/
|
||||
ENTRY(gic_init_secure_percpu)
|
||||
#if defined(CONFIG_GICV3)
|
||||
/*
|
||||
* Initialize ReDistributor
|
||||
* x0: ReDistributor Base
|
||||
*/
|
||||
mrs x10, mpidr_el1
|
||||
lsr x9, x10, #32
|
||||
bfi x10, x9, #24, #8 /* w10 is aff3:aff2:aff1:aff0 */
|
||||
mov x9, x0
|
||||
1: ldr x11, [x9, GICR_TYPER]
|
||||
lsr x11, x11, #32 /* w11 is aff3:aff2:aff1:aff0 */
|
||||
cmp w10, w11
|
||||
b.eq 2f
|
||||
add x9, x9, #(2 << 16)
|
||||
b 1b
|
||||
|
||||
/* x9: ReDistributor Base Address of Current CPU */
|
||||
2: mov w10, #~0x2
|
||||
ldr w11, [x9, GICR_WAKER]
|
||||
and w11, w11, w10 /* Clear ProcessorSleep */
|
||||
str w11, [x9, GICR_WAKER]
|
||||
dsb st
|
||||
isb
|
||||
3: ldr w10, [x9, GICR_WAKER]
|
||||
tbnz w10, #2, 3b /* Wait Children be Alive */
|
||||
|
||||
add x10, x9, #(1 << 16) /* SGI_Base */
|
||||
mov w11, #~0
|
||||
str w11, [x10, GICR_IGROUPRn]
|
||||
str wzr, [x10, GICR_IGROUPMODRn] /* SGIs|PPIs Group1NS */
|
||||
mov w11, #0x1 /* Enable SGI 0 */
|
||||
str w11, [x10, GICR_ISENABLERn]
|
||||
|
||||
/* Initialize Cpu Interface */
|
||||
mrs x10, ICC_SRE_EL3
|
||||
orr x10, x10, #0xf /* SRE & Disable IRQ/FIQ Bypass & */
|
||||
/* Allow EL2 access to ICC_SRE_EL2 */
|
||||
msr ICC_SRE_EL3, x10
|
||||
isb
|
||||
|
||||
mrs x10, ICC_SRE_EL2
|
||||
orr x10, x10, #0xf /* SRE & Disable IRQ/FIQ Bypass & */
|
||||
/* Allow EL1 access to ICC_SRE_EL1 */
|
||||
msr ICC_SRE_EL2, x10
|
||||
isb
|
||||
|
||||
mov x10, #0x3 /* EnableGrp1NS | EnableGrp1S */
|
||||
msr ICC_IGRPEN1_EL3, x10
|
||||
isb
|
||||
|
||||
msr ICC_CTLR_EL3, xzr
|
||||
isb
|
||||
|
||||
msr ICC_CTLR_EL1, xzr /* NonSecure ICC_CTLR_EL1 */
|
||||
isb
|
||||
|
||||
mov x10, #0x1 << 7 /* Non-Secure access to ICC_PMR_EL1 */
|
||||
msr ICC_PMR_EL1, x10
|
||||
isb
|
||||
#elif defined(CONFIG_GICV2)
|
||||
/*
|
||||
* Initialize SGIs and PPIs
|
||||
* x0: Distributor Base
|
||||
* x1: Cpu Interface Base
|
||||
*/
|
||||
mov w9, #~0 /* Config SGIs and PPIs as Grp1 */
|
||||
str w9, [x0, GICD_IGROUPRn] /* GICD_IGROUPR0 */
|
||||
mov w9, #0x1 /* Enable SGI 0 */
|
||||
str w9, [x0, GICD_ISENABLERn]
|
||||
|
||||
/* Initialize Cpu Interface */
|
||||
mov w9, #0x1e7 /* Disable IRQ/FIQ Bypass & */
|
||||
/* Enable Ack Group1 Interrupt & */
|
||||
/* EnableGrp0 & EnableGrp1 */
|
||||
str w9, [x1, GICC_CTLR] /* Secure GICC_CTLR */
|
||||
|
||||
mov w9, #0x1 << 7 /* Non-Secure access to GICC_PMR */
|
||||
str w9, [x1, GICC_PMR]
|
||||
#endif
|
||||
ret
|
||||
ENDPROC(gic_init_secure_percpu)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* For Gicv2:
|
||||
* void gic_kick_secondary_cpus(DistributorBase);
|
||||
* For Gicv3:
|
||||
* void gic_kick_secondary_cpus(void);
|
||||
*
|
||||
*************************************************************************/
|
||||
ENTRY(gic_kick_secondary_cpus)
|
||||
#if defined(CONFIG_GICV3)
|
||||
mov x9, #(1 << 40)
|
||||
msr ICC_ASGI1R_EL1, x9
|
||||
isb
|
||||
#elif defined(CONFIG_GICV2)
|
||||
mov w9, #0x8000
|
||||
movk w9, #0x100, lsl #16
|
||||
str w9, [x0, GICD_SGIR]
|
||||
#endif
|
||||
ret
|
||||
ENDPROC(gic_kick_secondary_cpus)
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* For Gicv2:
|
||||
* void gic_wait_for_interrupt(CpuInterfaceBase);
|
||||
* For Gicv3:
|
||||
* void gic_wait_for_interrupt(void);
|
||||
*
|
||||
* Wait for SGI 0 from master.
|
||||
*
|
||||
*************************************************************************/
|
||||
ENTRY(gic_wait_for_interrupt)
|
||||
0: wfi
|
||||
#if defined(CONFIG_GICV3)
|
||||
mrs x9, ICC_IAR1_EL1
|
||||
msr ICC_EOIR1_EL1, x9
|
||||
#elif defined(CONFIG_GICV2)
|
||||
ldr w9, [x0, GICC_AIAR]
|
||||
str w9, [x0, GICC_AEOIR]
|
||||
#endif
|
||||
cbnz w9, 0b
|
||||
ret
|
||||
ENDPROC(gic_wait_for_interrupt)
|
||||
@ -11,6 +11,7 @@
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/macro.h>
|
||||
|
||||
/*
|
||||
* void relocate_code (addr_moni)
|
||||
@ -19,6 +20,9 @@
|
||||
* x0 holds the destination address.
|
||||
*/
|
||||
ENTRY(relocate_code)
|
||||
stp x29, x30, [sp, #-32]! /* create a stack frame */
|
||||
mov x29, sp
|
||||
str x0, [sp, #16]
|
||||
/*
|
||||
* Copy u-boot from flash to RAM
|
||||
*/
|
||||
@ -32,6 +36,7 @@ copy_loop:
|
||||
stp x10, x11, [x0], #16 /* copy to target address [x0] */
|
||||
cmp x1, x2 /* until source end address [x2] */
|
||||
b.lo copy_loop
|
||||
str x0, [sp, #24]
|
||||
|
||||
/*
|
||||
* Fix .rela.dyn relocations
|
||||
@ -54,5 +59,19 @@ fixnext:
|
||||
b.lo fixloop
|
||||
|
||||
relocate_done:
|
||||
switch_el x1, 3f, 2f, 1f
|
||||
bl hang
|
||||
3: mrs x0, sctlr_el3
|
||||
b 0f
|
||||
2: mrs x0, sctlr_el2
|
||||
b 0f
|
||||
1: mrs x0, sctlr_el1
|
||||
0: tbz w0, #2, 5f /* skip flushing cache if disabled */
|
||||
tbz w0, #12, 4f /* invalide i-cache is enabled */
|
||||
ic iallu /* i-cache invalidate all */
|
||||
isb sy
|
||||
4: ldp x0, x1, [sp, #16]
|
||||
bl __asm_flush_dcache_range
|
||||
5: ldp x29, x30, [sp],#16
|
||||
ret
|
||||
ENDPROC(relocate_code)
|
||||
|
||||
@ -7,14 +7,14 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5208:=$(shell grep CONFIG_M5208 $(TOPDIR)/include/$(cfg))
|
||||
is5249:=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg))
|
||||
is5253:=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg))
|
||||
is5271:=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg))
|
||||
is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
|
||||
is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg))
|
||||
is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
|
||||
cfg=$(shell grep configs $(objtree)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5208:=$(shell grep CONFIG_M5208 $(srctree)/include/$(cfg))
|
||||
is5249:=$(shell grep CONFIG_M5249 $(srctree)/include/$(cfg))
|
||||
is5253:=$(shell grep CONFIG_M5253 $(srctree)/include/$(cfg))
|
||||
is5271:=$(shell grep CONFIG_M5271 $(srctree)/include/$(cfg))
|
||||
is5272:=$(shell grep CONFIG_M5272 $(srctree)/include/$(cfg))
|
||||
is5275:=$(shell grep CONFIG_M5275 $(srctree)/include/$(cfg))
|
||||
is5282:=$(shell grep CONFIG_M5282 $(srctree)/include/$(cfg))
|
||||
|
||||
ifneq (,$(findstring CONFIG_M5208,$(is5208)))
|
||||
PLATFORM_CPPFLAGS += -mcpu=5208
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5301x:=$(shell grep CONFIG_MCF5301x $(TOPDIR)/include/$(cfg))
|
||||
is532x:=$(shell grep CONFIG_MCF532x $(TOPDIR)/include/$(cfg))
|
||||
cfg=$(shell grep configs $(objtree)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5301x:=$(shell grep CONFIG_MCF5301x $(srctree)/include/$(cfg))
|
||||
is532x:=$(shell grep CONFIG_MCF532x $(srctree)/include/$(cfg))
|
||||
|
||||
ifneq (,$(findstring CONFIG_MCF5301x,$(is5301x)))
|
||||
PLATFORM_CPPFLAGS += -mcpu=53015 -fPIC
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5441x:=$(shell grep CONFIG_MCF5441x $(TOPDIR)/include/$(cfg))
|
||||
cfg=$(shell grep configs $(objtree)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is5441x:=$(shell grep CONFIG_MCF5441x $(srctree)/include/$(cfg))
|
||||
|
||||
ifneq (,$(findstring CONFIG_MCF5441x,$(is5441x)))
|
||||
PLATFORM_CPPFLAGS += -mcpu=54418 -fPIC
|
||||
|
||||
@ -15,5 +15,3 @@ endif
|
||||
CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000
|
||||
|
||||
PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
|
||||
|
||||
LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
|
||||
*
|
||||
* Generate definitions needed by assembly language modules.
|
||||
* This code generates raw asm output which is post-processed to extract
|
||||
* and format the required data.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#include <common.h>
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
#ifdef CONFIG_FTSMC020
|
||||
OFFSET(FTSMC020_BANK0_CR, ftsmc020, bank[0].cr);
|
||||
OFFSET(FTSMC020_BANK0_TPR, ftsmc020, bank[0].tpr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTAHBC020S
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_4, ftahbc02s, s_bsr[4]);
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_6, ftahbc02s, s_bsr[6]);
|
||||
OFFSET(FTAHBC020S_CR, ftahbc02s, cr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTPMU010
|
||||
OFFSET(FTPMU010_PDLLCR0, ftpmu010, PDLLCR0);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTSDMC021
|
||||
OFFSET(FTSDMC021_TP1, ftsdmc021, tp1);
|
||||
OFFSET(FTSDMC021_TP2, ftsdmc021, tp2);
|
||||
OFFSET(FTSDMC021_CR1, ftsdmc021, cr1);
|
||||
OFFSET(FTSDMC021_CR2, ftsdmc021, cr2);
|
||||
OFFSET(FTSDMC021_BANK0_BSR, ftsdmc021, bank0_bsr);
|
||||
OFFSET(FTSDMC021_BANK1_BSR, ftsdmc021, bank1_bsr);
|
||||
OFFSET(FTSDMC021_BANK2_BSR, ftsdmc021, bank2_bsr);
|
||||
OFFSET(FTSDMC021_BANK3_BSR, ftsdmc021, bank3_bsr);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@ -15,16 +15,43 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* TODO : Check if each entry in this file is really necessary.
|
||||
* - struct ftahbc02s
|
||||
* - struct ftsdmc021
|
||||
* - struct andes_pcu
|
||||
* - struct dwcddr21mctl
|
||||
* are used only for generating asm-offsets.h.
|
||||
* It means their offset addresses are referenced only from assembly
|
||||
* code. Is it better to define the macros directly in headers?
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_FTSMC020
|
||||
OFFSET(FTSMC020_BANK0_CR, ftsmc020, bank[0].cr);
|
||||
OFFSET(FTSMC020_BANK0_TPR, ftsmc020, bank[0].tpr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTAHBC020S
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_4, ftahbc02s, s_bsr[4]);
|
||||
OFFSET(FTAHBC020S_SLAVE_BSR_6, ftahbc02s, s_bsr[6]);
|
||||
OFFSET(FTAHBC020S_CR, ftahbc02s, cr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTPMU010
|
||||
OFFSET(FTPMU010_PDLLCR0, ftpmu010, PDLLCR0);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_FTSDMC021
|
||||
OFFSET(FTSDMC021_TP1, ftsdmc021, tp1);
|
||||
OFFSET(FTSDMC021_TP2, ftsdmc021, tp2);
|
||||
OFFSET(FTSDMC021_CR1, ftsdmc021, cr1);
|
||||
OFFSET(FTSDMC021_CR2, ftsdmc021, cr2);
|
||||
OFFSET(FTSDMC021_BANK0_BSR, ftsdmc021, bank0_bsr);
|
||||
OFFSET(FTSDMC021_BANK1_BSR, ftsdmc021, bank1_bsr);
|
||||
OFFSET(FTSDMC021_BANK2_BSR, ftsdmc021, bank2_bsr);
|
||||
OFFSET(FTSDMC021_BANK3_BSR, ftsdmc021, bank3_bsr);
|
||||
#endif
|
||||
BLANK();
|
||||
#ifdef CONFIG_ANDES_PCU
|
||||
OFFSET(ANDES_PCU_PCS4, andes_pcu, pcs4.parm); /* 0x104 */
|
||||
#endif
|
||||
@ -50,5 +77,6 @@ int main(void)
|
||||
OFFSET(DWCDDR21MCTL_DTAR, dwcddr21mctl, dtar); /* 0xa4 */
|
||||
OFFSET(DWCDDR21MCTL_MR, dwcddr21mctl, mr); /* 0x1f0 */
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -14,5 +14,3 @@ endif
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_OPENRISC -D__OR1K__ -ffixed-r10
|
||||
|
||||
CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
|
||||
|
||||
LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_4xx -mstring -msoft-float
|
||||
|
||||
cfg=$(shell grep configs $(OBJTREE)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is440:=$(shell grep CONFIG_440 $(TOPDIR)/include/$(cfg))
|
||||
cfg=$(shell grep configs $(objtree)/include/config.h | sed 's/.*<\(configs.*\)>/\1/')
|
||||
is440:=$(shell grep CONFIG_440 $(srctree)/include/$(cfg))
|
||||
|
||||
ifneq (,$(findstring CONFIG_440,$(is440)))
|
||||
PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
|
||||
|
||||
@ -734,6 +734,8 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
|
||||
#define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
|
||||
#define CONFIG_SYS_FSL_ERRATUM_A006261
|
||||
#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000
|
||||
#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
|
||||
#define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
|
||||
|
||||
#elif defined(CONFIG_PPC_T2080) || defined(CONFIG_PPC_T2081)
|
||||
#define CONFIG_E6500
|
||||
@ -778,6 +780,9 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
|
||||
#define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe000000
|
||||
#define CONFIG_SYS_FSL_SFP_VER_3_0
|
||||
#define CONFIG_SYS_FSL_ISBC_VER 2
|
||||
#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
|
||||
#define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
|
||||
|
||||
|
||||
#elif defined(CONFIG_PPC_C29X)
|
||||
#define CONFIG_MAX_CPUS 1
|
||||
|
||||
@ -5,6 +5,11 @@ PLATFORM_CPPFLAGS += -DCONFIG_SANDBOX -D__SANDBOX__ -U_FORTIFY_SOURCE
|
||||
PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM -DCONFIG_SYS_GENERIC_BOARD
|
||||
PLATFORM_LIBS += -lrt
|
||||
|
||||
ifdef CONFIG_SANDBOX_SDL
|
||||
PLATFORM_LIBS += $(shell sdl-config --libs)
|
||||
PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
|
||||
endif
|
||||
|
||||
# Support generic board on sandbox
|
||||
__HAVE_ARCH_GENERIC_BOARD := y
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
obj-y := cpu.o os.o start.o state.o
|
||||
obj-$(CONFIG_SANDBOX_SDL) += sdl.o
|
||||
|
||||
# os.c is build in the system environment, so needs standard includes
|
||||
# CFLAGS_REMOVE_os.o cannot be used to drop header include path
|
||||
@ -17,3 +18,5 @@ cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
|
||||
|
||||
$(obj)/os.o: $(src)/os.c FORCE
|
||||
$(call if_changed_dep,cc_os.o)
|
||||
$(obj)/sdl.o: $(src)/sdl.c FORCE
|
||||
$(call if_changed_dep,cc_os.o)
|
||||
|
||||
@ -58,7 +58,7 @@ void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
|
||||
return (void *)(gd->arch.ram_buf + paddr);
|
||||
}
|
||||
|
||||
phys_addr_t map_to_sysmem(void *ptr)
|
||||
phys_addr_t map_to_sysmem(const void *ptr)
|
||||
{
|
||||
return (u8 *)ptr - gd->arch.ram_buf;
|
||||
}
|
||||
|
||||
@ -104,21 +104,22 @@ void os_exit(int exit_code)
|
||||
|
||||
/* Restore tty state when we exit */
|
||||
static struct termios orig_term;
|
||||
static bool term_setup;
|
||||
|
||||
static void os_fd_restore(void)
|
||||
{
|
||||
tcsetattr(0, TCSANOW, &orig_term);
|
||||
if (term_setup)
|
||||
tcsetattr(0, TCSANOW, &orig_term);
|
||||
}
|
||||
|
||||
/* Put tty into raw mode so <tab> and <ctrl+c> work */
|
||||
void os_tty_raw(int fd)
|
||||
void os_tty_raw(int fd, bool allow_sigs)
|
||||
{
|
||||
static int setup = 0;
|
||||
struct termios term;
|
||||
|
||||
if (setup)
|
||||
if (term_setup)
|
||||
return;
|
||||
setup = 1;
|
||||
term_setup = true;
|
||||
|
||||
/* If not a tty, don't complain */
|
||||
if (tcgetattr(fd, &orig_term))
|
||||
@ -128,7 +129,7 @@ void os_tty_raw(int fd)
|
||||
term.c_iflag = IGNBRK | IGNPAR;
|
||||
term.c_oflag = OPOST | ONLCR;
|
||||
term.c_cflag = CS8 | CREAD | CLOCAL;
|
||||
term.c_lflag = 0;
|
||||
term.c_lflag = allow_sigs ? ISIG : 0;
|
||||
if (tcsetattr(fd, TCSANOW, &term))
|
||||
return;
|
||||
|
||||
@ -443,3 +444,93 @@ int os_read_ram_buf(const char *fname)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int make_exec(char *fname, const void *data, int size)
|
||||
{
|
||||
int fd;
|
||||
|
||||
strcpy(fname, "/tmp/u-boot.jump.XXXXXX");
|
||||
fd = mkstemp(fname);
|
||||
if (fd < 0)
|
||||
return -ENOENT;
|
||||
if (write(fd, data, size) < 0)
|
||||
return -EIO;
|
||||
close(fd);
|
||||
if (chmod(fname, 0777))
|
||||
return -ENOEXEC;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int add_args(char ***argvp, const char *add_args[], int count)
|
||||
{
|
||||
char **argv;
|
||||
int argc;
|
||||
|
||||
for (argv = *argvp, argc = 0; (*argvp)[argc]; argc++)
|
||||
;
|
||||
|
||||
argv = malloc((argc + count + 1) * sizeof(char *));
|
||||
if (!argv) {
|
||||
printf("Out of memory for %d argv\n", count);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memcpy(argv, *argvp, argc * sizeof(char *));
|
||||
memcpy(argv + argc, add_args, count * sizeof(char *));
|
||||
argv[argc + count] = NULL;
|
||||
|
||||
*argvp = argv;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int os_jump_to_image(const void *dest, int size)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
char fname[30], mem_fname[30];
|
||||
int fd, err;
|
||||
const char *extra_args[5];
|
||||
char **argv = state->argv;
|
||||
#ifdef DEBUG
|
||||
int argc, i;
|
||||
#endif
|
||||
|
||||
err = make_exec(fname, dest, size);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
strcpy(mem_fname, "/tmp/u-boot.mem.XXXXXX");
|
||||
fd = mkstemp(mem_fname);
|
||||
if (fd < 0)
|
||||
return -ENOENT;
|
||||
close(fd);
|
||||
err = os_write_ram_buf(mem_fname);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
os_fd_restore();
|
||||
|
||||
extra_args[0] = "-j";
|
||||
extra_args[1] = fname;
|
||||
extra_args[2] = "-m";
|
||||
extra_args[3] = mem_fname;
|
||||
extra_args[4] = "--rm_memory";
|
||||
err = add_args(&argv, extra_args,
|
||||
sizeof(extra_args) / sizeof(extra_args[0]));
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
#ifdef DEBUG
|
||||
for (i = 0; argv[i]; i++)
|
||||
printf("%d %s\n", i, argv[i]);
|
||||
#endif
|
||||
|
||||
if (state_uninit())
|
||||
os_exit(2);
|
||||
|
||||
err = execv(fname, argv);
|
||||
free(argv);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return unlink(fname);
|
||||
}
|
||||
|
||||
341
arch/sandbox/cpu/sdl.c
Normal file
341
arch/sandbox/cpu/sdl.c
Normal file
@ -0,0 +1,341 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <linux/input.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <sound.h>
|
||||
#include <asm/state.h>
|
||||
|
||||
static struct sdl_info {
|
||||
SDL_Surface *screen;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
int pitch;
|
||||
uint frequency;
|
||||
uint audio_pos;
|
||||
uint audio_size;
|
||||
uint8_t *audio_data;
|
||||
bool audio_active;
|
||||
bool inited;
|
||||
} sdl;
|
||||
|
||||
static void sandbox_sdl_poll_events(void)
|
||||
{
|
||||
/*
|
||||
* We don't want to include common.h in this file since it uses
|
||||
* system headers. So add a declation here.
|
||||
*/
|
||||
extern void reset_cpu(unsigned long addr);
|
||||
SDL_Event event;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
case SDL_QUIT:
|
||||
puts("LCD window closed - quitting\n");
|
||||
reset_cpu(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int sandbox_sdl_ensure_init(void)
|
||||
{
|
||||
if (!sdl.inited) {
|
||||
if (SDL_Init(0) < 0) {
|
||||
printf("Unable to initialize SDL: %s\n",
|
||||
SDL_GetError());
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
atexit(SDL_Quit);
|
||||
|
||||
sdl.inited = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sandbox_sdl_init_display(int width, int height, int log2_bpp)
|
||||
{
|
||||
struct sandbox_state *state = state_get_current();
|
||||
int err;
|
||||
|
||||
if (!width || !state->show_lcd)
|
||||
return 0;
|
||||
err = sandbox_sdl_ensure_init();
|
||||
if (err)
|
||||
return err;
|
||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
|
||||
printf("Unable to initialize SDL LCD: %s\n", SDL_GetError());
|
||||
return -EPERM;
|
||||
}
|
||||
SDL_WM_SetCaption("U-Boot", "U-Boot");
|
||||
|
||||
sdl.width = width;
|
||||
sdl.height = height;
|
||||
sdl.depth = 1 << log2_bpp;
|
||||
sdl.pitch = sdl.width * sdl.depth / 8;
|
||||
sdl.screen = SDL_SetVideoMode(width, height, 0, 0);
|
||||
sandbox_sdl_poll_events();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sandbox_sdl_sync(void *lcd_base)
|
||||
{
|
||||
SDL_Surface *frame;
|
||||
|
||||
frame = SDL_CreateRGBSurfaceFrom(lcd_base, sdl.width, sdl.height,
|
||||
sdl.depth, sdl.pitch,
|
||||
0x1f << 11, 0x3f << 5, 0x1f << 0, 0);
|
||||
SDL_BlitSurface(frame, NULL, sdl.screen, NULL);
|
||||
SDL_FreeSurface(frame);
|
||||
SDL_UpdateRect(sdl.screen, 0, 0, 0, 0);
|
||||
sandbox_sdl_poll_events();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define NONE (-1)
|
||||
#define NUM_SDL_CODES (SDLK_UNDO + 1)
|
||||
|
||||
static int16_t sdl_to_keycode[NUM_SDL_CODES] = {
|
||||
/* 0 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, KEY_BACKSPACE, KEY_TAB,
|
||||
NONE, NONE, NONE, KEY_ENTER, NONE,
|
||||
NONE, NONE, NONE, NONE, KEY_POWER, /* use PAUSE as POWER */
|
||||
|
||||
/* 20 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, KEY_ESC, NONE, NONE,
|
||||
NONE, NONE, KEY_SPACE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 40 */
|
||||
NONE, NONE, NONE, NONE, KEY_COMMA,
|
||||
KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1,
|
||||
KEY_2, KEY_3, KEY_4, KEY_5, KEY_6,
|
||||
KEY_7, KEY_8, KEY_9, NONE, KEY_SEMICOLON,
|
||||
|
||||
/* 60 */
|
||||
NONE, KEY_EQUAL, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 80 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, KEY_BACKSLASH, NONE, NONE,
|
||||
NONE, KEY_GRAVE, KEY_A, KEY_B, KEY_C,
|
||||
|
||||
/* 100 */
|
||||
KEY_D, KEY_E, KEY_F, KEY_G, KEY_H,
|
||||
KEY_I, KEY_J, KEY_K, KEY_L, KEY_M,
|
||||
KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R,
|
||||
KEY_S, KEY_T, KEY_U, KEY_V, KEY_W,
|
||||
|
||||
/* 120 */
|
||||
KEY_X, KEY_Y, KEY_Z, NONE, NONE,
|
||||
NONE, NONE, KEY_DELETE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 140 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 160 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 180 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 200 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 220 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 240 */
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
NONE, KEY_KP0, KEY_KP1, KEY_KP2, KEY_KP3,
|
||||
|
||||
/* 260 */
|
||||
KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8,
|
||||
KEY_KP9, KEY_KPDOT, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS,
|
||||
KEY_KPPLUS, KEY_KPENTER, KEY_KPEQUAL, KEY_UP, KEY_DOWN,
|
||||
KEY_RIGHT, KEY_LEFT, KEY_INSERT, KEY_HOME, KEY_END,
|
||||
|
||||
/* 280 */
|
||||
KEY_PAGEUP, KEY_PAGEDOWN, KEY_F1, KEY_F2, KEY_F3,
|
||||
KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8,
|
||||
KEY_F9, KEY_F10, KEY_F11, KEY_F12, NONE,
|
||||
NONE, NONE, NONE, NONE, NONE,
|
||||
|
||||
/* 300 */
|
||||
KEY_NUMLOCK, KEY_CAPSLOCK, KEY_SCROLLLOCK, KEY_RIGHTSHIFT,
|
||||
KEY_LEFTSHIFT,
|
||||
KEY_RIGHTCTRL, KEY_LEFTCTRL, KEY_RIGHTALT, KEY_LEFTALT, KEY_RIGHTMETA,
|
||||
KEY_LEFTMETA, NONE, KEY_FN, NONE, KEY_COMPOSE,
|
||||
NONE, KEY_PRINT, KEY_SYSRQ, KEY_PAUSE, NONE,
|
||||
|
||||
/* 320 */
|
||||
NONE, NONE, NONE,
|
||||
};
|
||||
|
||||
int sandbox_sdl_scan_keys(int key[], int max_keys)
|
||||
{
|
||||
Uint8 *keystate;
|
||||
int i, count;
|
||||
|
||||
sandbox_sdl_poll_events();
|
||||
keystate = SDL_GetKeyState(NULL);
|
||||
for (i = count = 0; i < NUM_SDL_CODES; i++) {
|
||||
if (count >= max_keys)
|
||||
break;
|
||||
else if (keystate[i])
|
||||
key[count++] = sdl_to_keycode[i];
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int sandbox_sdl_key_pressed(int keycode)
|
||||
{
|
||||
int key[8]; /* allow up to 8 keys to be pressed at once */
|
||||
int count;
|
||||
int i;
|
||||
|
||||
count = sandbox_sdl_scan_keys(key, sizeof(key) / sizeof(key[0]));
|
||||
for (i = 0; i < count; i++) {
|
||||
if (key[i] == keycode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
void sandbox_sdl_fill_audio(void *udata, Uint8 *stream, int len)
|
||||
{
|
||||
int avail;
|
||||
|
||||
avail = sdl.audio_size - sdl.audio_pos;
|
||||
if (avail < len)
|
||||
len = avail;
|
||||
|
||||
SDL_MixAudio(stream, sdl.audio_data + sdl.audio_pos, len,
|
||||
SDL_MIX_MAXVOLUME);
|
||||
sdl.audio_pos += len;
|
||||
|
||||
/* Loop if we are at the end */
|
||||
if (sdl.audio_pos == sdl.audio_size)
|
||||
sdl.audio_pos = 0;
|
||||
}
|
||||
|
||||
int sandbox_sdl_sound_init(void)
|
||||
{
|
||||
SDL_AudioSpec wanted;
|
||||
|
||||
if (sandbox_sdl_ensure_init())
|
||||
return -1;
|
||||
|
||||
if (sdl.audio_active)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* At present all sandbox sounds crash. This is probably due to
|
||||
* symbol name conflicts with U-Boot. We can remove the malloc()
|
||||
* probles with:
|
||||
*
|
||||
* #define USE_DL_PREFIX
|
||||
*
|
||||
* and get this:
|
||||
*
|
||||
* Assertion 'e->pollfd->fd == e->fd' failed at pulse/mainloop.c:676,
|
||||
* function dispatch_pollfds(). Aborting.
|
||||
*
|
||||
* The right solution is probably to make U-Boot's names private or
|
||||
* link os.c and sdl.c against their libraries before liking with
|
||||
* U-Boot. TBD. For now sound is disabled.
|
||||
*/
|
||||
printf("(Warning: sandbox sound disabled)\n");
|
||||
return 0;
|
||||
|
||||
/* Set the audio format */
|
||||
wanted.freq = 22050;
|
||||
wanted.format = AUDIO_S16;
|
||||
wanted.channels = 1; /* 1 = mono, 2 = stereo */
|
||||
wanted.samples = 1024; /* Good low-latency value for callback */
|
||||
wanted.callback = sandbox_sdl_fill_audio;
|
||||
wanted.userdata = NULL;
|
||||
|
||||
sdl.audio_size = sizeof(uint16_t) * wanted.freq;
|
||||
sdl.audio_data = malloc(sdl.audio_size);
|
||||
if (!sdl.audio_data) {
|
||||
printf("%s: Out of memory\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
sdl.audio_pos = 0;
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
|
||||
printf("Unable to initialize SDL audio: %s\n", SDL_GetError());
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Open the audio device, forcing the desired format */
|
||||
if (SDL_OpenAudio(&wanted, NULL) < 0) {
|
||||
printf("Couldn't open audio: %s\n", SDL_GetError());
|
||||
goto err;
|
||||
}
|
||||
sdl.audio_active = true;
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
free(sdl.audio_data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sandbox_sdl_sound_start(uint frequency)
|
||||
{
|
||||
if (!sdl.audio_active)
|
||||
return -1;
|
||||
sdl.frequency = frequency;
|
||||
sound_create_square_wave((unsigned short *)sdl.audio_data,
|
||||
sdl.audio_size, frequency);
|
||||
sdl.audio_pos = 0;
|
||||
SDL_PauseAudio(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sandbox_sdl_sound_stop(void)
|
||||
{
|
||||
if (!sdl.audio_active)
|
||||
return -1;
|
||||
SDL_PauseAudio(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -107,6 +107,16 @@ static int sandbox_cmdline_cb_interactive(struct sandbox_state *state,
|
||||
|
||||
SANDBOX_CMDLINE_OPT_SHORT(interactive, 'i', 0, "Enter interactive mode");
|
||||
|
||||
static int sandbox_cmdline_cb_jump(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
/* Remember to delete this U-Boot image later */
|
||||
state->jumped_fname = arg;
|
||||
|
||||
return 0;
|
||||
}
|
||||
SANDBOX_CMDLINE_OPT_SHORT(jump, 'j', 1, "Jumped from previous U-Boot");
|
||||
|
||||
static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
@ -126,6 +136,15 @@ static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
|
||||
SANDBOX_CMDLINE_OPT_SHORT(memory, 'm', 1,
|
||||
"Read/write ram_buf memory contents from file");
|
||||
|
||||
static int sandbox_cmdline_cb_rm_memory(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
state->ram_buf_rm = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
SANDBOX_CMDLINE_OPT(rm_memory, 0, "Remove memory file after reading");
|
||||
|
||||
static int sandbox_cmdline_cb_state(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
@ -159,6 +178,43 @@ static int sandbox_cmdline_cb_ignore_missing(struct sandbox_state *state,
|
||||
SANDBOX_CMDLINE_OPT_SHORT(ignore_missing, 'n', 0,
|
||||
"Ignore missing state on read");
|
||||
|
||||
static int sandbox_cmdline_cb_show_lcd(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
state->show_lcd = true;
|
||||
return 0;
|
||||
}
|
||||
SANDBOX_CMDLINE_OPT_SHORT(show_lcd, 'l', 0,
|
||||
"Show the sandbox LCD display");
|
||||
|
||||
static const char *term_args[STATE_TERM_COUNT] = {
|
||||
"raw-with-sigs",
|
||||
"raw",
|
||||
"cooked",
|
||||
};
|
||||
|
||||
static int sandbox_cmdline_cb_terminal(struct sandbox_state *state,
|
||||
const char *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < STATE_TERM_COUNT; i++) {
|
||||
if (!strcmp(arg, term_args[i])) {
|
||||
state->term_raw = i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Unknown terminal setting '%s' (", arg);
|
||||
for (i = 0; i < STATE_TERM_COUNT; i++)
|
||||
printf("%s%s", i ? ", " : "", term_args[i]);
|
||||
puts(")\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
SANDBOX_CMDLINE_OPT_SHORT(terminal, 't', 1,
|
||||
"Set terminal to raw/cooked mode");
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct sandbox_state *state;
|
||||
@ -176,6 +232,10 @@ int main(int argc, char *argv[])
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
/* Remove old memory file if required */
|
||||
if (state->ram_buf_rm && state->ram_buf_fname)
|
||||
os_unlink(state->ram_buf_fname);
|
||||
|
||||
/* Do pre- and post-relocation init */
|
||||
board_init_f(0);
|
||||
|
||||
|
||||
@ -365,7 +365,7 @@ int state_uninit(void)
|
||||
|
||||
state = &main_state;
|
||||
|
||||
if (state->write_ram_buf) {
|
||||
if (state->write_ram_buf && !state->ram_buf_rm) {
|
||||
err = os_write_ram_buf(state->ram_buf_fname);
|
||||
if (err) {
|
||||
printf("Failed to write RAM buffer\n");
|
||||
@ -380,6 +380,10 @@ int state_uninit(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete this at the last moment so as not to upset gdb too much */
|
||||
if (state->jumped_fname)
|
||||
os_unlink(state->jumped_fname);
|
||||
|
||||
if (state->state_fdt)
|
||||
os_free(state->state_fdt);
|
||||
memset(state, '\0', sizeof(*state));
|
||||
|
||||
@ -17,4 +17,100 @@
|
||||
colour = "white";
|
||||
sides = <6>;
|
||||
};
|
||||
|
||||
host@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "sandbox,host-emulation";
|
||||
cros-ec@0 {
|
||||
reg = <0>;
|
||||
compatible = "google,cros-ec";
|
||||
|
||||
/*
|
||||
* This describes the flash memory within the EC. Note
|
||||
* that the STM32L flash erases to 0, not 0xff.
|
||||
*/
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
flash@8000000 {
|
||||
reg = <0x08000000 0x20000>;
|
||||
erase-value = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
/* Information for sandbox */
|
||||
ro {
|
||||
reg = <0 0xf000>;
|
||||
};
|
||||
wp-ro {
|
||||
reg = <0xf000 0x1000>;
|
||||
};
|
||||
rw {
|
||||
reg = <0x10000 0x10000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lcd {
|
||||
compatible = "sandbox,lcd-sdl";
|
||||
xres = <800>;
|
||||
yres = <600>;
|
||||
};
|
||||
|
||||
cros-ec-keyb {
|
||||
compatible = "google,cros-ec-keyb";
|
||||
google,key-rows = <8>;
|
||||
google,key-columns = <13>;
|
||||
google,repeat-delay-ms = <240>;
|
||||
google,repeat-rate-ms = <30>;
|
||||
google,ghost-filter;
|
||||
/*
|
||||
* Keymap entries take the form of 0xRRCCKKKK where
|
||||
* RR=Row CC=Column KKKK=Key Code
|
||||
* The values below are for a US keyboard layout and
|
||||
* are taken from the Linux driver. Note that the
|
||||
* 102ND key is not used for US keyboards.
|
||||
*/
|
||||
linux,keymap = <
|
||||
/* CAPSLCK F1 B F10 */
|
||||
0x0001003a 0x0002003b 0x00030030 0x00040044
|
||||
/* N = R_ALT ESC */
|
||||
0x00060031 0x0008000d 0x000a0064 0x01010001
|
||||
/* F4 G F7 H */
|
||||
0x0102003e 0x01030022 0x01040041 0x01060023
|
||||
/* ' F9 BKSPACE L_CTRL */
|
||||
0x01080028 0x01090043 0x010b000e 0x0200001d
|
||||
/* TAB F3 T F6 */
|
||||
0x0201000f 0x0202003d 0x02030014 0x02040040
|
||||
/* ] Y 102ND [ */
|
||||
0x0205001b 0x02060015 0x02070056 0x0208001a
|
||||
/* F8 GRAVE F2 5 */
|
||||
0x02090042 0x03010029 0x0302003c 0x03030006
|
||||
/* F5 6 - \ */
|
||||
0x0304003f 0x03060007 0x0308000c 0x030b002b
|
||||
/* R_CTRL A D F */
|
||||
0x04000061 0x0401001e 0x04020020 0x04030021
|
||||
/* S K J ; */
|
||||
0x0404001f 0x04050025 0x04060024 0x04080027
|
||||
/* L ENTER Z C */
|
||||
0x04090026 0x040b001c 0x0501002c 0x0502002e
|
||||
/* V X , M */
|
||||
0x0503002f 0x0504002d 0x05050033 0x05060032
|
||||
/* L_SHIFT / . SPACE */
|
||||
0x0507002a 0x05080035 0x05090034 0x050B0039
|
||||
/* 1 3 4 2 */
|
||||
0x06010002 0x06020004 0x06030005 0x06040003
|
||||
/* 8 7 0 9 */
|
||||
0x06050009 0x06060008 0x0608000b 0x0609000a
|
||||
/* L_ALT DOWN RIGHT Q */
|
||||
0x060a0038 0x060b006c 0x060c006a 0x07010010
|
||||
/* E R W I */
|
||||
0x07020012 0x07030013 0x07040011 0x07050017
|
||||
/* U R_SHIFT P O */
|
||||
0x07060016 0x07070036 0x07080019 0x07090018
|
||||
/* UP LEFT */
|
||||
0x070b0067 0x070c0069>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
14
arch/sandbox/include/asm/arch-sandbox/sound.h
Normal file
14
arch/sandbox/include/asm/arch-sandbox/sound.h
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __SANDBOX_SOUND_H
|
||||
#define __SANDBOX_SOUND_H
|
||||
|
||||
int sound_play(unsigned int msec, unsigned int frequency);
|
||||
|
||||
int sound_init(const void *blob);
|
||||
|
||||
#endif
|
||||
118
arch/sandbox/include/asm/sdl.h
Normal file
118
arch/sandbox/include/asm/sdl.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Google, Inc
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __SANDBOX_SDL_H
|
||||
#define __SANDBOX_SDL_H
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef CONFIG_SANDBOX_SDL
|
||||
|
||||
/**
|
||||
* sandbox_sdl_init_display() - Set up SDL video ready for use
|
||||
*
|
||||
* @width: Window width in pixels
|
||||
* @height Window height in pixels
|
||||
* @log2_bpp: Log to base 2 of the number of bits per pixel. So a 32bpp
|
||||
* display will pass 5, since 2*5 = 32
|
||||
* @return 0 if OK, -ENODEV if no device, -EIO if SDL failed to initialize
|
||||
* and -EPERM if the video failed to come up.
|
||||
*/
|
||||
int sandbox_sdl_init_display(int width, int height, int log2_bpp);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_sync() - Sync current U-Boot LCD frame buffer to SDL
|
||||
*
|
||||
* This must be called periodically to update the screen for SDL so that the
|
||||
* user can see it.
|
||||
*
|
||||
* @lcd_base: Base of frame buffer
|
||||
* @return 0 if screen was updated, -ENODEV is there is no screen.
|
||||
*/
|
||||
int sandbox_sdl_sync(void *lcd_base);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_scan_keys() - scan for pressed keys
|
||||
*
|
||||
* Works out which keys are pressed and returns a list
|
||||
*
|
||||
* @key: Array to receive keycodes
|
||||
* @max_keys: Size of array
|
||||
* @return number of keycodes found, 0 if none, -ENODEV if no keyboard
|
||||
*/
|
||||
int sandbox_sdl_scan_keys(int key[], int max_keys);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_key_pressed() - check if a particular key is pressed
|
||||
*
|
||||
* @keycode: Keycode to check (KEY_... - see include/linux/input.h
|
||||
* @return 0 if pressed, -ENOENT if not pressed. -ENODEV if keybord not
|
||||
* available,
|
||||
*/
|
||||
int sandbox_sdl_key_pressed(int keycode);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_sound_start() - start playing a sound
|
||||
*
|
||||
* @frequency: Frequency of sounds in Hertz
|
||||
* @return 0 if OK, -ENODEV if no sound is available
|
||||
*/
|
||||
int sandbox_sdl_sound_start(uint frequency);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_sound_stop() - stop playing a sound
|
||||
*
|
||||
* @return 0 if OK, -ENODEV if no sound is available
|
||||
*/
|
||||
int sandbox_sdl_sound_stop(void);
|
||||
|
||||
/**
|
||||
* sandbox_sdl_sound_init() - set up the sound system
|
||||
*
|
||||
* @return 0 if OK, -ENODEV if no sound is available
|
||||
*/
|
||||
int sandbox_sdl_sound_init(void);
|
||||
|
||||
#else
|
||||
static inline int sandbox_sdl_init_display(int width, int height,
|
||||
int log2_bpp)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_sync(void *lcd_base)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_scan_keys(int key[], int max_keys)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_key_pressed(int keycode)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_sound_start(uint frequency)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_sound_stop(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int sandbox_sdl_sound_init(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -17,6 +17,29 @@ enum exit_type_id {
|
||||
STATE_EXIT_POWER_OFF,
|
||||
};
|
||||
|
||||
/**
|
||||
* Selects the behavior of the serial terminal.
|
||||
*
|
||||
* If Ctrl-C is processed by U-Boot, then the only way to quit sandbox is with
|
||||
* the 'reset' command, or equivalent.
|
||||
*
|
||||
* If the terminal is cooked, then Ctrl-C will terminate U-Boot, and the
|
||||
* command line will not be quite such a faithful emulation.
|
||||
*
|
||||
* Options are:
|
||||
*
|
||||
* raw-with-sigs - Raw, but allow signals (Ctrl-C will quit)
|
||||
* raw - Terminal is always raw
|
||||
* cooked - Terminal is always cooked
|
||||
*/
|
||||
enum state_terminal_raw {
|
||||
STATE_TERM_RAW_WITH_SIGS, /* Default */
|
||||
STATE_TERM_RAW,
|
||||
STATE_TERM_COOKED,
|
||||
|
||||
STATE_TERM_COUNT,
|
||||
};
|
||||
|
||||
struct sandbox_spi_info {
|
||||
const char *spec;
|
||||
const struct sandbox_spi_emu_ops *ops;
|
||||
@ -30,16 +53,20 @@ struct sandbox_state {
|
||||
enum exit_type_id exit_type; /* How we exited U-Boot */
|
||||
const char *parse_err; /* Error to report from parsing */
|
||||
int argc; /* Program arguments */
|
||||
char **argv;
|
||||
char **argv; /* Command line arguments */
|
||||
const char *jumped_fname; /* Jumped from previous U_Boot */
|
||||
uint8_t *ram_buf; /* Emulated RAM buffer */
|
||||
unsigned int ram_size; /* Size of RAM buffer */
|
||||
const char *ram_buf_fname; /* Filename to use for RAM buffer */
|
||||
bool ram_buf_rm; /* Remove RAM buffer file after read */
|
||||
bool write_ram_buf; /* Write RAM buffer on exit */
|
||||
const char *state_fname; /* File containing sandbox state */
|
||||
void *state_fdt; /* Holds saved state for sandbox */
|
||||
bool read_state; /* Read sandbox state on startup */
|
||||
bool write_state; /* Write sandbox state on exit */
|
||||
bool ignore_missing_state_on_read; /* No error if state missing */
|
||||
bool show_lcd; /* Show LCD on start-up */
|
||||
enum state_terminal_raw term_raw; /* Terminal raw/cooked */
|
||||
|
||||
/* Pointer to information for each SPI bus/cs */
|
||||
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
|
||||
|
||||
@ -25,4 +25,7 @@ int sandbox_main_loop_init(void);
|
||||
|
||||
int cleanup_before_linux(void);
|
||||
|
||||
/* drivers/video/sandbox_sdl.c */
|
||||
int sandbox_lcd_sdl_early_init(void);
|
||||
|
||||
#endif /* _U_BOOT_SANDBOX_H_ */
|
||||
|
||||
@ -1250,8 +1250,9 @@
|
||||
#define PUDR 0xA4050162
|
||||
#define PVDR 0xA4050164
|
||||
#define PWDR 0xA4050166
|
||||
#define PYDR 0xA4050168
|
||||
#define PZDR 0xA405016A
|
||||
#define PXDR 0xA4050168
|
||||
#define PYDR 0xA405016A
|
||||
#define PZDR 0xA405016C
|
||||
|
||||
/* UBC */
|
||||
#define CBR0 0xFF200000
|
||||
|
||||
@ -178,8 +178,9 @@
|
||||
#define PUDR 0xA4050162
|
||||
#define PVDR 0xA4050164
|
||||
#define PWDR 0xA4050166
|
||||
#define PYDR 0xA4050168
|
||||
#define PZDR 0xA405016A
|
||||
#define PXDR 0xA4050168
|
||||
#define PYDR 0xA405016A
|
||||
#define PZDR 0xA405016C
|
||||
|
||||
/* UBC */
|
||||
/* H-UDI */
|
||||
|
||||
@ -200,8 +200,9 @@
|
||||
#define PUDR 0xA4050162
|
||||
#define PVDR 0xA4050164
|
||||
#define PWDR 0xA4050166
|
||||
#define PYDR 0xA4050168
|
||||
#define PZDR 0xA405016A
|
||||
#define PXDR 0xA4050168
|
||||
#define PYDR 0xA405016A
|
||||
#define PZDR 0xA405016C
|
||||
|
||||
/* Ether */
|
||||
#define EDMR 0xA4600000
|
||||
|
||||
@ -29,6 +29,4 @@ LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
|
||||
LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
|
||||
|
||||
export NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
|
||||
PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename $(NORMAL_LIBGCC))
|
||||
|
||||
CONFIG_USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC))
|
||||
CONFIG_USE_PRIVATE_LIBGCC := arch/x86/lib
|
||||
|
||||
@ -23,5 +23,6 @@ obj-$(CONFIG_CMD_ZBOOT) += zimage.o
|
||||
LIBGCC := $(notdir $(NORMAL_LIBGCC))
|
||||
extra-y := $(LIBGCC)
|
||||
|
||||
$(obj)/$(LIBGCC): $(NORMAL_LIBGCC)
|
||||
$(OBJCOPY) $< $@ --prefix-symbols=__normal_
|
||||
OBJCOPYFLAGS := --prefix-symbols=__normal_
|
||||
$(obj)/$(LIBGCC): $(NORMAL_LIBGCC) FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
@ -120,7 +120,7 @@ void am33xx_spl_board_init(void)
|
||||
|
||||
/* power-ON 3V3 via Resetcontroller */
|
||||
oldspeed = i2c_get_bus_speed();
|
||||
if (0 != i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
|
||||
if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) {
|
||||
buf = RSTCTRL_FORCE_PWR_NEN;
|
||||
i2c_write(RSTCTRL_ADDR, RSTCTRL_CTRLREG, 1,
|
||||
(uint8_t *)&buf, sizeof(buf));
|
||||
@ -221,7 +221,7 @@ int board_late_init(void)
|
||||
TPS65217_WLEDCTRL1, 0x09, 0xFF);
|
||||
/* write bootinfo into scratchregister of resetcontroller */
|
||||
oldspeed = i2c_get_bus_speed();
|
||||
if (0 != i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
|
||||
if (i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC) >= 0) {
|
||||
i2c_write(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1,
|
||||
(uint8_t *)&buf, sizeof(buf));
|
||||
i2c_set_bus_speed(oldspeed);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
# (mem base + reserved)
|
||||
#
|
||||
|
||||
UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
|
||||
UBL_CONFIG = $(srctree)/board/$(BOARDDIR)/ublimage.cfg
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ALL-y += u-boot.ubl
|
||||
else
|
||||
|
||||
118
board/altera/socfpga/pll_config.h
Normal file
118
board/altera/socfpga/pll_config.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Copyright Altera Corporation (C) 2012-2014. All rights reserved
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
/* This file is generated by Preloader Generator */
|
||||
|
||||
#ifndef _PRELOADER_PLL_CONFIG_H_
|
||||
#define _PRELOADER_PLL_CONFIG_H_
|
||||
|
||||
/* PLL configuration data */
|
||||
/* Main PLL */
|
||||
#define CONFIG_HPS_MAINPLLGRP_VCO_DENOM (0)
|
||||
#define CONFIG_HPS_MAINPLLGRP_VCO_NUMER (63)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MPUCLK_CNT (0)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINCLK_CNT (0)
|
||||
#define CONFIG_HPS_MAINPLLGRP_DBGATCLK_CNT (0)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINQSPICLK_CNT (3)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINNANDSDMMCCLK_CNT (3)
|
||||
#define CONFIG_HPS_MAINPLLGRP_CFGS2FUSER0CLK_CNT (12)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3MPCLK (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3SPCLK (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINDIV_L4MPCLK (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_MAINDIV_L4SPCLK (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGATCLK (0)
|
||||
#define CONFIG_HPS_MAINPLLGRP_DBGDIV_DBGCLK (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_TRACEDIV_TRACECLK (0)
|
||||
/*
|
||||
* To tell where is the clock source:
|
||||
* 0 = MAINPLL
|
||||
* 1 = PERIPHPLL
|
||||
*/
|
||||
#define CONFIG_HPS_MAINPLLGRP_L4SRC_L4MP (1)
|
||||
#define CONFIG_HPS_MAINPLLGRP_L4SRC_L4SP (1)
|
||||
|
||||
/* Peripheral PLL */
|
||||
#define CONFIG_HPS_PERPLLGRP_VCO_DENOM (1)
|
||||
#define CONFIG_HPS_PERPLLGRP_VCO_NUMER (79)
|
||||
/*
|
||||
* To tell where is the VCOs source:
|
||||
* 0 = EOSC1
|
||||
* 1 = EOSC2
|
||||
* 2 = F2S
|
||||
*/
|
||||
#define CONFIG_HPS_PERPLLGRP_VCO_PSRC (0)
|
||||
#define CONFIG_HPS_PERPLLGRP_EMAC0CLK_CNT (3)
|
||||
#define CONFIG_HPS_PERPLLGRP_EMAC1CLK_CNT (3)
|
||||
#define CONFIG_HPS_PERPLLGRP_PERQSPICLK_CNT (1)
|
||||
#define CONFIG_HPS_PERPLLGRP_PERNANDSDMMCCLK_CNT (4)
|
||||
#define CONFIG_HPS_PERPLLGRP_PERBASECLK_CNT (4)
|
||||
#define CONFIG_HPS_PERPLLGRP_S2FUSER1CLK_CNT (9)
|
||||
#define CONFIG_HPS_PERPLLGRP_DIV_USBCLK (0)
|
||||
#define CONFIG_HPS_PERPLLGRP_DIV_SPIMCLK (0)
|
||||
#define CONFIG_HPS_PERPLLGRP_DIV_CAN0CLK (1)
|
||||
#define CONFIG_HPS_PERPLLGRP_DIV_CAN1CLK (1)
|
||||
#define CONFIG_HPS_PERPLLGRP_GPIODIV_GPIODBCLK (6249)
|
||||
/*
|
||||
* To tell where is the clock source:
|
||||
* 0 = F2S_PERIPH_REF_CLK
|
||||
* 1 = MAIN_CLK
|
||||
* 2 = PERIPH_CLK
|
||||
*/
|
||||
#define CONFIG_HPS_PERPLLGRP_SRC_SDMMC (2)
|
||||
#define CONFIG_HPS_PERPLLGRP_SRC_NAND (2)
|
||||
#define CONFIG_HPS_PERPLLGRP_SRC_QSPI (1)
|
||||
|
||||
/* SDRAM PLL */
|
||||
#ifdef CONFIG_SOCFPGA_ARRIA5
|
||||
/* Arria V SDRAM will run at 533MHz while Cyclone V still at 400MHz
|
||||
* This if..else... is not required if generated by tools */
|
||||
#define CONFIG_HPS_SDRPLLGRP_VCO_DENOM (2)
|
||||
#define CONFIG_HPS_SDRPLLGRP_VCO_NUMER (127)
|
||||
#else
|
||||
#define CONFIG_HPS_SDRPLLGRP_VCO_DENOM (0)
|
||||
#define CONFIG_HPS_SDRPLLGRP_VCO_NUMER (31)
|
||||
#endif /* CONFIG_SOCFPGA_ARRIA5 */
|
||||
|
||||
/*
|
||||
* To tell where is the VCOs source:
|
||||
* 0 = EOSC1
|
||||
* 1 = EOSC2
|
||||
* 2 = F2S
|
||||
*/
|
||||
#define CONFIG_HPS_SDRPLLGRP_VCO_SSRC (0)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_CNT (1)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDRDQSCLK_PHASE (0)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_CNT (0)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDR2XDQSCLK_PHASE (0)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDRDQCLK_CNT (1)
|
||||
#define CONFIG_HPS_SDRPLLGRP_DDRDQCLK_PHASE (4)
|
||||
#define CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_CNT (5)
|
||||
#define CONFIG_HPS_SDRPLLGRP_S2FUSER2CLK_PHASE (0)
|
||||
|
||||
/* Info for driver */
|
||||
#define CONFIG_HPS_CLK_OSC1_HZ (25000000)
|
||||
#define CONFIG_HPS_CLK_MAINVCO_HZ (1600000000)
|
||||
#define CONFIG_HPS_CLK_PERVCO_HZ (1000000000)
|
||||
#ifdef CONFIG_SOCFPGA_ARRIA5
|
||||
/* The if..else... is not required if generated by tools */
|
||||
#define CONFIG_HPS_CLK_SDRVCO_HZ (1066000000)
|
||||
#else
|
||||
#define CONFIG_HPS_CLK_SDRVCO_HZ (800000000)
|
||||
#endif
|
||||
#define CONFIG_HPS_CLK_EMAC0_HZ (250000000)
|
||||
#define CONFIG_HPS_CLK_EMAC1_HZ (250000000)
|
||||
#define CONFIG_HPS_CLK_USBCLK_HZ (200000000)
|
||||
#define CONFIG_HPS_CLK_NAND_HZ (50000000)
|
||||
#define CONFIG_HPS_CLK_SDMMC_HZ (200000000)
|
||||
#define CONFIG_HPS_CLK_QSPI_HZ (400000000)
|
||||
#define CONFIG_HPS_CLK_SPIM_HZ (200000000)
|
||||
#define CONFIG_HPS_CLK_CAN0_HZ (100000000)
|
||||
#define CONFIG_HPS_CLK_CAN1_HZ (100000000)
|
||||
#define CONFIG_HPS_CLK_GPIODB_HZ (32000)
|
||||
#define CONFIG_HPS_CLK_L4_MP_HZ (100000000)
|
||||
#define CONFIG_HPS_CLK_L4_SP_HZ (100000000)
|
||||
|
||||
#endif /* _PRELOADER_PLL_CONFIG_H_ */
|
||||
@ -8,4 +8,4 @@
|
||||
|
||||
obj-y += fx12mm.o
|
||||
|
||||
include $(SRCTREE)/board/xilinx/ppc405-generic/Makefile
|
||||
include $(srctree)/board/xilinx/ppc405-generic/Makefile
|
||||
|
||||
@ -8,4 +8,4 @@
|
||||
|
||||
obj-y += v5fx30teval.o
|
||||
|
||||
include $(SRCTREE)/board/xilinx/ppc440-generic/Makefile
|
||||
include $(srctree)/board/xilinx/ppc440-generic/Makefile
|
||||
|
||||
@ -79,6 +79,8 @@ static void get_eeprom(struct tricorder_eeprom *eeprom)
|
||||
} else {
|
||||
panic("Could not get board revision\n");
|
||||
}
|
||||
} else {
|
||||
memset(eeprom, 0, TRICORDER_EEPROM_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,10 +9,19 @@ obj-y = L1.o flash.o
|
||||
obj-y += init.o
|
||||
obj-y += bootscript.o
|
||||
|
||||
$(obj)/bootscript.c: $(obj)/bootscript.image
|
||||
od -t x1 -v -A x $^ | awk -f $(srctree)/$(src)/x2c.awk > $@
|
||||
quiet_cmd_awk = AWK $@
|
||||
cmd_awk = od -t x1 -v -A x $< | $(AWK) -f $(filter-out $<,$^) > $@
|
||||
|
||||
$(obj)/bootscript.c: $(obj)/bootscript.image $(src)/x2c.awk
|
||||
$(call cmd,awk)
|
||||
|
||||
quiet_cmd_mkimage = MKIMAGE $@
|
||||
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
MKIMAGEFLAGS_bootscript.image := -A ppc -O linux -T script -C none \
|
||||
-a 0 -e 0 -n bootscript
|
||||
$(obj)/bootscript.image: $(src)/bootscript.hush
|
||||
-$(OBJTREE)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d $< $@
|
||||
$(call cmd,mkimage)
|
||||
|
||||
clean-files := bootscript.c bootscript.image
|
||||
@ -31,24 +31,41 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static uint32_t mx53_dram_size[2];
|
||||
|
||||
phys_size_t get_effective_memsize(void)
|
||||
{
|
||||
/*
|
||||
* WARNING: We must override get_effective_memsize() function here
|
||||
* to report only the size of the first DRAM bank. This is to make
|
||||
* U-Boot relocator place U-Boot into valid memory, that is, at the
|
||||
* end of the first DRAM bank. If we did not override this function
|
||||
* like so, U-Boot would be placed at the address of the first DRAM
|
||||
* bank + total DRAM size - sizeof(uboot), which in the setup where
|
||||
* each DRAM bank contains 512MiB of DRAM would result in placing
|
||||
* U-Boot into invalid memory area close to the end of the first
|
||||
* DRAM bank.
|
||||
*/
|
||||
return mx53_dram_size[0];
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
u32 size1, size2;
|
||||
mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
|
||||
mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
|
||||
|
||||
size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
|
||||
size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
|
||||
|
||||
gd->ram_size = size1 + size2;
|
||||
gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
gd->bd->bi_dram[0].size = mx53_dram_size[0];
|
||||
|
||||
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
|
||||
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
|
||||
gd->bd->bi_dram[1].size = mx53_dram_size[1];
|
||||
}
|
||||
|
||||
static void setup_iomux_uart(void)
|
||||
|
||||
@ -30,24 +30,41 @@
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static uint32_t mx53_dram_size[2];
|
||||
|
||||
phys_size_t get_effective_memsize(void)
|
||||
{
|
||||
/*
|
||||
* WARNING: We must override get_effective_memsize() function here
|
||||
* to report only the size of the first DRAM bank. This is to make
|
||||
* U-Boot relocator place U-Boot into valid memory, that is, at the
|
||||
* end of the first DRAM bank. If we did not override this function
|
||||
* like so, U-Boot would be placed at the address of the first DRAM
|
||||
* bank + total DRAM size - sizeof(uboot), which in the setup where
|
||||
* each DRAM bank contains 512MiB of DRAM would result in placing
|
||||
* U-Boot into invalid memory area close to the end of the first
|
||||
* DRAM bank.
|
||||
*/
|
||||
return mx53_dram_size[0];
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
u32 size1, size2;
|
||||
mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
|
||||
mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
|
||||
|
||||
size1 = get_ram_size((void *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
|
||||
size2 = get_ram_size((void *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE);
|
||||
|
||||
gd->ram_size = size1 + size2;
|
||||
gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
|
||||
gd->bd->bi_dram[0].size = mx53_dram_size[0];
|
||||
|
||||
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
|
||||
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
|
||||
gd->bd->bi_dram[1].size = mx53_dram_size[1];
|
||||
}
|
||||
|
||||
u32 get_board_rev(void)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user