U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
February 2015
- 190 participants
- 588 discussions
Hi,
I have one of boards and would like to get mainline U-Boot booting on it.
I have followed the instructions for creating a BOOT.BIN file comprised of:
- boot.elf
- .bit file
- u-boot.elf
and putting it on a a micro-SD card.
This works OK with the diligent master branch from github. I can boot normally.
However this is 2013.10. Mainline U-Boot uses device tree so
presumably the elf file does not work. I expect we need to use
u-boot-dtb.bin.
However since this is not an elf file I'm not sure how to build the
image using the 'Create Zynq Boot Image' tool.
I don't see any instructions in REAME.zynq about how to create an SD card.
Any pointers please?
Regards,
Simon
3
5

13 Apr '15
When building a THumb-1-only target with CONFIG_SYS_THUMB_BUILD,
some files fail to build, most of the time because they include
mcr instructions, which only exist for Thumb-2.
Thos patch introduces a Kconfig option CONFIG_THUMB2 and uses
it to select between Thumb-2 and ARM mode for the aforementioned
files.
This code has been build-tested and run-tested on ED Mini V2,
both with U-Boot and SPL.
Signed-off-by: Albert ARIBAUD <albert.u.boot(a)aribaud.net>
---
arch/arm/Kconfig | 4 ++++
arch/arm/cpu/arm926ejs/Makefile | 11 +++++++++++
arch/arm/cpu/arm926ejs/orion5x/Makefile | 10 ++++++++++
arch/arm/lib/Makefile | 11 +++++++++++
examples/standalone/Makefile | 10 ++++++++++
include/configs/edminiv2.h | 2 ++
6 files changed, 48 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5eb1d03..264af8b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -10,6 +10,9 @@ config ARM64
config HAS_VBAR
bool
+config HAS_THUMB2
+ bool
+
config CPU_ARM720T
bool
@@ -32,6 +35,7 @@ config CPU_ARM1176
config CPU_V7
bool
select HAS_VBAR
+ select HAS_THUMB2
config CPU_PXA
bool
diff --git a/arch/arm/cpu/arm926ejs/Makefile b/arch/arm/cpu/arm926ejs/Makefile
index adcea9f..721b478 100644
--- a/arch/arm/cpu/arm926ejs/Makefile
+++ b/arch/arm/cpu/arm926ejs/Makefile
@@ -28,3 +28,14 @@ obj-$(CONFIG_ORION5X) += orion5x/
obj-$(CONFIG_PANTHEON) += pantheon/
obj-$(if $(filter spear,$(SOC)),y) += spear/
obj-$(CONFIG_ARCH_VERSATILE) += versatile/
+
+# some files can only build in ARM or THUMB2, not THUMB1
+
+ifdef CONFIG_SYS_THUMB_BUILD
+ifndef CONFIG_HAS_THUMB2
+
+CFLAGS_cpu.o := -marm
+CFLAGS_cache.o := -marm
+
+endif
+endif
diff --git a/arch/arm/cpu/arm926ejs/orion5x/Makefile b/arch/arm/cpu/arm926ejs/orion5x/Makefile
index 546ebcb..33dcad4 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/Makefile
+++ b/arch/arm/cpu/arm926ejs/orion5x/Makefile
@@ -16,3 +16,13 @@ obj-y += timer.o
ifndef CONFIG_SKIP_LOWLEVEL_INIT
obj-y += lowlevel_init.o
endif
+
+# some files can only build in ARM or THUMB2, not THUMB1
+
+ifdef CONFIG_SYS_THUMB_BUILD
+ifndef CONFIG_HAS_THUMB2
+
+CFLAGS_cpu.o := -marm
+
+endif
+endif
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index d74e4b8..4916f30 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -54,3 +54,14 @@ obj-$(CONFIG_DEBUG_LL) += debug.o
ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
extra-y += eabi_compat.o
endif
+
+# some files can only build in ARM or THUMB2, not THUMB1
+
+ifdef CONFIG_SYS_THUMB_BUILD
+ifndef CONFIG_HAS_THUMB2
+
+CFLAGS_cache.o := -marm
+CFLAGS_cache-cp15.o := -marm
+
+endif
+endif
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 0863a8c..5a6ae00 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -73,3 +73,13 @@ $(obj)/%.srec: $(obj)/% FORCE
$(obj)/%.bin: OBJCOPYFLAGS := -O binary
$(obj)/%.bin: $(obj)/% FORCE
$(call if_changed,objcopy)
+
+# some files can only build in ARM or THUMB2, not THUMB1
+
+ifdef CONFIG_SYS_THUMB_BUILD
+ifndef CONFIG_HAS_THUMB2
+
+CFLAGS_stubs.o := -marm
+
+endif
+endif
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h
index 70a698a..f07b0d9 100644
--- a/include/configs/edminiv2.h
+++ b/include/configs/edminiv2.h
@@ -12,6 +12,8 @@
#ifndef _CONFIG_EDMINIV2_H
#define _CONFIG_EDMINIV2_H
+#define CONFIG_SYS_THUMB_BUILD
+
/*
* Version number information
*/
--
2.1.0
2
7

[U-Boot] [PATCH v2] ARM: move -march=* and -mtune= options to arch/arm/Makefile
by Masahiro Yamada 11 Apr '15
by Masahiro Yamada 11 Apr '15
11 Apr '15
My main motivations for this commit are:
[1] Follow the arch/arm/Makefile style of Linux Kernel
[2] Maintain compiler options systematically
Currently, we give -march=* and -mtune=* options inconsistently:
Only some of the CPUs pass -march=* and -mtune=* options.
By collecting such options into the single place arch/arm/Makefile
we can tell which options are missing at a glance.
[3] Prepare for deprecating arch/*/cpu/*/config.mk
Note:
This commit just moves the compiler options so as not to change
the behavior at all. It does not care about the correctness of
the given options. Fox example, "-march=armv5te" might be better
than "-march=armv4" for ARM946EJS, but it is beyond the scope this
commit. Also, filling the missing -march=* and -tune=* is left
to follow-up patches.
Signed-off-by: Masahiro Yamada <yamada.m(a)jp.panasonic.com>
Acked-by: Marek Vasut <marex(a)denx.de>
Acked-by: Stefan Roese <sr(a)denx.de>
---
Changes in v2:
- Rebased onto u-boot-arm/master (commit 419fa9ae)
arch/arm/Makefile | 32 ++++++++++++++++++++++++++++++++
arch/arm/cpu/arm1136/config.mk | 9 ---------
arch/arm/cpu/arm1176/config.mk | 9 ---------
arch/arm/cpu/arm720t/config.mk | 9 ---------
arch/arm/cpu/arm920t/config.mk | 8 --------
arch/arm/cpu/arm926ejs/config.mk | 8 --------
arch/arm/cpu/arm946es/config.mk | 8 --------
arch/arm/cpu/armv7/config.mk | 5 -----
arch/arm/cpu/armv8/config.mk | 2 --
arch/arm/cpu/pxa/config.mk | 2 --
arch/arm/cpu/sa1100/config.mk | 9 ---------
11 files changed, 32 insertions(+), 69 deletions(-)
delete mode 100644 arch/arm/cpu/arm1136/config.mk
delete mode 100644 arch/arm/cpu/arm1176/config.mk
delete mode 100644 arch/arm/cpu/arm720t/config.mk
delete mode 100644 arch/arm/cpu/arm920t/config.mk
delete mode 100644 arch/arm/cpu/arm926ejs/config.mk
delete mode 100644 arch/arm/cpu/arm946es/config.mk
delete mode 100644 arch/arm/cpu/sa1100/config.mk
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 878ae26..275c817 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -2,6 +2,38 @@
# SPDX-License-Identifier: GPL-2.0+
#
+# This selects which instruction set is used.
+arch-$(CONFIG_CPU_ARM720T) =-march=armv4
+arch-$(CONFIG_CPU_ARM920T) =-march=armv4
+arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te
+arch-$(CONFIG_CPU_ARM946ES) =-march=armv4
+arch-$(CONFIG_CPU_SA1100) =-march=armv4
+arch-$(CONFIG_CPU_PXA) =
+arch-$(CONFIG_CPU_ARM1136) =-march=armv5
+arch-$(CONFIG_CPU_ARM1176) =-march=armv5t
+arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, -march=armv5)
+arch-$(CONFIG_ARM64) =-march=armv8-a
+
+# Evaluate arch cc-option calls now
+arch-y := $(arch-y)
+
+# This selects how we optimise for the processor.
+tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
+tune-$(CONFIG_CPU_ARM920T) =
+tune-$(CONFIG_CPU_ARM926EJS) =
+tune-$(CONFIG_CPU_ARM946ES) =
+tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
+tune-$(CONFIG_CPU_PXA) =-mcpu=xscale
+tune-$(CONFIG_CPU_ARM1136) =
+tune-$(CONFIG_CPU_ARM1176) =
+tune-$(CONFIG_CPU_V7) =
+tune-$(CONFIG_ARM64) =
+
+# Evaluate tune cc-option calls now
+tune-y := $(tune-y)
+
+PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
+
# Machine directory name. This list is sorted alphanumerically
# by CONFIG_* macro name.
machine-$(CONFIG_ARCH_AT91) += at91
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
deleted file mode 100644
index a82c6ce..0000000
--- a/arch/arm/cpu/arm1136/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-# Make ARMv5 to allow more compilers to work, even though its v6.
-PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk
deleted file mode 100644
index 5dc2ebb..0000000
--- a/arch/arm/cpu/arm1176/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-# Make ARMv5 to allow more compilers to work, even though its v6.
-PLATFORM_CPPFLAGS += -march=armv5t
diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
deleted file mode 100644
index 772fb41..0000000
--- a/arch/arm/cpu/arm720t/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
-# Marius Groeger <mgroeger(a)sysgo.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
deleted file mode 100644
index 799afff..0000000
--- a/arch/arm/cpu/arm920t/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
deleted file mode 100644
index bdb3da1..0000000
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv5te
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
deleted file mode 100644
index 438668d..0000000
--- a/arch/arm/cpu/arm946es/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 6c82c3b..63591d4 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -5,11 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# If armv7-a is not supported by GCC fall-back to armv5, which is
-# supported by more tool-chains
-PF_CPPFLAGS_ARMV7 := $(call cc-option, -march=armv7-a, -march=armv5)
-PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
-
# On supported platforms we set the bit which causes us to trap on unaligned
# memory access. This is the opposite of what the compiler expects to be
# the default so we must pass in -mno-unaligned-access so that it is aware
diff --git a/arch/arm/cpu/armv8/config.mk b/arch/arm/cpu/armv8/config.mk
index f5b9559..6850258 100644
--- a/arch/arm/cpu/armv8/config.mk
+++ b/arch/arm/cpu/armv8/config.mk
@@ -6,7 +6,5 @@
#
PLATFORM_RELFLAGS += -fno-common -ffixed-x18
-PF_CPPFLAGS_ARMV8 := $(call cc-option, -march=armv8-a)
PF_NO_UNALIGNED := $(call cc-option, -mstrict-align)
-PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV8)
PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk
index 525f5d3..7fb5316 100644
--- a/arch/arm/cpu/pxa/config.mk
+++ b/arch/arm/cpu/pxa/config.mk
@@ -6,8 +6,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-PLATFORM_CPPFLAGS += -mcpu=xscale
-
#
# !WARNING!
# The PXA's OneNAND SPL uses .text.0 and .text.1 segments to allow booting from
diff --git a/arch/arm/cpu/sa1100/config.mk b/arch/arm/cpu/sa1100/config.mk
deleted file mode 100644
index 3afa685..0000000
--- a/arch/arm/cpu/sa1100/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
-# Marius Groeger <mgroeger(a)sysgo.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100
--
1.9.1
5
6
Dear Tom,
The following changes since commit
b188067f39627d977bb1db67c8456e9aaab90743:
arm: vf610: fix boot from SD-card (2015-01-09 10:27:51 -0500)
are available in the git repository at:
git://git.denx.de/u-boot-arc.git
for you to fetch changes up to 4c8c485ad9249e1ca1822474954b78799ca937e9:
arc: introduce "mdbtrick" target (2015-01-09 23:59:54 +0300)
----------------------------------------------------------------
Alexey Brodkin (1):
arc: introduce "mdbtrick" target
arch/arc/Makefile | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--
Best regards,
Alexey
3
18
Based on Tom's announce mail
(http://lists.denx.de/pipermail/u-boot/2015-February/203606.html),
let's start removing non-generic ARM boards.
No conversion patches have been posted for these boards.
Changes in v4:
- Rebase on commit 4641429695
Changes in v3:
- Do not remove devkit3250 because Vladimir has post a patch
to convert it into Generic Board.
Changes in v2:
- Do not remove armada100 boards because Ajay will send a patch
to convert them.
Masahiro Yamada (9):
ARM: remove mx31ads board support
ARM: mx31: remove imx31_phycore board
ARM: remove jadecpu board support
ARM: remove zmx25 board support
ARM: remove dkb board support
ARM: remove cm4008 and cm41xx board support
ARM: remove a320evb board support
ARM: remove tnetv107x board support
ARM: davinci: remove hawkboard support
arch/arm/Kconfig | 45 --
arch/arm/cpu/arm1176/Makefile | 1 -
arch/arm/cpu/arm1176/start.S | 22 -
arch/arm/cpu/arm1176/tnetv107x/Makefile | 6 -
arch/arm/cpu/arm1176/tnetv107x/aemif.c | 78 ----
arch/arm/cpu/arm1176/tnetv107x/clock.c | 432 ------------------
arch/arm/cpu/arm1176/tnetv107x/init.c | 22 -
arch/arm/cpu/arm1176/tnetv107x/lowlevel_init.S | 10 -
arch/arm/cpu/arm1176/tnetv107x/mux.c | 319 -------------
arch/arm/cpu/arm1176/tnetv107x/timer.c | 93 ----
arch/arm/cpu/arm920t/Makefile | 2 -
arch/arm/cpu/arm920t/a320/Makefile | 9 -
arch/arm/cpu/arm920t/a320/reset.S | 10 -
arch/arm/cpu/arm920t/a320/timer.c | 118 -----
arch/arm/cpu/arm920t/ks8695/Makefile | 9 -
arch/arm/cpu/arm920t/ks8695/lowlevel_init.S | 189 --------
arch/arm/cpu/arm920t/ks8695/timer.c | 77 ----
arch/arm/cpu/arm926ejs/Makefile | 2 -
arch/arm/cpu/arm926ejs/mb86r0x/Makefile | 8 -
arch/arm/cpu/arm926ejs/mb86r0x/clock.c | 27 --
arch/arm/cpu/arm926ejs/mb86r0x/reset.c | 24 -
arch/arm/cpu/arm926ejs/mb86r0x/timer.c | 115 -----
arch/arm/cpu/arm926ejs/pantheon/Makefile | 9 -
arch/arm/cpu/arm926ejs/pantheon/cpu.c | 85 ----
arch/arm/cpu/arm926ejs/pantheon/dram.c | 117 -----
arch/arm/cpu/arm926ejs/pantheon/timer.c | 201 ---------
arch/arm/include/asm/arch-a320/a320.h | 22 -
arch/arm/include/asm/arch-ks8695/platform.h | 294 ------------
arch/arm/include/asm/arch-mb86r0x/hardware.h | 15 -
arch/arm/include/asm/arch-mb86r0x/mb86r0x.h | 599 -------------------------
arch/arm/include/asm/arch-pantheon/config.h | 53 ---
arch/arm/include/asm/arch-pantheon/cpu.h | 77 ----
arch/arm/include/asm/arch-pantheon/gpio.h | 0
arch/arm/include/asm/arch-pantheon/mfp.h | 39 --
arch/arm/include/asm/arch-pantheon/pantheon.h | 38 --
arch/arm/include/asm/arch-tnetv107x/clock.h | 53 ---
arch/arm/include/asm/arch-tnetv107x/hardware.h | 160 -------
arch/arm/include/asm/arch-tnetv107x/mux.h | 291 ------------
arch/arm/lib/asm-offsets.c | 46 --
arch/arm/mach-davinci/Kconfig | 4 -
board/Marvell/dkb/Kconfig | 15 -
board/Marvell/dkb/MAINTAINERS | 6 -
board/Marvell/dkb/Makefile | 9 -
board/Marvell/dkb/dkb.c | 85 ----
board/cm4008/Kconfig | 12 -
board/cm4008/MAINTAINERS | 6 -
board/cm4008/Makefile | 8 -
board/cm4008/cm4008.c | 88 ----
board/cm4008/config.mk | 1 -
board/cm4008/flash.c | 395 ----------------
board/cm41xx/Kconfig | 12 -
board/cm41xx/MAINTAINERS | 6 -
board/cm41xx/Makefile | 8 -
board/cm41xx/cm41xx.c | 88 ----
board/cm41xx/config.mk | 1 -
board/cm41xx/flash.c | 395 ----------------
board/davinci/da8xxevm/Kconfig | 13 -
board/davinci/da8xxevm/MAINTAINERS | 8 -
board/davinci/da8xxevm/Makefile | 1 -
board/davinci/da8xxevm/README.hawkboard | 92 ----
board/davinci/da8xxevm/hawkboard-ais-nand.cfg | 4 -
board/davinci/da8xxevm/hawkboard.c | 120 -----
board/davinci/da8xxevm/u-boot-spl-hawk.lds | 69 ---
board/faraday/a320evb/Kconfig | 15 -
board/faraday/a320evb/MAINTAINERS | 6 -
board/faraday/a320evb/Makefile | 9 -
board/faraday/a320evb/a320evb.c | 59 ---
board/faraday/a320evb/lowlevel_init.S | 106 -----
board/freescale/mx31ads/Kconfig | 15 -
board/freescale/mx31ads/MAINTAINERS | 6 -
board/freescale/mx31ads/Makefile | 8 -
board/freescale/mx31ads/lowlevel_init.S | 268 -----------
board/freescale/mx31ads/mx31ads.c | 114 -----
board/freescale/mx31ads/u-boot.lds | 110 -----
board/imx31_phycore/Kconfig | 12 -
board/imx31_phycore/MAINTAINERS | 11 -
board/imx31_phycore/Makefile | 9 -
board/imx31_phycore/imx31_phycore.c | 153 -------
board/imx31_phycore/lowlevel_init.S | 88 ----
board/syteco/jadecpu/Kconfig | 15 -
board/syteco/jadecpu/MAINTAINERS | 6 -
board/syteco/jadecpu/Makefile | 13 -
board/syteco/jadecpu/jadecpu.c | 160 -------
board/syteco/jadecpu/lowlevel_init.S | 249 ----------
board/syteco/zmx25/Kconfig | 15 -
board/syteco/zmx25/MAINTAINERS | 6 -
board/syteco/zmx25/Makefile | 9 -
board/syteco/zmx25/lowlevel_init.S | 97 ----
board/syteco/zmx25/zmx25.c | 174 -------
board/ti/tnetv107xevm/Kconfig | 15 -
board/ti/tnetv107xevm/MAINTAINERS | 6 -
board/ti/tnetv107xevm/Makefile | 5 -
board/ti/tnetv107xevm/config.mk | 5 -
board/ti/tnetv107xevm/sdb_board.c | 134 ------
configs/a320evb_defconfig | 2 -
configs/cm4008_defconfig | 2 -
configs/cm41xx_defconfig | 2 -
configs/dkb_defconfig | 2 -
configs/hawkboard_defconfig | 4 -
configs/hawkboard_uart_defconfig | 5 -
configs/imx31_phycore_defconfig | 2 -
configs/imx31_phycore_eet_defconfig | 3 -
configs/jadecpu_defconfig | 2 -
configs/mx31ads_defconfig | 2 -
configs/tnetv107x_evm_defconfig | 2 -
configs/zmx25_defconfig | 2 -
doc/README.scrapyard | 44 +-
drivers/net/Makefile | 1 -
drivers/net/ks8695eth.c | 229 ----------
drivers/serial/Makefile | 1 -
drivers/serial/serial.c | 2 -
drivers/serial/serial_ks8695.c | 121 -----
drivers/video/Makefile | 1 -
drivers/video/mb86r0xgdc.c | 168 -------
drivers/watchdog/Makefile | 1 -
drivers/watchdog/tnetv107x_wdt.c | 165 -------
include/configs/a320evb.h | 211 ---------
include/configs/cm4008.h | 104 -----
include/configs/cm41xx.h | 104 -----
include/configs/dkb.h | 51 ---
include/configs/hawkboard.h | 220 ---------
include/configs/imx31_phycore.h | 202 ---------
include/configs/jadecpu.h | 273 -----------
include/configs/mx31ads.h | 188 --------
include/configs/tnetv107x_evm.h | 139 ------
include/configs/zmx25.h | 162 -------
include/netdev.h | 1 -
include/serial.h | 3 +-
128 files changed, 28 insertions(+), 9454 deletions(-)
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/Makefile
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/aemif.c
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/clock.c
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/init.c
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/lowlevel_init.S
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/mux.c
delete mode 100644 arch/arm/cpu/arm1176/tnetv107x/timer.c
delete mode 100644 arch/arm/cpu/arm920t/a320/Makefile
delete mode 100644 arch/arm/cpu/arm920t/a320/reset.S
delete mode 100644 arch/arm/cpu/arm920t/a320/timer.c
delete mode 100644 arch/arm/cpu/arm920t/ks8695/Makefile
delete mode 100644 arch/arm/cpu/arm920t/ks8695/lowlevel_init.S
delete mode 100644 arch/arm/cpu/arm920t/ks8695/timer.c
delete mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/Makefile
delete mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/clock.c
delete mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/reset.c
delete mode 100644 arch/arm/cpu/arm926ejs/mb86r0x/timer.c
delete mode 100644 arch/arm/cpu/arm926ejs/pantheon/Makefile
delete mode 100644 arch/arm/cpu/arm926ejs/pantheon/cpu.c
delete mode 100644 arch/arm/cpu/arm926ejs/pantheon/dram.c
delete mode 100644 arch/arm/cpu/arm926ejs/pantheon/timer.c
delete mode 100644 arch/arm/include/asm/arch-a320/a320.h
delete mode 100644 arch/arm/include/asm/arch-ks8695/platform.h
delete mode 100644 arch/arm/include/asm/arch-mb86r0x/hardware.h
delete mode 100644 arch/arm/include/asm/arch-mb86r0x/mb86r0x.h
delete mode 100644 arch/arm/include/asm/arch-pantheon/config.h
delete mode 100644 arch/arm/include/asm/arch-pantheon/cpu.h
delete mode 100644 arch/arm/include/asm/arch-pantheon/gpio.h
delete mode 100644 arch/arm/include/asm/arch-pantheon/mfp.h
delete mode 100644 arch/arm/include/asm/arch-pantheon/pantheon.h
delete mode 100644 arch/arm/include/asm/arch-tnetv107x/clock.h
delete mode 100644 arch/arm/include/asm/arch-tnetv107x/hardware.h
delete mode 100644 arch/arm/include/asm/arch-tnetv107x/mux.h
delete mode 100644 board/Marvell/dkb/Kconfig
delete mode 100644 board/Marvell/dkb/MAINTAINERS
delete mode 100644 board/Marvell/dkb/Makefile
delete mode 100644 board/Marvell/dkb/dkb.c
delete mode 100644 board/cm4008/Kconfig
delete mode 100644 board/cm4008/MAINTAINERS
delete mode 100644 board/cm4008/Makefile
delete mode 100644 board/cm4008/cm4008.c
delete mode 100644 board/cm4008/config.mk
delete mode 100644 board/cm4008/flash.c
delete mode 100644 board/cm41xx/Kconfig
delete mode 100644 board/cm41xx/MAINTAINERS
delete mode 100644 board/cm41xx/Makefile
delete mode 100644 board/cm41xx/cm41xx.c
delete mode 100644 board/cm41xx/config.mk
delete mode 100644 board/cm41xx/flash.c
delete mode 100644 board/davinci/da8xxevm/README.hawkboard
delete mode 100644 board/davinci/da8xxevm/hawkboard-ais-nand.cfg
delete mode 100644 board/davinci/da8xxevm/hawkboard.c
delete mode 100644 board/davinci/da8xxevm/u-boot-spl-hawk.lds
delete mode 100644 board/faraday/a320evb/Kconfig
delete mode 100644 board/faraday/a320evb/MAINTAINERS
delete mode 100644 board/faraday/a320evb/Makefile
delete mode 100644 board/faraday/a320evb/a320evb.c
delete mode 100644 board/faraday/a320evb/lowlevel_init.S
delete mode 100644 board/freescale/mx31ads/Kconfig
delete mode 100644 board/freescale/mx31ads/MAINTAINERS
delete mode 100644 board/freescale/mx31ads/Makefile
delete mode 100644 board/freescale/mx31ads/lowlevel_init.S
delete mode 100644 board/freescale/mx31ads/mx31ads.c
delete mode 100644 board/freescale/mx31ads/u-boot.lds
delete mode 100644 board/imx31_phycore/Kconfig
delete mode 100644 board/imx31_phycore/MAINTAINERS
delete mode 100644 board/imx31_phycore/Makefile
delete mode 100644 board/imx31_phycore/imx31_phycore.c
delete mode 100644 board/imx31_phycore/lowlevel_init.S
delete mode 100644 board/syteco/jadecpu/Kconfig
delete mode 100644 board/syteco/jadecpu/MAINTAINERS
delete mode 100644 board/syteco/jadecpu/Makefile
delete mode 100644 board/syteco/jadecpu/jadecpu.c
delete mode 100644 board/syteco/jadecpu/lowlevel_init.S
delete mode 100644 board/syteco/zmx25/Kconfig
delete mode 100644 board/syteco/zmx25/MAINTAINERS
delete mode 100644 board/syteco/zmx25/Makefile
delete mode 100644 board/syteco/zmx25/lowlevel_init.S
delete mode 100644 board/syteco/zmx25/zmx25.c
delete mode 100644 board/ti/tnetv107xevm/Kconfig
delete mode 100644 board/ti/tnetv107xevm/MAINTAINERS
delete mode 100644 board/ti/tnetv107xevm/Makefile
delete mode 100644 board/ti/tnetv107xevm/config.mk
delete mode 100644 board/ti/tnetv107xevm/sdb_board.c
delete mode 100644 configs/a320evb_defconfig
delete mode 100644 configs/cm4008_defconfig
delete mode 100644 configs/cm41xx_defconfig
delete mode 100644 configs/dkb_defconfig
delete mode 100644 configs/hawkboard_defconfig
delete mode 100644 configs/hawkboard_uart_defconfig
delete mode 100644 configs/imx31_phycore_defconfig
delete mode 100644 configs/imx31_phycore_eet_defconfig
delete mode 100644 configs/jadecpu_defconfig
delete mode 100644 configs/mx31ads_defconfig
delete mode 100644 configs/tnetv107x_evm_defconfig
delete mode 100644 configs/zmx25_defconfig
delete mode 100644 drivers/net/ks8695eth.c
delete mode 100644 drivers/serial/serial_ks8695.c
delete mode 100644 drivers/video/mb86r0xgdc.c
delete mode 100644 drivers/watchdog/tnetv107x_wdt.c
delete mode 100644 include/configs/a320evb.h
delete mode 100644 include/configs/cm4008.h
delete mode 100644 include/configs/cm41xx.h
delete mode 100644 include/configs/dkb.h
delete mode 100644 include/configs/hawkboard.h
delete mode 100644 include/configs/imx31_phycore.h
delete mode 100644 include/configs/jadecpu.h
delete mode 100644 include/configs/mx31ads.h
delete mode 100644 include/configs/tnetv107x_evm.h
delete mode 100644 include/configs/zmx25.h
--
1.9.1
4
18
Configure the pinctrl as it required to make some IO controllers
working (USB/UART/I2C/...).
The idea would be in the next version to modify the pch GPIO driver and
configure these pins through the device tree.
These modifications are ported from the coreboot project.
Signed-off-by: Gabriel Huau <contact(a)huau-gabriel.fr>
---
arch/x86/cpu/baytrail/Makefile | 1 +
arch/x86/cpu/baytrail/gpio.c | 206 +++++++++++++++
arch/x86/include/asm/arch-baytrail/gpio.h | 364 ++++++++++++++++++++++++++
arch/x86/include/asm/arch-baytrail/iomap.h | 73 ++++++
arch/x86/include/asm/arch-baytrail/irq.h | 119 +++++++++
arch/x86/include/asm/arch-baytrail/irqroute.h | 67 +++++
arch/x86/include/asm/arch-baytrail/pci_devs.h | 144 ++++++++++
arch/x86/include/asm/arch-baytrail/pmc.h | 253 ++++++++++++++++++
board/intel/minnowmax/minnowmax.c | 212 +++++++++++++++
include/configs/minnowmax.h | 11 +
10 files changed, 1450 insertions(+)
create mode 100644 arch/x86/cpu/baytrail/gpio.c
create mode 100644 arch/x86/include/asm/arch-baytrail/iomap.h
create mode 100644 arch/x86/include/asm/arch-baytrail/irq.h
create mode 100644 arch/x86/include/asm/arch-baytrail/irqroute.h
create mode 100644 arch/x86/include/asm/arch-baytrail/pci_devs.h
create mode 100644 arch/x86/include/asm/arch-baytrail/pmc.h
diff --git a/arch/x86/cpu/baytrail/Makefile b/arch/x86/cpu/baytrail/Makefile
index 8914e8b..c20a616 100644
--- a/arch/x86/cpu/baytrail/Makefile
+++ b/arch/x86/cpu/baytrail/Makefile
@@ -8,3 +8,4 @@ obj-y += early_uart.o
obj-y += fsp_configs.o
obj-y += pci.o
obj-y += valleyview.o
+obj-y += gpio.o
diff --git a/arch/x86/cpu/baytrail/gpio.c b/arch/x86/cpu/baytrail/gpio.c
new file mode 100644
index 0000000..0ad41cc
--- /dev/null
+++ b/arch/x86/cpu/baytrail/gpio.c
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <fdtdec.h>
+#include <pci.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/irqroute.h>
+#include <asm/arch/pmc.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
+#include <asm/pci.h>
+
+/* GPIO-to-Pad LUTs */
+static const u8 gpncore_gpio_to_pad[GPNCORE_COUNT] = {
+ 19, 18, 17, 20, 21, 22, 24, 25, /* [ 0: 7] */
+ 23, 16, 14, 15, 12, 26, 27, 1, /* [ 8:15] */
+ 4, 8, 11, 0, 3, 6, 10, 13, /* [16:23] */
+ 2, 5, 9 /* [24:26] */
+};
+
+static const u8 gpscore_gpio_to_pad[GPSCORE_COUNT] = {
+ 85, 89, 93, 96, 99, 102, 98, 101, /* [ 0: 7] */
+ 34, 37, 36, 38, 39, 35, 40, 84, /* [ 8: 15] */
+ 62, 61, 64, 59, 54, 56, 60, 55, /* [16: 23] */
+ 63, 57, 51, 50, 53, 47, 52, 49, /* [24: 31] */
+ 48, 43, 46, 41, 45, 42, 58, 44, /* [32: 39] */
+ 95, 105, 70, 68, 67, 66, 69, 71, /* [40: 47] */
+ 65, 72, 86, 90, 88, 92, 103, 77, /* [48: 55] */
+ 79, 83, 78, 81, 80, 82, 13, 12, /* [56: 63] */
+ 15, 14, 17, 18, 19, 16, 2, 1, /* [64: 71] */
+ 0, 4, 6, 7, 9, 8, 33, 32, /* [72: 79] */
+ 31, 30, 29, 27, 25, 28, 26, 23, /* [80: 87] */
+ 21, 20, 24, 22, 5, 3, 10, 11, /* [88: 95] */
+ 106, 87, 91, 104, 97, 100 /* [96:101] */
+};
+
+static const u8 gpssus_gpio_to_pad[GPSSUS_COUNT] = {
+ 29, 33, 30, 31, 32, 34, 36, 35, /* [ 0: 7] */
+ 38, 37, 18, 7, 11, 20, 17, 1, /* [ 8:15] */
+ 8, 10, 19, 12, 0, 2, 23, 39, /* [16:23] */
+ 28, 27, 22, 21, 24, 25, 26, 51, /* [24:31] */
+ 56, 54, 49, 55, 48, 57, 50, 58, /* [32:39] */
+ 52, 53, 59, 40 /* [40:43] */
+};
+
+/* GPIO bank descriptions */
+static const struct gpio_bank gpncore_bank = {
+ .gpio_count = GPNCORE_COUNT,
+ .gpio_to_pad = gpncore_gpio_to_pad,
+ .legacy_base = GP_LEGACY_BASE_NONE,
+ .pad_base = GPNCORE_PAD_BASE,
+ .has_wake_en = 0,
+ .gpio_f1_range_start = GPNCORE_GPIO_F1_RANGE_START,
+ .gpio_f1_range_end = GPNCORE_GPIO_F1_RANGE_END,
+};
+
+static const struct gpio_bank gpscore_bank = {
+ .gpio_count = GPSCORE_COUNT,
+ .gpio_to_pad = gpscore_gpio_to_pad,
+ .legacy_base = GPSCORE_LEGACY_BASE,
+ .pad_base = GPSCORE_PAD_BASE,
+ .has_wake_en = 0,
+ .gpio_f1_range_start = GPSCORE_GPIO_F1_RANGE_START,
+ .gpio_f1_range_end = GPSCORE_GPIO_F1_RANGE_END,
+};
+
+static const struct gpio_bank gpssus_bank = {
+ .gpio_count = GPSSUS_COUNT,
+ .gpio_to_pad = gpssus_gpio_to_pad,
+ .legacy_base = GPSSUS_LEGACY_BASE,
+ .pad_base = GPSSUS_PAD_BASE,
+ .has_wake_en = 1,
+ .gpio_f1_range_start = GPSSUS_GPIO_F1_RANGE_START,
+ .gpio_f1_range_end = GPSSUS_GPIO_F1_RANGE_END,
+};
+
+static void setup_gpios(const struct byt_gpio_map *gpios,
+ const struct gpio_bank *bank)
+{
+ const struct byt_gpio_map *config;
+ int gpio = 0;
+ u32 reg, pad_conf0;
+ u8 set, bit;
+
+ u32 use_sel[4] = {0};
+ u32 io_sel[4] = {0};
+ u32 gp_lvl[4] = {0};
+ u32 tpe[4] = {0};
+ u32 tne[4] = {0};
+ u32 wake_en[4] = {0};
+
+ if (!gpios)
+ return;
+
+ for (config = gpios; config->pad_conf0 != GPIO_LIST_END;
+ config++, gpio++) {
+ if (gpio > bank->gpio_count)
+ break;
+
+ set = gpio >> 5;
+ bit = gpio % 32;
+
+ if (bank->legacy_base != GP_LEGACY_BASE_NONE) {
+ /* Legacy IO configuration */
+ use_sel[set] |= config->use_sel << bit;
+ io_sel[set] |= config->io_sel << bit;
+ gp_lvl[set] |= config->gp_lvl << bit;
+ tpe[set] |= config->tpe << bit;
+ tne[set] |= config->tne << bit;
+
+ /* Some banks do not have wake_en ability */
+ if (bank->has_wake_en)
+ wake_en[set] |= config->wake_en << bit;
+ }
+
+ /* Pad configuration registers */
+ reg = bank->pad_base + 16 * bank->gpio_to_pad[gpio];
+
+ /* Add correct func to GPIO pad config */
+ pad_conf0 = config->pad_conf0;
+ if (config->is_gpio) {
+ if (gpio >= bank->gpio_f1_range_start &&
+ gpio <= bank->gpio_f1_range_end)
+ pad_conf0 |= PAD_FUNC1;
+ else
+ pad_conf0 |= PAD_FUNC0;
+ }
+
+ writel(reg + PAD_CONF0_REG, pad_conf0);
+ writel(reg + PAD_CONF1_REG, config->pad_conf1);
+ writel(reg + PAD_VAL_REG, config->pad_val);
+ }
+
+ if (bank->legacy_base != GP_LEGACY_BASE_NONE)
+ for (set = 0; set <= (bank->gpio_count - 1) / 32; ++set) {
+ reg = bank->legacy_base + 0x20 * set;
+
+ outl(use_sel[set], reg + LEGACY_USE_SEL_REG);
+ outl(io_sel[set], reg + LEGACY_IO_SEL_REG);
+ outl(gp_lvl[set], reg + LEGACY_GP_LVL_REG);
+ outl(tpe[set], reg + LEGACY_TPE_REG);
+ outl(tne[set], reg + LEGACY_TNE_REG);
+
+ /* TS registers are WOC */
+ outl(0, reg + LEGACY_TS_REG);
+
+ if (bank->has_wake_en)
+ outl(wake_en[set], reg + LEGACY_WAKE_EN_REG);
+ }
+}
+
+static void setup_gpio_route(const struct byt_gpio_map *sus,
+ const struct byt_gpio_map *core)
+{
+ uint32_t route_reg = 0;
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ /* SMI takes precedence and wake_en implies SCI. */
+ if (sus[i].smi)
+ route_reg |= ROUTE_SMI << (2 * i);
+ else if (sus[i].sci)
+ route_reg |= ROUTE_SCI << (2 * i);
+
+ if (core[i].smi)
+ route_reg |= ROUTE_SMI << (2 * (i + 8));
+ else if (core[i].sci)
+ route_reg |= ROUTE_SCI << (2 * (i + 8));
+ }
+}
+
+static void setup_dirqs(const u8 dirq[GPIO_MAX_DIRQS],
+ const struct gpio_bank *bank)
+{
+ u32 reg = bank->pad_base + PAD_BASE_DIRQ_OFFSET;
+ u32 val;
+ int i;
+
+ /* Write all four DIRQ registers */
+ for (i = 0; i < 4; ++i) {
+ val = dirq[i * 4 + 3] << 24 | dirq[i * 4 + 2] << 16 |
+ dirq[i * 4 + 1] << 8 | dirq[i * 4];
+ writel(reg + i * 4, val);
+ }
+}
+
+void setup_soc_gpios(struct byt_gpio_config *config)
+{
+ if (config) {
+ setup_gpios(config->ncore, &gpncore_bank);
+ setup_gpios(config->score, &gpscore_bank);
+ setup_gpios(config->ssus, &gpssus_bank);
+ setup_gpio_route(config->ssus, config->score);
+
+ if (config->core_dirq)
+ setup_dirqs(*config->core_dirq, &gpscore_bank);
+
+ if (config->sus_dirq)
+ setup_dirqs(*config->sus_dirq, &gpssus_bank);
+ }
+}
diff --git a/arch/x86/include/asm/arch-baytrail/gpio.h b/arch/x86/include/asm/arch-baytrail/gpio.h
index ab4e059..40b0ffa 100644
--- a/arch/x86/include/asm/arch-baytrail/gpio.h
+++ b/arch/x86/include/asm/arch-baytrail/gpio.h
@@ -7,7 +7,371 @@
#ifndef _X86_ARCH_GPIO_H_
#define _X86_ARCH_GPIO_H_
+#include <common.h>
+#include <asm/arch-baytrail/iomap.h>
+#include <asm/io.h>
+
/* Where in config space is the register that points to the GPIO registers? */
#define PCI_CFG_GPIOBASE 0x44
+/* Pad base, ex. PAD_CONF0[n]= PAD_BASE+16*n */
+#define GPSCORE_PAD_BASE (IO_BASE_ADDRESS + IO_BASE_OFFSET_GPSCORE)
+#define GPNCORE_PAD_BASE (IO_BASE_ADDRESS + IO_BASE_OFFSET_GPNCORE)
+#define GPSSUS_PAD_BASE (IO_BASE_ADDRESS + IO_BASE_OFFSET_GPSSUS)
+
+/* DIRQ registers start at pad base + 0x980 */
+#define PAD_BASE_DIRQ_OFFSET 0x980
+
+/* Pad register offset */
+#define PAD_CONF0_REG 0x0
+#define PAD_CONF1_REG 0x4
+#define PAD_VAL_REG 0x8
+
+/* Legacy IO register base */
+#define GPSCORE_LEGACY_BASE (GPIO_BASE_ADDRESS + 0x00)
+#define GPSSUS_LEGACY_BASE (GPIO_BASE_ADDRESS + 0x80)
+/* Some banks have no legacy GPIO interface */
+#define GP_LEGACY_BASE_NONE 0xFFFF
+
+#define LEGACY_USE_SEL_REG 0x00
+#define LEGACY_IO_SEL_REG 0x04
+#define LEGACY_GP_LVL_REG 0x08
+#define LEGACY_TPE_REG 0x0C
+#define LEGACY_TNE_REG 0x10
+#define LEGACY_TS_REG 0x14
+#define LEGACY_WAKE_EN_REG 0x18
+
+/* Number of GPIOs in each bank */
+#define GPNCORE_COUNT 27
+#define GPSCORE_COUNT 102
+#define GPSSUS_COUNT 44
+
+/* GPIO legacy IO register settings */
+#define GPIO_USE_MMIO 0
+#define GPIO_USE_LEGACY 1
+
+#define GPIO_DIR_OUTPUT 0
+#define GPIO_DIR_INPUT 1
+
+#define GPIO_LEVEL_LOW 0
+#define GPIO_LEVEL_HIGH 1
+
+#define GPIO_PEDGE_DISABLE 0
+#define GPIO_PEDGE_ENABLE 1
+
+#define GPIO_NEDGE_DISABLE 0
+#define GPIO_NEDGE_ENABLE 1
+
+/* config0[29] - Disable second mask */
+#define PAD_MASK2_DISABLE (1 << 29)
+
+/* config0[27] - Direct Irq En */
+#define PAD_IRQ_EN (1 << 27)
+
+/* config0[26] - gd_tne */
+#define PAD_TNE_IRQ (1 << 26)
+
+/* config0[25] - gd_tpe */
+#define PAD_TPE_IRQ (1 << 25)
+
+/* config0[24] - Gd Level */
+#define PAD_LEVEL_IRQ (1 << 24)
+#define PAD_EDGE_IRQ (0 << 24)
+
+/* config0[17] - Slow clkgate / glitch filter */
+#define PAD_SLOWGF_ENABLE (1 << 17)
+
+/* config0[16] - Fast clkgate / glitch filter */
+#define PAD_FASTGF_ENABLE (1 << 16)
+
+/* config0[15] - Hysteresis enable (inverted) */
+#define PAD_HYST_DISABLE (1 << 15)
+#define PAD_HYST_ENABLE (0 << 15)
+
+/* config0[14:13] - Hysteresis control */
+#define PAD_HYST_CTRL_DEFAULT (2 << 13)
+
+/* config0[11] - Bypass Flop */
+#define PAD_FLOP_BYPASS (1 << 11)
+#define PAD_FLOP_ENABLE (0 << 11)
+
+/* config0[10:9] - Pull str */
+#define PAD_PU_2K (0 << 9)
+#define PAD_PU_10K (1 << 9)
+#define PAD_PU_20K (2 << 9)
+#define PAD_PU_40K (3 << 9)
+
+/* config0[8:7] - Pull assign */
+#define PAD_PULL_DISABLE (0 << 7)
+#define PAD_PULL_UP (1 << 7)
+#define PAD_PULL_DOWN (2 << 7)
+
+/* config0[2:0] - Func. pin mux */
+#define PAD_FUNC0 0x0
+#define PAD_FUNC1 0x1
+#define PAD_FUNC2 0x2
+#define PAD_FUNC3 0x3
+#define PAD_FUNC4 0x4
+#define PAD_FUNC5 0x5
+#define PAD_FUNC6 0x6
+
+/* pad config0 power-on values - We will not often want to change these */
+#define PAD_CONFIG0_DEFAULT (PAD_MASK2_DISABLE | PAD_SLOWGF_ENABLE | \
+ PAD_FASTGF_ENABLE | PAD_HYST_DISABLE | \
+ PAD_HYST_CTRL_DEFAULT | PAD_FLOP_BYPASS)
+
+/* pad config1 reg power-on values - Shouldn't need to change this */
+#define PAD_CONFIG1_DEFAULT 0x8000
+
+/* pad_val[2] - Iinenb - active low */
+#define PAD_VAL_INPUT_DISABLE (1 << 2)
+#define PAD_VAL_INPUT_ENABLE (0 << 2)
+
+/* pad_val[1] - Ioutenb - active low */
+#define PAD_VAL_OUTPUT_DISABLE (1 << 1)
+#define PAD_VAL_OUTPUT_ENABLE (0 << 1)
+
+/* Input / Output state should usually be mutually exclusive */
+#define PAD_VAL_INPUT (PAD_VAL_INPUT_ENABLE | PAD_VAL_OUTPUT_DISABLE)
+#define PAD_VAL_OUTPUT (PAD_VAL_OUTPUT_ENABLE | PAD_VAL_INPUT_DISABLE)
+
+/* pad_val[0] - Value */
+#define PAD_VAL_HIGH (1 << 0)
+#define PAD_VAL_LOW (0 << 0)
+
+/* pad_val reg power-on default varies by pad, and apparently can cause issues
+ * if not set correctly, even if the pin isn't configured as GPIO. */
+#define PAD_VAL_DEFAULT PAD_VAL_INPUT
+
+/* Configure GPIOs as MMIO by default */
+#define GPIO_INPUT_PU_10K(_func) \
+ { .pad_conf0 = PAD_FUNC##_func | PAD_PU_10K | \
+ PAD_PULL_UP | \
+ PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_MMIO, \
+ .is_gpio = 1 }
+
+#define GPIO_INPUT_PD_10K \
+ { .pad_conf0 = PAD_PU_10K | PAD_PULL_DOWN | PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_MMIO, \
+ .is_gpio = 1 }
+
+#define GPIO_INPUT_NOPU \
+ { .pad_conf0 = PAD_PU_10K | PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_MMIO, \
+ .is_gpio = 1 }
+
+#define GPIO_INPUT_LEGACY_NOPU \
+ { .pad_conf0 = PAD_PU_10K | PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_INPUT, \
+ .is_gpio = 1 }
+
+/* Direct / dedicated IRQ input - pass signal directly to apic */
+#define GPIO_DIRQ \
+ { .pad_conf0 = PAD_PU_10K | PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT \
+ | PAD_FUNC0 | PAD_IRQ_EN | PAD_TPE_IRQ | PAD_LEVEL_IRQ, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, }
+
+
+#define GPIO_OUT_LOW \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_OUTPUT | PAD_VAL_LOW, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_OUTPUT, \
+ .gp_lvl = GPIO_LEVEL_LOW, \
+ .is_gpio = 1 }
+
+#define GPIO_OUT_HIGH \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_OUTPUT | PAD_VAL_HIGH, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_OUTPUT, \
+ .gp_lvl = GPIO_LEVEL_HIGH, \
+ .is_gpio = 1 }
+
+/* Define no-pull / PU / PD configs for each functional config option */
+#define GPIO_FUNC(_func, _pudir, _str) \
+ { .use_sel = GPIO_USE_MMIO, \
+ .pad_conf0 = PAD_FUNC##_func | PAD_##_pudir | PAD_PU_##_str | \
+ PAD_CONFIG0_DEFAULT, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_DEFAULT }
+
+/* Default functional configs -- no PU */
+#define GPIO_FUNC0 GPIO_FUNC(0, PULL_DISABLE, 10K)
+#define GPIO_FUNC1 GPIO_FUNC(1, PULL_DISABLE, 10K)
+#define GPIO_FUNC2 GPIO_FUNC(2, PULL_DISABLE, 10K)
+#define GPIO_FUNC3 GPIO_FUNC(3, PULL_DISABLE, 10K)
+#define GPIO_FUNC4 GPIO_FUNC(4, PULL_DISABLE, 10K)
+#define GPIO_FUNC5 GPIO_FUNC(5, PULL_DISABLE, 10K)
+#define GPIO_FUNC6 GPIO_FUNC(6, PULL_DISABLE, 10K)
+
+/* ACPI GPIO routing. Assume everything is externally pulled and negative edge
+ * triggered. SCI implies WAKE, but WAKE doesn't imply SCI. */
+#define GPIO_ACPI_SCI \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT | PAD_FUNC0, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_INPUT, \
+ .tne = 1, \
+ .sci = 1, \
+ .wake_en = 1, }
+#define GPIO_ACPI_WAKE \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT | PAD_FUNC0, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_INPUT, \
+ .tne = 1, \
+ .wake_en = 1, }
+#define GPIO_ACPI_SMI \
+ { .pad_conf0 = PAD_PULL_DISABLE | PAD_CONFIG0_DEFAULT | PAD_FUNC0, \
+ .pad_conf1 = PAD_CONFIG1_DEFAULT, \
+ .pad_val = PAD_VAL_INPUT, \
+ .use_sel = GPIO_USE_LEGACY, \
+ .io_sel = GPIO_DIR_INPUT, \
+ .tne = 1, \
+ .smi = 1}
+
+/* End marker */
+#define GPIO_LIST_END 0xffffffff
+
+#define GPIO_END \
+ { .pad_conf0 = GPIO_LIST_END }
+
+/* Common default GPIO settings */
+#define GPIO_INPUT GPIO_INPUT_NOPU
+#define GPIO_INPUT_LEGACY GPIO_INPUT_LEGACY_NOPU
+#define GPIO_INPUT_PU GPIO_INPUT_PU_10K(0)
+#define GPIO_INPUT_PD GPIO_INPUT_PD_10K
+#define GPIO_NC GPIO_INPUT_PU_10K(0)
+#define GPIO_NC1 GPIO_INPUT_PU_10K(1)
+#define GPIO_DEFAULT GPIO_FUNC0
+
+/* 16 DirectIRQs per supported bank */
+#define GPIO_MAX_DIRQS 16
+
+/* Most pins are GPIO function 0. Some banks have a range of pins with GPIO
+ * function 1. Indicate first / last GPIOs with function 1. */
+#define GPIO_NONE 255
+/* All NCORE GPIOs are function 0 */
+#define GPNCORE_GPIO_F1_RANGE_START GPIO_NONE
+#define GPNCORE_GPIO_F1_RANGE_END GPIO_NONE
+/* SCORE GPIO [92:93] are function 1 */
+#define GPSCORE_GPIO_F1_RANGE_START 92
+#define GPSCORE_GPIO_F1_RANGE_END 93
+/* SSUS GPIO [11:21] are function 1 */
+#define GPSSUS_GPIO_F1_RANGE_START 11
+#define GPSSUS_GPIO_F1_RANGE_END 21
+
+struct __packed byt_gpio_map {
+ u32 pad_conf0;
+ u32 pad_conf1;
+ u32 pad_val;
+ u32 use_sel:1;
+ u32 io_sel:1;
+ u32 gp_lvl:1;
+ u32 tpe:1;
+ u32 tne:1;
+ u32 wake_en:1;
+ u32 smi:1;
+ u32 is_gpio:1;
+ u32 sci:1;
+};
+
+struct byt_gpio_config {
+ const struct byt_gpio_map *ncore;
+ const struct byt_gpio_map *score;
+ const struct byt_gpio_map *ssus;
+ const u8 (*core_dirq)[GPIO_MAX_DIRQS];
+ const u8 (*sus_dirq)[GPIO_MAX_DIRQS];
+};
+
+/* Description of GPIO 'bank' ex. {ncore, score. ssus} */
+struct gpio_bank {
+ const int gpio_count;
+ const u8 *gpio_to_pad;
+ const int legacy_base;
+ const unsigned long pad_base;
+ const u8 has_wake_en:1;
+ const u8 gpio_f1_range_start;
+ const u8 gpio_f1_range_end;
+};
+
+/* Function to call to setup the GPIOs */
+void setup_soc_gpios(struct byt_gpio_config *config);
+
+/* Functions / defines for changing GPIOs in romstage */
+/* SCORE Pad definitions. */
+#define UART_RXD_PAD 82
+#define UART_TXD_PAD 83
+#define PCU_SMB_CLK_PAD 88
+#define PCU_SMB_DATA_PAD 90
+
+static inline unsigned int score_pconf0(int pad_num)
+{
+ return GPSCORE_PAD_BASE + pad_num * 16;
+}
+
+static inline unsigned int ssus_pconf0(int pad_num)
+{
+ return GPSSUS_PAD_BASE + pad_num * 16;
+}
+
+static inline void score_select_func(int pad, int func)
+{
+ uint32_t reg;
+ uint32_t pconf0_addr = score_pconf0(pad);
+
+ reg = readl(pconf0_addr);
+ reg &= ~0x7;
+ reg |= func & 0x7;
+ writel(pconf0_addr, reg);
+}
+
+static inline void ssus_select_func(int pad, int func)
+{
+ uint32_t reg;
+ uint32_t pconf0_addr = ssus_pconf0(pad);
+
+ reg = readl(pconf0_addr);
+ reg &= ~0x7;
+ reg |= func & 0x7;
+ writel(pconf0_addr, reg);
+}
+
+/* These functions require that the input pad be configured as an input GPIO */
+static inline int score_get_gpio(int pad)
+{
+ uint32_t val_addr = score_pconf0(pad) + PAD_VAL_REG;
+
+ return readl(val_addr) & PAD_VAL_HIGH;
+}
+
+static inline int ssus_get_gpio(int pad)
+{
+ uint32_t val_addr = ssus_pconf0(pad) + PAD_VAL_REG;
+
+ return readl(val_addr) & PAD_VAL_HIGH;
+}
+
+static inline void ssus_disable_internal_pull(int pad)
+{
+ const uint32_t pull_mask = ~(0xf << 7);
+ writel(ssus_pconf0(pad), readl(ssus_pconf0(pad)) & pull_mask);
+}
+
#endif /* _X86_ARCH_GPIO_H_ */
diff --git a/arch/x86/include/asm/arch-baytrail/iomap.h b/arch/x86/include/asm/arch-baytrail/iomap.h
new file mode 100644
index 0000000..9624929
--- /dev/null
+++ b/arch/x86/include/asm/arch-baytrail/iomap.h
@@ -0,0 +1,73 @@
+/*
+ * From Coreboot file of same name
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef _BAYTRAIL_IOMAP_H_
+#define _BAYTRAIL_IOMAP_H_
+
+/*
+ * Memory Mapped IO bases.
+ */
+
+/* PCI Configuration Space */
+#define MCFG_BASE_ADDRESS CONFIG_MMCONF_BASE_ADDRESS
+#define MCFG_BASE_SIZE 0x10000000
+
+/* Transactions in this range will abort */
+#define ABORT_BASE_ADDRESS 0xfeb00000
+#define ABORT_BASE_SIZE 0x00100000
+
+/* Power Management Controller */
+#define PMC_BASE_ADDRESS 0xfed03000
+#define PMC_BASE_SIZE 0x400
+
+/* IO Memory */
+#define IO_BASE_ADDRESS 0xfed0c000
+#define IO_BASE_OFFSET_GPSCORE 0x0000
+#define IO_BASE_OFFSET_GPNCORE 0x1000
+#define IO_BASE_OFFSET_GPSSUS 0x2000
+#define IO_BASE_SIZE 0x4000
+
+/* Intel Legacy Block */
+#define ILB_BASE_ADDRESS 0xfed08000
+#define ILB_BASE_SIZE 0x400
+
+/* SPI Bus */
+#define SPI_BASE_ADDRESS 0xfed01000
+#define SPI_BASE_SIZE 0x400
+
+/* MODPHY */
+#define MPHY_BASE_ADDRESS 0xfef00000
+#define MPHY_BASE_SIZE 0x100000
+
+/* Power Management Unit */
+#define PUNIT_BASE_ADDRESS 0xfed05000
+#define PUNIT_BASE_SIZE 0x800
+
+/* Root Complex Base Address */
+#define RCBA_BASE_ADDRESS 0xfed1c000
+#define RCBA_BASE_SIZE 0x400
+
+/* High Performance Event Timer */
+#define HPET_BASE_ADDRESS 0xfed00000
+#define HPET_BASE_SIZE 0x400
+
+/* Temporary Base Address */
+#define TEMP_BASE_ADDRESS 0xfd000000
+
+/*
+ * IO Port bases.
+ */
+#define ACPI_BASE_ADDRESS 0x0400
+#define ACPI_BASE_SIZE 0x80
+
+#define GPIO_BASE_ADDRESS 0x0500
+#define GPIO_BASE_SIZE 0x100
+
+#define SMBUS_BASE_ADDRESS 0xefa0
+
+#endif
diff --git a/arch/x86/include/asm/arch-baytrail/irq.h b/arch/x86/include/asm/arch-baytrail/irq.h
new file mode 100644
index 0000000..d4d3612
--- /dev/null
+++ b/arch/x86/include/asm/arch-baytrail/irq.h
@@ -0,0 +1,119 @@
+/*
+ * From Coreboot file of same name
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef _BAYTRAIL_IRQ_H_
+#define _BAYTRAIL_IRQ_H_
+
+#define PIRQA_APIC_IRQ 16
+#define PIRQB_APIC_IRQ 17
+#define PIRQC_APIC_IRQ 18
+#define PIRQD_APIC_IRQ 19
+#define PIRQE_APIC_IRQ 20
+#define PIRQF_APIC_IRQ 21
+#define PIRQG_APIC_IRQ 22
+#define PIRQH_APIC_IRQ 23
+/* The below IRQs are for when devices are in ACPI mode. Active low. */
+#define LPE_DMA0_IRQ 24
+#define LPE_DMA1_IRQ 25
+#define LPE_SSP0_IRQ 26
+#define LPE_SSP1_IRQ 27
+#define LPE_SSP2_IRQ 28
+#define LPE_IPC2HOST_IRQ 29
+#define LPSS_I2C1_IRQ 32
+#define LPSS_I2C2_IRQ 33
+#define LPSS_I2C3_IRQ 34
+#define LPSS_I2C4_IRQ 35
+#define LPSS_I2C5_IRQ 36
+#define LPSS_I2C6_IRQ 37
+#define LPSS_I2C7_IRQ 38
+#define LPSS_HSUART1_IRQ 39
+#define LPSS_HSUART2_IRQ 40
+#define LPSS_SPI_IRQ 41
+#define LPSS_DMA1_IRQ 42
+#define LPSS_DMA2_IRQ 43
+#define SCC_EMMC_IRQ 44
+#define SCC_SDIO_IRQ 46
+#define SCC_SD_IRQ 47
+#define GPIO_NC_IRQ 48
+#define GPIO_SC_IRQ 49
+#define GPIO_SUS_IRQ 50
+/* GPIO direct / dedicated IRQs. */
+#define GPIO_S0_DED_IRQ_0 51
+#define GPIO_S0_DED_IRQ_1 52
+#define GPIO_S0_DED_IRQ_2 53
+#define GPIO_S0_DED_IRQ_3 54
+#define GPIO_S0_DED_IRQ_4 55
+#define GPIO_S0_DED_IRQ_5 56
+#define GPIO_S0_DED_IRQ_6 57
+#define GPIO_S0_DED_IRQ_7 58
+#define GPIO_S0_DED_IRQ_8 59
+#define GPIO_S0_DED_IRQ_9 60
+#define GPIO_S0_DED_IRQ_10 61
+#define GPIO_S0_DED_IRQ_11 62
+#define GPIO_S0_DED_IRQ_12 63
+#define GPIO_S0_DED_IRQ_13 64
+#define GPIO_S0_DED_IRQ_14 65
+#define GPIO_S0_DED_IRQ_15 66
+#define GPIO_S5_DED_IRQ_0 67
+#define GPIO_S5_DED_IRQ_1 68
+#define GPIO_S5_DED_IRQ_2 69
+#define GPIO_S5_DED_IRQ_3 70
+#define GPIO_S5_DED_IRQ_4 71
+#define GPIO_S5_DED_IRQ_5 72
+#define GPIO_S5_DED_IRQ_6 73
+#define GPIO_S5_DED_IRQ_7 74
+#define GPIO_S5_DED_IRQ_8 75
+#define GPIO_S5_DED_IRQ_9 76
+#define GPIO_S5_DED_IRQ_10 77
+#define GPIO_S5_DED_IRQ_11 78
+#define GPIO_S5_DED_IRQ_12 79
+#define GPIO_S5_DED_IRQ_13 80
+#define GPIO_S5_DED_IRQ_14 81
+#define GPIO_S5_DED_IRQ_15 82
+/* DIRQs - Two levels of expansion to evaluate to numeric constants for ASL. */
+#define _GPIO_S0_DED_IRQ(slot) GPIO_S0_DED_IRQ_##slot
+#define _GPIO_S5_DED_IRQ(slot) GPIO_S5_DED_IRQ_##slot
+#define GPIO_S0_DED_IRQ(slot) _GPIO_S0_DED_IRQ(slot)
+#define GPIO_S5_DED_IRQ(slot) _GPIO_S5_DED_IRQ(slot)
+
+/* PIC IRQ settings. */
+#define PIRQ_PIC_IRQDISABLE 0x0
+#define PIRQ_PIC_IRQ3 0x3
+#define PIRQ_PIC_IRQ4 0x4
+#define PIRQ_PIC_IRQ5 0x5
+#define PIRQ_PIC_IRQ6 0x6
+#define PIRQ_PIC_IRQ7 0x7
+#define PIRQ_PIC_IRQ9 0x9
+#define PIRQ_PIC_IRQ10 0xa
+#define PIRQ_PIC_IRQ11 0xb
+#define PIRQ_PIC_IRQ12 0xc
+#define PIRQ_PIC_IRQ14 0xe
+#define PIRQ_PIC_IRQ15 0xf
+
+/* Overloaded term, but these values determine the per device route. */
+#define PIRQA 0
+#define PIRQB 1
+#define PIRQC 2
+#define PIRQD 3
+#define PIRQE 4
+#define PIRQF 5
+#define PIRQG 6
+#define PIRQH 7
+
+/* These registers live behind the ILB_BASE_ADDRESS */
+#define ACTL 0x00
+# define SCIS_MASK 0x07
+# define SCIS_IRQ9 0x00
+# define SCIS_IRQ10 0x01
+# define SCIS_IRQ11 0x02
+# define SCIS_IRQ20 0x04
+# define SCIS_IRQ21 0x05
+# define SCIS_IRQ22 0x06
+# define SCIS_IRQ23 0x07
+
+#endif /* _BAYTRAIL_IRQ_H_ */
diff --git a/arch/x86/include/asm/arch-baytrail/irqroute.h b/arch/x86/include/asm/arch-baytrail/irqroute.h
new file mode 100644
index 0000000..f129880
--- /dev/null
+++ b/arch/x86/include/asm/arch-baytrail/irqroute.h
@@ -0,0 +1,67 @@
+/*
+ * From Coreboot file of same name
+ *
+ * Copyright (C) 2014 Google, Inc
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC.
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef IRQROUTE_H
+#define IRQROUTE_H
+
+#include <asm/arch/irq.h>
+#include <asm/arch/pci_devs.h>
+
+/*
+ *IR02h GFX INT(A) - PIRQ A
+ *IR10h EMMC INT(ABCD) - PIRQ DEFG
+ *IR11h SDIO INT(A) - PIRQ B
+ *IR12h SD INT(A) - PIRQ C
+ *IR13h SATA INT(A) - PIRQ D
+ *IR14h XHCI INT(A) - PIRQ E
+ *IR15h LP Audio INT(A) - PIRQ F
+ *IR17h MMC INT(A) - PIRQ F
+ *IR18h SIO INT(ABCD) - PIRQ BADC
+ *IR1Ah TXE INT(A) - PIRQ F
+ *IR1Bh HD Audio INT(A) - PIRQ G
+ *IR1Ch PCIe INT(ABCD) - PIRQ EFGH
+ *IR1Dh EHCI INT(A) - PIRQ D
+ *IR1Eh SIO INT(ABCD) - PIRQ BDEF
+ *IR1Fh LPC INT(ABCD) - PIRQ HGBC
+ */
+#define PCI_DEV_PIRQ_ROUTES \
+ PCI_DEV_PIRQ_ROUTE(GFX_DEV, A, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(EMMC_DEV, D, E, F, G), \
+ PCI_DEV_PIRQ_ROUTE(SDIO_DEV, B, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(SD_DEV, C, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(SATA_DEV, D, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(XHCI_DEV, E, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(LPE_DEV, F, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(MMC45_DEV, F, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(SIO1_DEV, B, A, D, C), \
+ PCI_DEV_PIRQ_ROUTE(TXE_DEV, F, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(HDA_DEV, G, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(PCIE_DEV, E, F, G, H), \
+ PCI_DEV_PIRQ_ROUTE(EHCI_DEV, D, A, A, A), \
+ PCI_DEV_PIRQ_ROUTE(SIO2_DEV, B, D, E, F), \
+ PCI_DEV_PIRQ_ROUTE(PCU_DEV, H, G, B, C)
+
+/*
+ * Route each PIRQ[A-H] to a PIC IRQ[0-15]
+ * Reserved: 0, 1, 2, 8, 13
+ * PS2 keyboard: 12
+ * ACPI/SCI: 9
+ * Floppy: 6
+ */
+#define PIRQ_PIC_ROUTES \
+ PIRQ_PIC(A, 4), \
+ PIRQ_PIC(B, 5), \
+ PIRQ_PIC(C, 7), \
+ PIRQ_PIC(D, 10), \
+ PIRQ_PIC(E, 11), \
+ PIRQ_PIC(F, 12), \
+ PIRQ_PIC(G, 14), \
+ PIRQ_PIC(H, 15)
+
+#endif /* IRQROUTE_H */
diff --git a/arch/x86/include/asm/arch-baytrail/pci_devs.h b/arch/x86/include/asm/arch-baytrail/pci_devs.h
new file mode 100644
index 0000000..579a228
--- /dev/null
+++ b/arch/x86/include/asm/arch-baytrail/pci_devs.h
@@ -0,0 +1,144 @@
+/*
+ * From Coreboot file of same name
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef _BAYTRAIL_PCI_DEVS_H_
+#define _BAYTRAIL_PCI_DEVS_H_
+
+/* All these devices live on bus 0 with the associated device and function */
+
+/* SoC transaction router */
+#define SOC_DEV 0x0
+#define SOC_FUNC 0
+# define SOC_DEVID 0x0f00
+
+/* Graphics and Display */
+#define GFX_DEV 0x2
+#define GFX_FUNC 0
+# define GFX_DEVID 0x0f31
+
+/* SDIO Port */
+#define SDIO_DEV 0x11
+#define SDIO_FUNC 0
+# define SDIO_DEVID 0x0f15
+
+/* SD Port */
+#define SD_DEV 0x12
+#define SD_FUNC 0
+# define SD_DEVID 0x0f16
+
+/* SATA */
+#define SATA_DEV 0x13
+#define SATA_FUNC 0
+#define IDE1_DEVID 0x0f20
+#define IDE2_DEVID 0x0f21
+#define AHCI1_DEVID 0x0f22
+#define AHCI2_DEVID 0x0f23
+
+/* xHCI */
+#define XHCI_DEV 0x14
+#define XHCI_FUNC 0
+# define XHCI_DEVID 0x0f35
+
+/* LPE Audio */
+#define LPE_DEV 0x15
+#define LPE_FUNC 0
+# define LPE_DEVID 0x0f28
+
+/* MMC Port */
+#define MMC_DEV 0x17
+#define MMC_FUNC 0
+# define MMC_DEVID 0x0f50
+
+/* Serial IO 1 */
+#define SIO1_DEV 0x18
+# define SIO_DMA1_DEV SIO1_DEV
+# define SIO_DMA1_FUNC 0
+# define SIO_DMA1_DEVID 0x0f40
+# define I2C1_DEV SIO1_DEV
+# define I2C1_FUNC 1
+# define I2C1_DEVID 0x0f41
+# define I2C2_DEV SIO1_DEV
+# define I2C2_FUNC 2
+# define I2C2_DEVID 0x0f42
+# define I2C3_DEV SIO1_DEV
+# define I2C3_FUNC 3
+# define I2C3_DEVID 0x0f43
+# define I2C4_DEV SIO1_DEV
+# define I2C4_FUNC 4
+# define I2C4_DEVID 0x0f44
+# define I2C5_DEV SIO1_DEV
+# define I2C5_FUNC 5
+# define I2C5_DEVID 0x0f45
+# define I2C6_DEV SIO1_DEV
+# define I2C6_FUNC 6
+# define I2C6_DEVID 0x0f46
+# define I2C7_DEV SIO1_DEV
+# define I2C7_FUNC 7
+# define I2C7_DEVID 0x0f47
+
+/* Trusted Execution Engine */
+#define TXE_DEV 0x1a
+#define TXE_FUNC 0
+# define TXE_DEVID 0x0f18
+
+/* HD Audio */
+#define HDA_DEV 0x1b
+#define HDA_FUNC 0
+# define HDA_DEVID 0x0f04
+
+/* PCIe Ports */
+#define PCIE_DEV 0x1c
+# define PCIE_PORT1_DEV PCIE_DEV
+# define PCIE_PORT1_FUNC 0
+# define PCIE_PORT1_DEVID 0x0f48
+# define PCIE_PORT2_DEV PCIE_DEV
+# define PCIE_PORT2_FUNC 1
+# define PCIE_PORT2_DEVID 0x0f4a
+# define PCIE_PORT3_DEV PCIE_DEV
+# define PCIE_PORT3_FUNC 2
+# define PCIE_PORT3_DEVID 0x0f4c
+# define PCIE_PORT4_DEV PCIE_DEV
+# define PCIE_PORT4_FUNC 3
+# define PCIE_PORT4_DEVID 0x0f4e
+
+/* EHCI */
+#define EHCI_DEV 0x1d
+#define EHCI_FUNC 0
+# define EHCI_DEVID 0x0f34
+
+/* Serial IO 2 */
+#define SIO2_DEV 0x1e
+# define SIO_DMA2_DEV SIO2_DEV
+# define SIO_DMA2_FUNC 0
+# define SIO_DMA2_DEVID 0x0f06
+# define PWM1_DEV SIO2_DEV
+# define PWM1_FUNC 1
+# define PWM1_DEVID 0x0f08
+# define PWM2_DEV SIO2_DEV
+# define PWM2_FUNC 2
+# define PWM2_DEVID 0x0f09
+# define HSUART1_DEV SIO2_DEV
+# define HSUART1_FUNC 3
+# define HSUART1_DEVID 0x0f0a
+# define HSUART2_DEV SIO2_DEV
+# define HSUART2_FUNC 4
+# define HSUART2_DEVID 0x0f0c
+# define SPI_DEV SIO2_DEV
+# define SPI_FUNC 5
+# define SPI_DEVID 0xf0e
+
+/* Platform Controller Unit */
+#define PCU_DEV 0x1f
+# define LPC_DEV PCU_DEV
+# define LPC_FUNC 0
+# define LPC_DEVID 0x0f1c
+# define SMBUS_DEV PCU_DEV
+# define SMBUS_FUNC 3
+# define SMBUS_DEVID 0x0f12
+
+#endif /* _BAYTRAIL_PCI_DEVS_H_ */
diff --git a/arch/x86/include/asm/arch-baytrail/pmc.h b/arch/x86/include/asm/arch-baytrail/pmc.h
new file mode 100644
index 0000000..16d4ce7
--- /dev/null
+++ b/arch/x86/include/asm/arch-baytrail/pmc.h
@@ -0,0 +1,253 @@
+/*
+ * From Coreboot file of same name
+ *
+ * Copyright (C) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#ifndef _BAYTRAIL_PMC_H_
+#define _BAYTRAIL_PMC_H_
+
+
+#define IOCOM1 0x3f8
+
+/* Memory mapped IO registers behind PMC_BASE_ADDRESS */
+#define PRSTS 0x00
+# define PMC_WDT_STS (1 << 15)
+# define SEC_GBLRST_STS (1 << 7)
+# define SEC_WDT_STS (1 << 6)
+# define WOL_OVR_WK_STS (1 << 5)
+# define PMC_WAKE_STS (1 << 4)
+#define PMC_CFG 0x08
+# define SPS (1 << 5)
+# define NO_REBOOT (1 << 4)
+# define SX_ENT_TO_EN (1 << 3)
+# define TIMING_T581_SHIFT (0)
+# define TIMING_T581_MASK (3 << TIMING_T581_SHIFT)
+# define TIMING_T581_10US (0 << TIMING_T581_SHIFT)
+# define TIMING_T581_100US (1 << TIMING_T581_SHIFT)
+# define TIMING_T581_1MS (2 << TIMING_T581_SHIFT)
+# define TIMING_T581_10MS (3 << TIMING_T581_SHIFT)
+#define VLV_PM_STS 0x0c
+# define PMC_MSG_FULL_STS (1 << 24)
+# define PMC_MSG_4_FULL_STS (1 << 23)
+# define PMC_MSG_3_FULL_STS (1 << 22)
+# define PMC_MSG_2_FULL_STS (1 << 21)
+# define PMC_MSG_1_FULL_STS (1 << 20)
+# define CODE_REQ (1 << 8)
+# define HPR_ENT_TO (1 << 2)
+# define SX_ENT_TO (1 << 1)
+#define GEN_PMCON1 0x20
+# define UART_EN (1 << 24)
+# define DISB (1 << 23)
+# define MEM_SR (1 << 21)
+# define SRS (1 << 20)
+# define CTS (1 << 19)
+# define MS4V (1 << 18)
+# define PWR_FLR (1 << 16)
+# define PME_B0_S5_DIS (1 << 15)
+# define SUS_PWR_FLR (1 << 14)
+# define WOL_EN_OVRD (1 << 13)
+# define DIS_SLP_X_STRCH_SUS_UP (1 << 12)
+# define GEN_RST_STS (1 << 9)
+# define RPS (1 << 2)
+# define AFTERG3_EN (1 << 0)
+#define GEN_PMCON2 0x24
+# define SLPSX_STR_POL_LOCK (1 << 18)
+# define BIOS_PCI_EXP_EN (1 << 10)
+# define PWRBTN_LVL (1 << 9)
+# define SMI_LOCK (1 << 4)
+#define ETR 0x48
+# define CF9LOCK (1 << 31)
+# define LTR_DEF (1 << 22)
+# define IGNORE_HPET (1 << 21)
+# define CF9GR (1 << 20)
+# define CWORWRE (1 << 18)
+#define FUNC_DIS 0x34
+# define SIO_DMA2_DIS (1 << 0)
+# define PWM1_DIS (1 << 1)
+# define PWM2_DIS (1 << 2)
+# define HSUART1_DIS (1 << 3)
+# define HSUART2_DIS (1 << 4)
+# define SPI_DIS (1 << 5)
+# define SDIO_DIS (1 << 9)
+# define SD_DIS (1 << 10)
+# define MMC_DIS (1 << 11)
+# define HDA_DIS (1 << 12)
+# define LPE_DIS (1 << 13)
+# define OTG_DIS (1 << 14)
+# define XHCI_DIS (1 << 15)
+# define SATA_DIS (1 << 17)
+# define EHCI_DIS (1 << 18)
+# define TXE_DIS (1 << 19)
+# define PCIE_PORT1_DIS (1 << 20)
+# define PCIE_PORT2_DIS (1 << 21)
+# define PCIE_PORT3_DIS (1 << 22)
+# define PCIE_PORT4_DIS (1 << 23)
+# define SIO_DMA1_DIS (1 << 24)
+# define I2C1_DIS (1 << 25)
+# define I2C2_DIS (1 << 26)
+# define I2C3_DIS (1 << 27)
+# define I2C4_DIS (1 << 28)
+# define I2C5_DIS (1 << 29)
+# define I2C6_DIS (1 << 30)
+# define I2C7_DIS (1 << 31)
+#define FUNC_DIS2 0x38
+# define USH_SS_PHY_DIS (1 << 2)
+# define OTG_SS_PHY_DIS (1 << 1)
+# define SMBUS_DIS (1 << 0)
+#define GPIO_ROUT 0x58
+# define ROUTE_MASK 3
+# define ROUTE_NONE 0
+# define ROUTE_SMI 1
+# define ROUTE_SCI 2
+#define PLT_CLK_CTL_0 0x60
+#define PLT_CLK_CTL_1 0x64
+#define PLT_CLK_CTL_2 0x68
+#define PLT_CLK_CTL_3 0x6c
+#define PLT_CLK_CTL_4 0x70
+#define PLT_CLK_CTL_5 0x74
+# define CLK_FREQ_25MHZ (0x0 << 2)
+# define CLK_FREQ_19P2MHZ (0x1 << 2)
+# define CLK_CTL_D3_LPE (0x0 << 0)
+# define CLK_CTL_ON (0x1 << 0)
+# define CLK_CTL_OFF (0x2 << 0)
+#define PME_STS 0xc0
+#define GPE_LEVEL_EDGE 0xc4
+# define GPE_EDGE 0
+# define GPE_LEVEL 1
+#define GPE_POLARITY 0xc8
+# define GPE_ACTIVE_HIGH 1
+# define GPE_ACTIVE_LOW 0
+#define LOCK 0xcc
+
+/* IO Mapped registers behind ACPI_BASE_ADDRESS */
+#define PM1_STS 0x00
+#define WAK_STS (1 << 15)
+#define PCIEXPWAK_STS (1 << 14)
+#define USB_STS (1 << 13)
+#define PRBTNOR_STS (1 << 11)
+#define RTC_STS (1 << 10)
+#define PWRBTN_STS (1 << 8)
+#define GBL_STS (1 << 5)
+#define TMROF_STS (1 << 0)
+#define PM1_EN 0x02
+#define PCIEXPWAK_DIS (1 << 14)
+#define USB_WAKE_EN (1 << 13)
+#define RTC_EN (1 << 10)
+#define PWRBTN_EN (1 << 8)
+#define GBL_EN (1 << 5)
+#define TMROF_EN (1 << 0)
+#define PM1_CNT 0x04
+#define SLP_EN (1 << 13)
+#define SLP_TYP_SHIFT 10
+#define SLP_TYP (7 << SLP_TYP_SHIFT)
+#define SLP_TYP_S0 0
+#define SLP_TYP_S1 1
+#define SLP_TYP_S3 5
+#define SLP_TYP_S4 6
+#define SLP_TYP_S5 7
+#define GBL_RLS (1 << 2)
+#define BM_RLD (1 << 1)
+#define SCI_EN (1 << 0)
+#define PM1_TMR 0x08
+#define GPE0_STS 0x20
+#define CORE_GPIO_STS7 (1 << 31)
+#define CORE_GPIO_STS6 (1 << 30)
+#define CORE_GPIO_STS5 (1 << 29)
+#define CORE_GPIO_STS4 (1 << 28)
+#define CORE_GPIO_STS3 (1 << 27)
+#define CORE_GPIO_STS2 (1 << 26)
+#define CORE_GPIO_STS1 (1 << 25)
+#define CORE_GPIO_STS0 (1 << 24)
+#define SUS_GPIO_STS7 (1 << 23)
+#define SUS_GPIO_STS6 (1 << 22)
+#define SUS_GPIO_STS5 (1 << 21)
+#define SUS_GPIO_STS4 (1 << 20)
+#define SUS_GPIO_STS3 (1 << 19)
+#define SUS_GPIO_STS2 (1 << 18)
+#define SUS_GPIO_STS1 (1 << 17)
+#define SUS_GPIO_STS0 (1 << 16)
+#define PME_B0_STS (1 << 13)
+#define BATLOW_STS (1 << 10)
+#define PCI_EXP_STS (1 << 9)
+#define PCIE_WAKE3_STS (1 << 8)
+#define PCIE_WAKE2_STS (1 << 7)
+#define PCIE_WAKE1_STS (1 << 6)
+#define GUNIT_SCI_STS (1 << 5)
+#define PUNIT_SCI_STS (1 << 4)
+#define PCIE_WAKE0_STS (1 << 3)
+#define SWGPE_STS (1 << 2)
+#define HOT_PLUG_STS (1 << 1)
+#define GPE0_EN 0x28
+#define CORE_GPIO_EN7 (1 << 31)
+#define CORE_GPIO_EN6 (1 << 30)
+#define CORE_GPIO_EN5 (1 << 29)
+#define CORE_GPIO_EN4 (1 << 28)
+#define CORE_GPIO_EN3 (1 << 27)
+#define CORE_GPIO_EN2 (1 << 26)
+#define CORE_GPIO_EN1 (1 << 25)
+#define CORE_GPIO_EN0 (1 << 24)
+#define SUS_GPIO_EN7_BIT 23
+#define SUS_GPIO_EN7 (1 << SUS_GPIO_EN7_BIT)
+#define SUS_GPIO_EN6_BIT 22
+#define SUS_GPIO_EN6 (1 << SUS_GPIO_EN6_BIT)
+#define SUS_GPIO_EN5_BIT 21
+#define SUS_GPIO_EN5 (1 << SUS_GPIO_EN5_BIT)
+#define SUS_GPIO_EN4_BIT 20
+#define SUS_GPIO_EN4 (1 << SUS_GPIO_EN4_BIT)
+#define SUS_GPIO_EN3_BIT 19
+#define SUS_GPIO_EN3 (1 << SUS_GPIO_EN3_BIT)
+#define SUS_GPIO_EN2_BIT 18
+#define SUS_GPIO_EN2 (1 << SUS_GPIO_EN2_BIT)
+#define SUS_GPIO_EN1_BIT 17
+#define SUS_GPIO_EN1 (1 << SUS_GPIO_EN1_BIT)
+#define SUS_GPIO_EN0_BIT 16
+#define SUS_GPIO_EN0 (1 << SUS_GPIO_EN0_BIT)
+#define PME_B0_EN (1 << 13)
+#define BATLOW_EN (1 << 10)
+#define PCI_EXP_EN (1 << 9)
+#define PCIE_WAKE3_EN (1 << 8)
+#define PCIE_WAKE2_EN (1 << 7)
+#define PCIE_WAKE1_EN (1 << 6)
+#define PCIE_WAKE0_EN (1 << 3)
+#define SWGPE_EN (1 << 2)
+#define HOT_PLUG_EN (1 << 1)
+#define _ACPI_ENABLE_WAKE_SUS_GPIO(x) SUS_GPIO_EN##x##_BIT
+#define ACPI_ENABLE_WAKE_SUS_GPIO(x) _ACPI_ENABLE_WAKE_SUS_GPIO(x)
+#define SMI_EN 0x30
+#define INTEL_USB2_EN (1 << 18) /* Intel-Specific USB2 SMI logic */
+#define USB_EN (1 << 17) /* Legacy USB2 SMI logic */
+#define PERIODIC_EN (1 << 14) /* SMI on PERIODIC_STS in SMI_STS */
+#define TCO_EN (1 << 13) /* Enable TCO Logic (BIOSWE et al) */
+#define BIOS_RLS (1 << 7) /* asserts SCI on bit set */
+#define SWSMI_TMR_EN (1 << 6) /* start software smi timer on bit set */
+#define APMC_EN (1 << 5) /* Writes to APM_CNT cause SMI# */
+#define SLP_SMI_EN (1 << 4) /* Write to SLP_EN in PM1_CNT asserts SMI# */
+#define BIOS_EN (1 << 2) /* Assert SMI# on setting GBL_RLS bit */
+#define EOS (1 << 1) /* End of SMI (deassert SMI#) */
+#define GBL_SMI_EN (1 << 0) /* SMI# generation at all? */
+#define SMI_STS 0x34
+#define ALT_GPIO_SMI 0x38
+#define UPRWC 0x3c
+# define UPRWC_WR_EN (1 << 1) /* USB Per-Port Registers Write Enable */
+#define GPE_CTRL 0x40
+#define PM2A_CNT_BLK 0x50
+#define TCO_RLD 0x60
+#define TCO_STS 0x64
+# define SECOND_TO_STS (1 << 17)
+# define TCO_TIMEOUT (1 << 3)
+#define TCO1_CNT 0x68
+# define TCO_LOCK (1 << 12)
+# define TCO_TMR_HALT (1 << 11)
+#define TCO_TMR 0x70
+
+/* I/O ports */
+#define RST_CNT 0xcf9
+# define FULL_RST (1 << 3)
+# define RST_CPU (1 << 2)
+# define SYS_RST (1 << 1)
+
+#endif /* _BAYTRAIL_PMC_H_ */
+
diff --git a/board/intel/minnowmax/minnowmax.c b/board/intel/minnowmax/minnowmax.c
index 6e82b16..c7b53f5 100644
--- a/board/intel/minnowmax/minnowmax.c
+++ b/board/intel/minnowmax/minnowmax.c
@@ -9,15 +9,227 @@
#include <asm/pnp_def.h>
#include <netdev.h>
#include <smsc_lpc47m.h>
+#include <asm/arch/gpio.h>
#define SERIAL_DEV PNP_DEV(0x2e, 4)
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * For multiplexed functions, look in EDS:
+ * 10.3 Ball Name and Function by Location
+ *
+ * The pads list is in the BWG_VOL2 Rev1p2:
+ * Note that Pad # is not the same as GPIO#
+ * 37 GPIO Handling:
+ * Table 37-1. SCORE Pads List
+ * Table 37-2. SSUSORE Pads List
+ */
+
+/* NCORE GPIOs */
+static const struct byt_gpio_map gpncore_gpio_map[] = {
+ GPIO_FUNC2, /* GPIO_S0_NC[00] - HDMI_HPD */
+ GPIO_FUNC2, /* GPIO_S0_NC[01] - HDMI_DDCDAT */
+ GPIO_FUNC2, /* GPIO_S0_NC[02] - HDMI_DDCCLK */
+ GPIO_NC, /* GPIO_S0_NC[03] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[04] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[05] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[06] - No Connect */
+ GPIO_FUNC2, /* GPIO_S0_NC[07] - DDI1_DDCDAT */
+ GPIO_NC, /* GPIO_S0_NC[08] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[09] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[10] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[11] - No Connect */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S0_NC[12] - TP15 */
+ GPIO_NC, /* GPIO_S0_NC[13] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[14] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[15] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[16] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[17] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[18] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[19] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[20] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[21] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[22] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[23] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[24] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[25] - No Connect */
+ GPIO_NC, /* GPIO_S0_NC[26] - No Connect */
+ GPIO_END
+};
+
+/* SCORE GPIOs (GPIO_S0_SC_XX)*/
+static const struct byt_gpio_map gpscore_gpio_map[] = {
+ GPIO_FUNC1, /* GPIO_S0_SC[000] - SATA_GP0 */
+ GPIO_FUNC1, /* GPIO_S0_SC[001] - SATA_GP1 */
+ GPIO_FUNC1, /* GPIO_S0_SC[002] - SATA_LED_B */
+ GPIO_FUNC1, /* GPIO_S0_SC[003] - PCIE_CLKREQ_0 */
+ GPIO_FUNC1, /* GPIO_S0_SC[004] - PCIE_CLKREQ_1 */
+ GPIO_FUNC1, /* GPIO_S0_SC[005] - PCIE_CLKREQ_2 */
+ GPIO_FUNC1, /* GPIO_S0_SC[006] - PCIE_CLKREQ_3 */
+ GPIO_FUNC2, /* GPIO_S0_SC[007] - SD3_WP */
+ GPIO_NC, /* GPIO_S0_SC[008] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[009] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[010] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[011] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[012] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[013] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[014] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[015] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[016] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[017] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[018] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[019] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[020] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[021] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[022] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[023] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[024] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[025] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[026] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[027] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[028] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[029] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[030] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[031] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[032] - No Connect */
+ GPIO_FUNC1, /* GPIO_S0_SC[033] - SD3_CLK */
+ GPIO_FUNC1, /* GPIO_S0_SC[034] - SD3_D0 */
+ GPIO_FUNC1, /* GPIO_S0_SC[035] - SD3_D1 */
+ GPIO_FUNC1, /* GPIO_S0_SC[036] - SD3_D2 */
+ GPIO_FUNC1, /* GPIO_S0_SC[037] - SD3_D3 */
+ GPIO_FUNC1, /* GPIO_S0_SC[038] - SD3_CD# */
+ GPIO_FUNC1, /* GPIO_S0_SC[039] - SD3_CMD */
+ GPIO_FUNC1, /* GPIO_S0_SC[040] - TP12 (SD3_1P8EN) */
+ GPIO_FUNC1, /* GPIO_S0_SC[041] - TP11 (/SD3_PWREN) */
+ GPIO_NC, /* GPIO_S0_SC[042] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[043] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[044] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[045] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[046] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[047] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[048] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[049] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[050] - No Connect */
+ GPIO_FUNC1, /* GPIO_S0_SC[051] - PCU_SMB_DATA */
+ GPIO_FUNC1, /* GPIO_S0_SC[052] - PCU_SMB_CLK */
+ GPIO_FUNC1, /* GPIO_S0_SC[053] - PCU_SMB_ALERT */
+ GPIO_FUNC1, /* GPIO_S0_SC[054] - ILB_8254_SPKR */
+ /* GPIO_S0_SC[055] - TP8 (GPIO_S0_SC_55) */
+ GPIO_FUNC(0, PULL_UP, 20K),
+ GPIO_FUNC0, /* GPIO_S0_SC[056] - GPIO_S0_SC_56 */
+ GPIO_FUNC1, /* GPIO_S0_SC[057] - PCU_UART3_TXD */
+ /* GPIO_S0_SC[058] - TP9 (GPIO_S0_SC_58) */
+ GPIO_FUNC(0, PULL_UP, 20K),
+ GPIO_FUNC0, /* GPIO_S0_SC[059] - HDMI_DCDC_ENB */
+ GPIO_FUNC0, /* GPIO_S0_SC[060] - HDMI_LDSW_ENB */
+ GPIO_FUNC1, /* GPIO_S0_SC[061] - PCU_UART3_RXD */
+ GPIO_FUNC1, /* GPIO_S0_SC[062] - LPE_I2S_CLK */
+ GPIO_FUNC1, /* GPIO_S0_SC[063] - LPE_I2S_FRM */
+ GPIO_FUNC1, /* GPIO_S0_SC[064] - LPE_I2S_DATIN */
+ GPIO_FUNC1, /* GPIO_S0_SC[065] - LPE_I2S_DATOUT */
+ GPIO_FUNC1, /* GPIO_S0_SC[066] - SOC_SIO_SPI_CS1 */
+ GPIO_FUNC1, /* GPIO_S0_SC[067] - SOC_SIO_SPI_MISO */
+ GPIO_FUNC1, /* GPIO_S0_SC[068] - SOC_SIO_SPI_MOSI */
+ GPIO_FUNC1, /* GPIO_S0_SC[069] - SOC_SIO_SPI_CLK */
+ GPIO_FUNC1, /* GPIO_S0_SC[070] - SIO_UART1_RXD */
+ GPIO_FUNC1, /* GPIO_S0_SC[071] - SIO_UART1_TXD */
+ GPIO_FUNC1, /* GPIO_S0_SC[072] - SIO_UART1_RTSB */
+ GPIO_FUNC1, /* GPIO_S0_SC[073] - SIO_UART1_CTSB */
+ GPIO_FUNC1, /* GPIO_S0_SC[074] - SIO_UART2_RXD */
+ GPIO_FUNC1, /* GPIO_S0_SC[075] - SIO_UART2_TXD */
+ GPIO_NC, /* GPIO_S0_SC[076] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[077] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[078] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[079] - No Connect */
+ GPIO_FUNC1, /* GPIO_S0_SC[080] - TP6 (SIO_I2C1_SDA) */
+ GPIO_FUNC1, /* GPIO_S0_SC[081] - TP5 (SIO_I2C1_SCL) */
+ GPIO_NC, /* GPIO_S0_SC[082] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[083] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[084] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[085] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[086] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[087] - No Connect */
+ GPIO_FUNC1, /* GPIO_S0_SC[088] - LSS_I2C_SDA */
+ GPIO_FUNC1, /* GPIO_S0_SC[089] - LSS_I2C_SCL */
+ GPIO_FUNC1, /* GPIO_S0_SC[090] - EXP_I2C_SDA */
+ GPIO_FUNC1, /* GPIO_S0_SC[091] - EXP_I2C_SCL */
+ GPIO_FUNC(1, PULL_UP, 20K), /* GPIO_S0_SC[092] - TP13 */
+ GPIO_FUNC(1, PULL_UP, 20K), /* GPIO_S0_SC[093] - TP16 */
+ GPIO_FUNC1, /* GPIO_S0_SC[094] - SOC_PWM0 */
+ GPIO_FUNC1, /* GPIO_S0_SC[095] - SOC_PWM1 */
+ GPIO_NC, /* GPIO_S0_SC[096] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[097] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[098] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[099] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[100] - No Connect */
+ GPIO_NC, /* GPIO_S0_SC[101] - No Connect */
+ GPIO_END
+};
+
+/* SSUS GPIOs (GPIO_S5) */
+static const struct byt_gpio_map gpssus_gpio_map[] = {
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[00] - SOC_GPIO_S5_0 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[01] - SOC_GPIO_S5_1 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[02] - SOC_GPIO_S5_2 */
+ GPIO_FUNC6, /* GPIO_S5[03] - mPCIE_WAKEB */
+ GPIO_NC, /* GPIO_S5[04] - No Connect */
+ GPIO_INPUT, /* GPIO_S5[05] - BOM_OP1 */
+ GPIO_INPUT, /* GPIO_S5[06] - BOM_OP2 */
+ GPIO_INPUT, /* GPIO_S5[07] - BOM_OP3 */
+ GPIO_OUT_HIGH, /* GPIO_S5[08] - SOC_USB_HOST_EN0 */
+ GPIO_OUT_HIGH, /* GPIO_S5[09] - SOC_USB_HOST_EN1 */
+ GPIO_OUT_HIGH, /* GPIO_S5[10] - GPIO_S5_10_UNLOCK */
+ GPIO_FUNC0, /* GPIO_S5[11] - SUSPWRDNACK (TP14) */
+ GPIO_FUNC0, /* GPIO_S5[12] - PMC_SUSCLK0 */
+ GPIO_FUNC1, /* GPIO_S5[13] - PMC_SLP_S0IX (TP10) */
+ GPIO_FUNC1, /* GPIO_S5[14] - GPIO_S514_J20 */
+ GPIO_FUNC0, /* GPIO_S5[15] - PMC_PCIE_WAKE_R */
+ GPIO_FUNC0, /* GPIO_S5[16] - PMC_PWRBTN */
+ GPIO_NC1, /* GPIO_S5[17] - No Connect */
+ GPIO_FUNC1, /* GPIO_S5[18] - LPCPD_L (TP7) */
+ GPIO_FUNC0, /* GPIO_S5[19] - SOC_USB_HOST_OC0 */
+ GPIO_FUNC0, /* GPIO_S5[20] - SOC_USB_HOST_OC1 */
+ GPIO_FUNC0, /* GPIO_S5[21] - SOC_SPI_CS1B */
+ GPIO_NC, /* GPIO_S5[22] - No Connect */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[23] - XDP_H_OBSDATA_A0 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[24] - XDP_H_OBSDATA_A1 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[25] - XDP_H_OBSDATA_A2 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[26] - XDP_H_OBSDATA_A3 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[27] - EXP_GPIO1 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[28] - EXP_GPIO2 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[29] - EXP_GPIO3 */
+ GPIO_FUNC(0, PULL_UP, 20K), /* GPIO_S5[30] - EXP_GPIO4 */
+ GPIO_NC, /* GPIO_S5[31] - No Connect */
+ GPIO_NC, /* GPIO_S5[32] - No Connect */
+ GPIO_NC, /* GPIO_S5[33] - No Connect */
+ GPIO_NC, /* GPIO_S5[34] - No Connect */
+ GPIO_NC, /* GPIO_S5[35] - No Connect */
+ GPIO_NC, /* GPIO_S5[36] - No Connect */
+ GPIO_NC, /* GPIO_S5[37] - No Connect */
+ GPIO_NC, /* GPIO_S5[38] - No Connect */
+ GPIO_NC, /* GPIO_S5[39] - No Connect */
+ GPIO_NC, /* GPIO_S5[40] - No Connect */
+ GPIO_NC, /* GPIO_S5[41] - No Connect */
+ GPIO_NC, /* GPIO_S5[42] - No Connect */
+ GPIO_NC, /* GPIO_S5[43] - No Connect */
+ GPIO_END
+};
+
+static struct byt_gpio_config gpio_config = {
+ .ncore = gpncore_gpio_map,
+ .score = gpscore_gpio_map,
+ .ssus = gpssus_gpio_map,
+ .core_dirq = NULL,
+ .sus_dirq = NULL,
+};
+
int board_early_init_f(void)
{
lpc47m_enable_serial(SERIAL_DEV, UART0_BASE);
+ setup_soc_gpios(&gpio_config);
+
return 0;
}
diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h
index 823e051..738c6fa 100644
--- a/include/configs/minnowmax.h
+++ b/include/configs/minnowmax.h
@@ -69,4 +69,15 @@
/* Avoid a warning in the Realtek Ethernet driver */
#define CONFIG_SYS_CACHELINE_SIZE 16
+/*
+ * Baytrail has 3 GPIOs bank over PCI, there is no
+ * driver at the moment so let's disable the command
+ * and the default x86 driver to avoid any collision
+ * with the GPIO mapping code.
+ * @TODO: adding a baytrail-gpio driver and configure
+ * the muxing through the device tree
+ */
+#undef CONFIG_INTEL_ICH6_GPIO
+#undef CONFIG_CMD_GPIO
+
#endif /* __CONFIG_H */
--
2.1.4
5
20

07 Apr '15
On Thursday, December 18, 2014 at 09:32:56 AM, Ramneek Mehresh wrote:
> Hi Marex,
>
> Following u-boot patch is pending for your review for some time. Please let
> me know if you have any concerns. fsl/usb: Add USB XHCI support:
> http://patchwork.ozlabs.org/patch/373593/
I missed the patch completely, sorry. Next time, please keep me on CC when
submitting the patches, that helps a lot.
As for the board_usb_init, you can drop the inline and the __board_usb_init()
and do:
__weak int board_usb_init(int index, enum usb_init_type init)
{
return 0;
}
The static void fsl_xhci_core_exit(struct fsl_xhci *fsl_xhci) must shut down
the controller, which I don't see happening. Why?
Thanks!
Best regards,
Marek Vasut
3
13

06 Apr '15
Commit 2e82e9252695a612ab0cbf40fa0c7368515f6506 'Exynos: Clock: Cleanup
soc_get_periph_rate' introduced a bug in I2C config. This patch makes cros_ec
keyboard working again on Samsung Chromebook (snow).
Signed-off-by: Guillaume GARDET <guillaume.gardet(a)free.fr>
Cc: Akshay Saraswat <akshay.s(a)samsung.com>
Cc: Minkyu Kang <mk7.kang(a)samsung.com>
Cc: Joonyoung Shim <jy0922.shim(a)samsung.com>
---
arch/arm/cpu/armv7/exynos/clock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c
index c6455c2..7f47d4d 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -423,8 +423,8 @@ static unsigned long exynos5_get_periph_rate(int peripheral)
case PERIPH_ID_I2C6:
case PERIPH_ID_I2C7:
src = EXYNOS_SRC_MPLL;
- div = readl(&clk->div_top0);
- sub_div = readl(&clk->div_top1);
+ sub_div = readl(&clk->div_top0);
+ div = readl(&clk->div_top1);
break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
--
1.8.4.5
6
10

[U-Boot] [PATCH] ARM: move -march=* and -mtune= options to arch/arm/Makefile
by Masahiro Yamada 02 Apr '15
by Masahiro Yamada 02 Apr '15
02 Apr '15
My main motivation for this commit:
[1] Follow the arch/arm/Makefile style of Linux Kernel
[2] Maintain compiler options systematically
Currently, we give -march=* and -mtune=* options inconsistently:
Only some of the CPUs pass -march=* and -mtune=* options.
By collecting flags into the arch/arm/Makefile, we can tell which
options are missing at a glance.
[3] Prepare for deprecating arch/*/cpu/*/config.mk
Note:
This commit just moves the compiler options so as not to change
the behavior at all. It does not care the correctness of the
given options. Fox example, "-march=armv5te" might be better than
"-march=armv4" for ARM946EJS, but it is beyond the scope this
commit. Also, filling the missing -march=* and -tune=* is left
to follow-up patches.
Signed-off-by: Masahiro Yamada <yamada.m(a)jp.panasonic.com>
---
arch/arm/Makefile | 32 ++++++++++++++++++++++++++++++++
arch/arm/cpu/arm1136/config.mk | 9 ---------
arch/arm/cpu/arm1176/config.mk | 9 ---------
arch/arm/cpu/arm720t/config.mk | 9 ---------
arch/arm/cpu/arm920t/config.mk | 8 --------
arch/arm/cpu/arm926ejs/config.mk | 8 --------
arch/arm/cpu/arm946es/config.mk | 8 --------
arch/arm/cpu/armv7/config.mk | 5 -----
arch/arm/cpu/armv8/config.mk | 2 --
arch/arm/cpu/pxa/config.mk | 2 --
arch/arm/cpu/sa1100/config.mk | 9 ---------
11 files changed, 32 insertions(+), 69 deletions(-)
delete mode 100644 arch/arm/cpu/arm1136/config.mk
delete mode 100644 arch/arm/cpu/arm1176/config.mk
delete mode 100644 arch/arm/cpu/arm720t/config.mk
delete mode 100644 arch/arm/cpu/arm920t/config.mk
delete mode 100644 arch/arm/cpu/arm926ejs/config.mk
delete mode 100644 arch/arm/cpu/arm946es/config.mk
delete mode 100644 arch/arm/cpu/sa1100/config.mk
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ebb7dc3..b63544f 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -2,6 +2,38 @@
# SPDX-License-Identifier: GPL-2.0+
#
+# This selects which instruction set is used.
+arch-$(CONFIG_CPU_ARM720T) =-march=armv4
+arch-$(CONFIG_CPU_ARM920T) =-march=armv4
+arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te
+arch-$(CONFIG_CPU_ARM946ES) =-march=armv4
+arch-$(CONFIG_CPU_SA1100) =-march=armv4
+arch-$(CONFIG_CPU_PXA) =
+arch-$(CONFIG_CPU_ARM1136) =-march=armv5
+arch-$(CONFIG_CPU_ARM1176) =-march=armv5t
+arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, -march=armv5)
+arch-$(CONFIG_ARM64) =-march=armv8-a
+
+# Evaluate arch cc-option calls now
+arch-y := $(arch-y)
+
+# This selects how we optimise for the processor.
+tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
+tune-$(CONFIG_CPU_ARM920T) =
+tune-$(CONFIG_CPU_ARM926EJS) =
+tune-$(CONFIG_CPU_ARM946ES) =
+tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
+tune-$(CONFIG_CPU_PXA) =-mcpu=xscale
+tune-$(CONFIG_CPU_ARM1136) =
+tune-$(CONFIG_CPU_ARM1176) =
+tune-$(CONFIG_CPU_V7) =
+tune-$(CONFIG_ARM64) =
+
+# Evaluate tune cc-option calls now
+tune-y := $(tune-y)
+
+PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
+
head-y := arch/arm/cpu/$(CPU)/start.o
ifeq ($(CONFIG_SPL_BUILD),y)
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
deleted file mode 100644
index a82c6ce..0000000
--- a/arch/arm/cpu/arm1136/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-# Make ARMv5 to allow more compilers to work, even though its v6.
-PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk
deleted file mode 100644
index 5dc2ebb..0000000
--- a/arch/arm/cpu/arm1176/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-# Make ARMv5 to allow more compilers to work, even though its v6.
-PLATFORM_CPPFLAGS += -march=armv5t
diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
deleted file mode 100644
index 772fb41..0000000
--- a/arch/arm/cpu/arm720t/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
-# Marius Groeger <mgroeger(a)sysgo.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
deleted file mode 100644
index 799afff..0000000
--- a/arch/arm/cpu/arm920t/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
deleted file mode 100644
index bdb3da1..0000000
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv5te
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
deleted file mode 100644
index 438668d..0000000
--- a/arch/arm/cpu/arm946es/config.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, <garyj(a)denx.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index 6c82c3b..63591d4 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -5,11 +5,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-# If armv7-a is not supported by GCC fall-back to armv5, which is
-# supported by more tool-chains
-PF_CPPFLAGS_ARMV7 := $(call cc-option, -march=armv7-a, -march=armv5)
-PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
-
# On supported platforms we set the bit which causes us to trap on unaligned
# memory access. This is the opposite of what the compiler expects to be
# the default so we must pass in -mno-unaligned-access so that it is aware
diff --git a/arch/arm/cpu/armv8/config.mk b/arch/arm/cpu/armv8/config.mk
index f5b9559..6850258 100644
--- a/arch/arm/cpu/armv8/config.mk
+++ b/arch/arm/cpu/armv8/config.mk
@@ -6,7 +6,5 @@
#
PLATFORM_RELFLAGS += -fno-common -ffixed-x18
-PF_CPPFLAGS_ARMV8 := $(call cc-option, -march=armv8-a)
PF_NO_UNALIGNED := $(call cc-option, -mstrict-align)
-PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV8)
PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk
index 525f5d3..7fb5316 100644
--- a/arch/arm/cpu/pxa/config.mk
+++ b/arch/arm/cpu/pxa/config.mk
@@ -6,8 +6,6 @@
# SPDX-License-Identifier: GPL-2.0+
#
-PLATFORM_CPPFLAGS += -mcpu=xscale
-
#
# !WARNING!
# The PXA's OneNAND SPL uses .text.0 and .text.1 segments to allow booting from
diff --git a/arch/arm/cpu/sa1100/config.mk b/arch/arm/cpu/sa1100/config.mk
deleted file mode 100644
index 3afa685..0000000
--- a/arch/arm/cpu/sa1100/config.mk
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# (C) Copyright 2002
-# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
-# Marius Groeger <mgroeger(a)sysgo.de>
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100
--
1.9.1
6
6

[U-Boot] [RFC PATCH] ARM: Merge v7 and v8 outer cache operations
by fenghuaï¼ phytium.com.cn 02 Apr '15
by fenghuaï¼ phytium.com.cn 02 Apr '15
02 Apr '15
From: David Feng <fenghua(a)phytium.com.cn>
Armv7 and Armv8 allow outer cache exist, it is outside of the architecture
defined cache hierarchy and can not be manipulated by architecture defined
instructions. It's processor specific.
This patch merge v7_outer_cache_* and v8 l3_cache_*.
Signed-off-by: David Feng <fenghua(a)phytium.com.cn>
---
arch/arm/cpu/armv7/cache_v7.c | 22 +++++++++++-----------
arch/arm/cpu/armv7/cpu.c | 2 +-
arch/arm/cpu/armv7/exynos/soc.c | 2 +-
arch/arm/cpu/armv7/mx6/soc.c | 4 ++--
arch/arm/cpu/armv7/omap3/board.c | 2 +-
arch/arm/cpu/armv7/omap4/hwinit.c | 4 ++--
arch/arm/cpu/armv7/s5pc1xx/cache.c | 4 ++--
arch/arm/cpu/armv7/uniphier/cache_uniphier.c | 14 +++++++-------
arch/arm/cpu/armv8/cache_v8.c | 21 ++++++++++++++++-----
arch/arm/cpu/armv8/fsl-lsch3/cpu.c | 2 +-
arch/arm/include/asm/armv7.h | 7 -------
arch/arm/include/asm/cache.h | 7 +++++++
arch/arm/include/asm/system.h | 2 --
arch/arm/lib/cache-pl310.c | 12 ++++++------
14 files changed, 57 insertions(+), 48 deletions(-)
diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 0f9d837..7d4d5d3 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -237,7 +237,7 @@ void invalidate_dcache_all(void)
{
v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
- v7_outer_cache_inval_all();
+ outer_cache_inval_all();
}
/*
@@ -248,7 +248,7 @@ void flush_dcache_all(void)
{
v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL);
- v7_outer_cache_flush_all();
+ outer_cache_flush_all();
}
/*
@@ -259,7 +259,7 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop)
{
v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
- v7_outer_cache_inval_range(start, stop);
+ outer_cache_inval_range(start, stop);
}
/*
@@ -271,12 +271,12 @@ void flush_dcache_range(unsigned long start, unsigned long stop)
{
v7_dcache_maint_range(start, stop, ARMV7_DCACHE_CLEAN_INVAL_RANGE);
- v7_outer_cache_flush_range(start, stop);
+ outer_cache_flush_range(start, stop);
}
void arm_init_before_mmu(void)
{
- v7_outer_cache_enable();
+ outer_cache_enable();
invalidate_dcache_all();
v7_inval_tlb();
}
@@ -355,9 +355,9 @@ void invalidate_icache_all(void)
#endif
/* Stub implementations for outer cache operations */
-__weak void v7_outer_cache_enable(void) {}
-__weak void v7_outer_cache_disable(void) {}
-__weak void v7_outer_cache_flush_all(void) {}
-__weak void v7_outer_cache_inval_all(void) {}
-__weak void v7_outer_cache_flush_range(u32 start, u32 end) {}
-__weak void v7_outer_cache_inval_range(u32 start, u32 end) {}
+__weak void outer_cache_enable(void) {}
+__weak void outer_cache_disable(void) {}
+__weak void outer_cache_flush_all(void) {}
+__weak void outer_cache_inval_all(void) {}
+__weak void outer_cache_flush_range(unsigned long start, unsigned long end) {}
+__weak void outer_cache_inval_range(unsigned long start, unsigned long end) {}
diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 01cdb7e..07ad549 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -47,7 +47,7 @@ int cleanup_before_linux(void)
* dcache_disable() in turn flushes the d-cache and disables MMU
*/
dcache_disable();
- v7_outer_cache_disable();
+ outer_cache_disable();
/*
* After D-cache is flushed and before it is disabled there may
diff --git a/arch/arm/cpu/armv7/exynos/soc.c b/arch/arm/cpu/armv7/exynos/soc.c
index 8c7d7d8..3813c6c 100644
--- a/arch/arm/cpu/armv7/exynos/soc.c
+++ b/arch/arm/cpu/armv7/exynos/soc.c
@@ -50,7 +50,7 @@ static void exynos5_set_l2cache_params(void)
/*
* Sets L2 cache related parameters before enabling data cache
*/
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
if (cpu_is_exynos5())
exynos5_set_l2cache_params();
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 5f5f497..e3f0fdd 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -472,7 +472,7 @@ void imx_setup_hdmi(void)
#ifndef CONFIG_SYS_L2CACHE_OFF
#define IOMUXC_GPR11_L2CACHE_AS_OCRAM 0x00000002
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
unsigned int val;
@@ -521,7 +521,7 @@ void v7_outer_cache_enable(void)
setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
}
-void v7_outer_cache_disable(void)
+void outer_cache_disable(void)
{
struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 90d6ae7..d5e215d 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -470,7 +470,7 @@ static void omap3_invalidate_l2_cache_secure(void)
}
}
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
/* Set L2EN */
omap3_update_aux_cr_secure(0x2, 0);
diff --git a/arch/arm/cpu/armv7/omap4/hwinit.c b/arch/arm/cpu/armv7/omap4/hwinit.c
index db16548..9841aaa 100644
--- a/arch/arm/cpu/armv7/omap4/hwinit.c
+++ b/arch/arm/cpu/armv7/omap4/hwinit.c
@@ -157,12 +157,12 @@ void init_omap_revision(void)
}
#ifndef CONFIG_SYS_L2CACHE_OFF
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
set_pl310_ctrl_reg(1);
}
-void v7_outer_cache_disable(void)
+void outer_cache_disable(void)
{
set_pl310_ctrl_reg(0);
}
diff --git a/arch/arm/cpu/armv7/s5pc1xx/cache.c b/arch/arm/cpu/armv7/s5pc1xx/cache.c
index 51af299..de6f08d 100644
--- a/arch/arm/cpu/armv7/s5pc1xx/cache.c
+++ b/arch/arm/cpu/armv7/s5pc1xx/cache.c
@@ -23,7 +23,7 @@ void disable_caches(void)
#endif
#ifndef CONFIG_SYS_L2CACHE_OFF
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
__asm(
"push {r0, r1, r2, lr}\n\t"
@@ -34,7 +34,7 @@ void v7_outer_cache_enable(void)
);
}
-void v7_outer_cache_disable(void)
+void outer_cache_disable(void)
{
__asm(
"push {r0, r1, r2, lr}\n\t"
diff --git a/arch/arm/cpu/armv7/uniphier/cache_uniphier.c b/arch/arm/cpu/armv7/uniphier/cache_uniphier.c
index e47f977..76487cb 100644
--- a/arch/arm/cpu/armv7/uniphier/cache_uniphier.c
+++ b/arch/arm/cpu/armv7/uniphier/cache_uniphier.c
@@ -29,12 +29,12 @@ static void uniphier_cache_maint_all(u32 operation)
readl(SSCOPE); /* need a read back to confirm */
}
-void v7_outer_cache_flush_all(void)
+void outer_cache_flush_all(void)
{
uniphier_cache_maint_all(SSCOQM_CM_WB_INV);
}
-void v7_outer_cache_inval_all(void)
+void outer_cache_inval_all(void)
{
uniphier_cache_maint_all(SSCOQM_CM_INV);
}
@@ -92,17 +92,17 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
readl(SSCOPE); /* need a read back to confirm */
}
-void v7_outer_cache_flush_range(u32 start, u32 end)
+void outer_cache_flush_range(u32 start, u32 end)
{
uniphier_cache_maint_range(start, end, SSCOQM_CM_WB_INV);
}
-void v7_outer_cache_inval_range(u32 start, u32 end)
+void outer_cache_inval_range(u32 start, u32 end)
{
uniphier_cache_maint_range(start, end, SSCOQM_CM_INV);
}
-void v7_outer_cache_enable(void)
+void outer_cache_enable(void)
{
u32 tmp;
tmp = readl(SSCC);
@@ -111,7 +111,7 @@ void v7_outer_cache_enable(void)
}
#endif
-void v7_outer_cache_disable(void)
+void outer_cache_disable(void)
{
u32 tmp;
tmp = readl(SSCC);
@@ -141,7 +141,7 @@ void enable_caches(void)
*/
/* L2 disable */
- v7_outer_cache_disable();
+ outer_cache_disable();
/* L1 disable */
reg = get_cr();
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index 9dbcdf2..e4415e8 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -11,6 +11,16 @@
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * Stubs for outer cache operations
+ */
+__weak void outer_cache_enable(void) {}
+__weak void outer_cache_disable(void) {}
+__weak void outer_cache_flush_all(void) {}
+__weak void outer_cache_inval_all(void) {}
+__weak void outer_cache_flush_range(unsigned long start, unsigned long end) {}
+__weak void outer_cache_inval_range(unsigned long start, unsigned long end) {}
+
#ifndef CONFIG_SYS_DCACHE_OFF
void set_pgtable_section(u64 *page_table, u64 index, u64 section,
u64 memory_type)
@@ -71,10 +81,7 @@ static void mmu_setup(void)
void invalidate_dcache_all(void)
{
__asm_invalidate_dcache_all();
-}
-
-void __weak flush_l3_cache(void)
-{
+ outer_cache_inval_all();
}
/*
@@ -83,7 +90,7 @@ void __weak flush_l3_cache(void)
void flush_dcache_all(void)
{
__asm_flush_dcache_all();
- flush_l3_cache();
+ outer_cache_flush_all();
}
/*
@@ -92,6 +99,7 @@ void flush_dcache_all(void)
void invalidate_dcache_range(unsigned long start, unsigned long stop)
{
__asm_flush_dcache_range(start, stop);
+ outer_cache_inval_range(start, stop);
}
/*
@@ -100,12 +108,14 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop)
void flush_dcache_range(unsigned long start, unsigned long stop)
{
__asm_flush_dcache_range(start, stop);
+ outer_cache_flush_range(start, stop);
}
void dcache_enable(void)
{
/* The data cache is not active unless the mmu is enabled */
if (!(get_sctlr() & CR_M)) {
+ outer_cache_enable();
invalidate_dcache_all();
__asm_invalidate_tlb_all();
mmu_setup();
@@ -128,6 +138,7 @@ void dcache_disable(void)
flush_dcache_all();
__asm_invalidate_tlb_all();
+ outer_cache_disable();
}
int dcache_status(void)
diff --git a/arch/arm/cpu/armv8/fsl-lsch3/cpu.c b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
index 47b947f..1f36f7e 100644
--- a/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
@@ -275,7 +275,7 @@ static void hnf_pstate_req(u64 *ptr, u64 state)
}
}
-void flush_l3_cache(void)
+void outer_cache_flush_all(void)
{
hnf_pstate_req((u64 *)HNF0_PSTATE_REQ, HNFPSTAT_SFONLY);
hnf_pstate_req((u64 *)HNF1_PSTATE_REQ, HNFPSTAT_SFONLY);
diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
index a13da23..004434f 100644
--- a/arch/arm/include/asm/armv7.h
+++ b/arch/arm/include/asm/armv7.h
@@ -69,13 +69,6 @@
#define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0))
#define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0))
-void v7_outer_cache_enable(void);
-void v7_outer_cache_disable(void);
-void v7_outer_cache_flush_all(void);
-void v7_outer_cache_inval_all(void);
-void v7_outer_cache_flush_range(u32 start, u32 end);
-void v7_outer_cache_inval_range(u32 start, u32 end);
-
#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
int armv7_init_nonsec(void);
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index a836e9f..5a4ac2f 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -36,6 +36,13 @@ void dram_bank_mmu_setup(int bank);
#endif
+void outer_cache_enable(void);
+void outer_cache_disable(void);
+void outer_cache_flush_all(void);
+void outer_cache_inval_all(void);
+void outer_cache_flush_range(unsigned long start, unsigned long end);
+void outer_cache_inval_range(unsigned long start, unsigned long end);
+
/*
* The current upper bound for ARM L1 data cache line sizes is 64 bytes. We
* use that value for aligning DMA buffers unless the board config has specified
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 89f2294..3b0fd0d 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -78,8 +78,6 @@ void gic_send_sgi(unsigned long sgino);
void wait_for_wakeup(void);
void smp_kick_all_cpus(void);
-void flush_l3_cache(void);
-
#endif /* __ASSEMBLY__ */
#else /* CONFIG_ARM64 */
diff --git a/arch/arm/lib/cache-pl310.c b/arch/arm/lib/cache-pl310.c
index 1ad1f8a..4735407 100644
--- a/arch/arm/lib/cache-pl310.c
+++ b/arch/arm/lib/cache-pl310.c
@@ -39,18 +39,18 @@ static void pl310_background_op_all_ways(u32 *op_reg)
pl310_cache_sync();
}
-void v7_outer_cache_inval_all(void)
+void outer_cache_inval_all(void)
{
pl310_background_op_all_ways(&pl310->pl310_inv_way);
}
-void v7_outer_cache_flush_all(void)
+void outer_cache_flush_all(void)
{
pl310_background_op_all_ways(&pl310->pl310_clean_inv_way);
}
/* Flush(clean invalidate) memory from start to stop-1 */
-void v7_outer_cache_flush_range(u32 start, u32 stop)
+void outer_cache_flush_range(unsigned long start, unsigned long stop)
{
/* PL310 currently supports only 32 bytes cache line */
u32 pa, line_size = 32;
@@ -68,7 +68,7 @@ void v7_outer_cache_flush_range(u32 start, u32 stop)
}
/* invalidate memory from start to stop-1 */
-void v7_outer_cache_inval_range(u32 start, u32 stop)
+void outer_cache_inval_range(unsigned long start, unsigned long stop)
{
/* PL310 currently supports only 32 bytes cache line */
u32 pa, line_size = 32;
@@ -78,7 +78,7 @@ void v7_outer_cache_inval_range(u32 start, u32 stop)
* invalidate the first cache-line
*/
if (start & (line_size - 1)) {
- printf("ERROR: %s - start address is not aligned - 0x%08x\n",
+ printf("ERROR: %s - start address is not aligned - 0x%lx\n",
__func__, start);
/* move to next cache line */
start = (start + line_size - 1) & ~(line_size - 1);
@@ -89,7 +89,7 @@ void v7_outer_cache_inval_range(u32 start, u32 stop)
* invalidate the last cache-line
*/
if (stop & (line_size - 1)) {
- printf("ERROR: %s - stop address is not aligned - 0x%08x\n",
+ printf("ERROR: %s - stop address is not aligned - 0x%lx\n",
__func__, stop);
/* align to the beginning of this cache line */
stop &= ~(line_size - 1);
--
1.7.9.5
4
5