summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-07-27 11:11:44 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2015-07-27 23:33:20 +0200
commit3b690f450c1e20b893c8e3d78d88aa911ead4a3b (patch)
tree37d8c6c015c7719a5a98036082aae4bad5ae3334
parentc011ab0cef70ea479afb92bed8c4d6626eb05c86 (diff)
add some basic support for emcraft kinetis
-rw-r--r--mk/linux.mk2
-rw-r--r--mk/vars.mk9
-rw-r--r--rules.mk1
-rw-r--r--target/arm/kernel/kinetis-k7016
-rw-r--r--target/arm/systems/kinetis-k7014
-rw-r--r--target/config/Config.in1
-rw-r--r--target/config/Config.in.cpu2
-rw-r--r--target/config/Config.in.kernel1
-rw-r--r--target/config/Config.in.kernelversion.choice16
-rw-r--r--target/config/Config.in.runtime1
-rw-r--r--target/config/Config.in.target1
-rw-r--r--target/linux/config/Config.in.ethernet4
-rw-r--r--target/linux/config/Config.in.kernel11
-rw-r--r--target/linux/config/Config.in.usb11
-rw-r--r--toolchain/uclibc-ng/Makefile1
15 files changed, 81 insertions, 10 deletions
diff --git a/mk/linux.mk b/mk/linux.mk
index a311637ac..bd014c20f 100644
--- a/mk/linux.mk
+++ b/mk/linux.mk
@@ -4,9 +4,9 @@
PKG_NAME:= linux
PKG_VERSION:= $(KERNEL_VERSION)
PKG_RELEASE:= $(KERNEL_RELEASE)
-PKG_HASH:= $(KERNEL_HASH)
ifeq ($(ADK_KERNEL_VERSION_GIT),y)
PKG_SITES:= $(ADK_KERNEL_REPO)
+PKG_VERSION:= $(ADK_KERNEL_HASH)
else
PKG_SITES:= ${MASTER_SITE_KERNEL:=kernel/v4.x/} \
${MASTER_SITE_KERNEL:=kernel/v3.x/} \
diff --git a/mk/vars.mk b/mk/vars.mk
index fd6ba65ce..c613a5cd0 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -88,14 +88,11 @@ endif
# target tools
TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
-# use a gcc wrapper for coldfire/arm uclinux support
+# use a gcc wrapper for coldfire uclinux support
ifeq ($(ADK_TARGET_UCLINUX),y)
ifeq ($(ADK_TARGET_ARCH_M68K),y)
TARGET_CC:= adk-uclinux-gcc
endif
-ifeq ($(ADK_TARGET_ARCH_ARM),y)
-TARGET_CC:= adk-uclinux-gcc
-endif
endif
TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
@@ -293,8 +290,8 @@ TARGET_CFLAGS+= -funsafe-math-optimizations -ffast-math
TARGET_CXXFLAGS+= -funsafe-math-optimizations -ffast-math
endif
ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
-TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb
-TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb
+TARGET_CFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
+TARGET_CXXFLAGS+= -mthumb -Wa,-mimplicit-it=thumb -mno-thumb-interwork
else
TARGET_CFLAGS+= -marm
TARGET_CXXFLAGS+= -marm
diff --git a/rules.mk b/rules.mk
index 9b0bd7d17..3b2dc5edf 100644
--- a/rules.mk
+++ b/rules.mk
@@ -65,6 +65,7 @@ ADK_PARAMETER_NETCONSOLE_SRC_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE
ADK_PARAMETER_NETCONSOLE_DST_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_DST_IP)))
ADK_JFFS2_OPTS:= $(strip $(subst ",, $(ADK_JFFS2_OPTS)))
ADK_WGET_TIMEOUT:= $(strip $(subst ",, $(ADK_WGET_TIMEOUT)))
+ADK_KERNEL_HASH:= $(strip $(subst ",, $(ADK_KERNEL_HASH)))
ADK_TARGET_KARCH:=$(ADK_TARGET_ARCH)
diff --git a/target/arm/kernel/kinetis-k70 b/target/arm/kernel/kinetis-k70
new file mode 100644
index 000000000..4ffe140a4
--- /dev/null
+++ b/target/arm/kernel/kinetis-k70
@@ -0,0 +1,16 @@
+CONFIG_ARM=y
+CONFIG_ARCH_KINETIS=y
+CONFIG_MACH_KINETIS=y
+CONFIG_KINETIS_UART2=y
+CONFIG_KINETIS_MAC=y
+CONFIG_KINETIS_EDMA=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_V7M=y
+CONFIG_CPU_32v7M=y
+CONFIG_CPU_ABRT_NOMMU=y
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_ARM_CORTEXM3=y
+CONFIG_ARM_ASM_UNIFIED=y
diff --git a/target/arm/systems/kinetis-k70 b/target/arm/systems/kinetis-k70
new file mode 100644
index 000000000..ff35694f4
--- /dev/null
+++ b/target/arm/systems/kinetis-k70
@@ -0,0 +1,14 @@
+config ADK_TARGET_SYSTEM_KINETIS_K70
+ bool "Kinetis K70"
+ depends on ADK_EXPERIMENTAL
+ select ADK_CPU_CORTEX_M3
+ select ADK_TARGET_LITTLE_ENDIAN
+ select ADK_TARGET_WITH_SERIAL
+ select ADK_TARGET_WITH_USB
+ select ADK_TARGET_UCLINUX
+ select ADK_TARGET_KERNEL_UIMAGE
+ select ADK_KERNEL_REPO "https://github.com/EmcraftSystems/linux-emcraft.git"
+ select ADK_KERNEL_HASH "a5125a7f66b441008f505e4ce5d45ebb24ea28a7"
+ help
+ Kinetis K70
+
diff --git a/target/config/Config.in b/target/config/Config.in
index 8c11d435d..34885ecba 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -29,6 +29,7 @@ config ADK_TARGET_VBOX
config ADK_TARGET_ARCH_ARM_WITH_THUMB
bool
+ select ADK_KERNEL_ARM_THUMB
select ADK_KERNEL_THUMB2_KERNEL
depends on ADK_TARGET_ARCH_ARM
diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu
index 6295d0354..beb34bb92 100644
--- a/target/config/Config.in.cpu
+++ b/target/config/Config.in.cpu
@@ -369,11 +369,13 @@ config ADK_CPU_CORTEX_M3
bool
select ADK_TARGET_WITH_LT
select ADK_TARGET_WITHOUT_MMU
+ select ADK_TARGET_ARCH_ARM_WITH_THUMB
config ADK_CPU_CORTEX_M4
bool
select ADK_TARGET_WITH_LT
select ADK_TARGET_WITHOUT_MMU
+ select ADK_TARGET_ARCH_ARM_WITH_THUMB
config ADK_CPU_CORTEX_A5
bool
diff --git a/target/config/Config.in.kernel b/target/config/Config.in.kernel
index 92d749365..0eadd0e16 100644
--- a/target/config/Config.in.kernel
+++ b/target/config/Config.in.kernel
@@ -77,6 +77,7 @@ config ADK_TARGET_KERNEL_MINICONFIG
default "banana-pro" if ADK_TARGET_SYSTEM_BANANA_PRO
default "xilinx-kintex7" if ADK_TARGET_SYSTEM_XILINX_KINTEX7
default "pcengines-alix" if ADK_TARGET_SYSTEM_PCENGINES_ALIX
+ default "kinetis-k70" if ADK_TARGET_SYSTEM_KINETIS_K70
default "sim-bfin" if ADK_TARGET_SYSTEM_SIM_BFIN
default "sim-h8300h" if ADK_TARGET_SYSTEM_SIM_H8300H
default "qemu-m68k-mcf5208" if ADK_TARGET_QEMU_M68K_MCF5208
diff --git a/target/config/Config.in.kernelversion.choice b/target/config/Config.in.kernelversion.choice
index 22d095e36..e4836562a 100644
--- a/target/config/Config.in.kernelversion.choice
+++ b/target/config/Config.in.kernelversion.choice
@@ -4,6 +4,7 @@
choice
prompt "Kernel Version"
depends on ADK_TARGET_KERNEL_CUSTOMISING
+default ADK_KERNEL_VERSION_GIT if ADK_TARGET_SYSTEM_KINETIS_K70
default ADK_KERNEL_VERSION_4_0_6
config ADK_KERNEL_VERSION_GIT
@@ -16,6 +17,7 @@ config ADK_KERNEL_VERSION_4_1_2
bool "4.1.2"
depends on !ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 || ADK_EXPERIMENTAL
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_4_1
config ADK_KERNEL_VERSION_4_0_6
@@ -24,6 +26,7 @@ config ADK_KERNEL_VERSION_4_0_6
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI2 || ADK_EXPERIMENTAL
depends on !ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 || ADK_EXPERIMENTAL
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_4_0
config ADK_KERNEL_VERSION_3_18_16
@@ -33,6 +36,7 @@ config ADK_KERNEL_VERSION_3_18_16
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_18
config ADK_KERNEL_VERSION_3_14_45
@@ -42,6 +46,7 @@ config ADK_KERNEL_VERSION_3_14_45
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI2
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_14
config ADK_KERNEL_VERSION_3_14_36
@@ -62,6 +67,7 @@ config ADK_KERNEL_VERSION_3_12_44
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI2
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_12
config ADK_KERNEL_VERSION_3_10_81
@@ -73,6 +79,7 @@ config ADK_KERNEL_VERSION_3_10_81
depends on !ADK_TARGET_ARCH_NIOS2
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_10
config ADK_KERNEL_VERSION_3_4_108
@@ -84,6 +91,7 @@ config ADK_KERNEL_VERSION_3_4_108
depends on !ADK_TARGET_ARCH_NIOS2
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_4
config ADK_KERNEL_VERSION_3_2_69
@@ -95,6 +103,7 @@ config ADK_KERNEL_VERSION_3_2_69
depends on !ADK_TARGET_ARCH_NIOS2
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_3_2
config ADK_KERNEL_VERSION_2_6_32_67
@@ -106,6 +115,7 @@ config ADK_KERNEL_VERSION_2_6_32_67
depends on !ADK_TARGET_ARCH_NIOS2
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
depends on !ADK_TARGET_ARCH_H8300
+ depends on !ADK_TARGET_SYSTEM_KINETIS_K70
select ADK_KERNEL_VERSION_2_6_32
endchoice
@@ -116,3 +126,9 @@ config ADK_KERNEL_REPO
default "git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git"
help
GIT repository to use.
+
+config ADK_KERNEL_HASH
+ string
+ depends on ADK_KERNEL_VERSION_GIT
+ help
+ GIT hash to use.
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index 926fb71a9..b8f8f8413 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -234,6 +234,7 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
default "ttymxc0" if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+ default "ttyS2" if ADK_TARGET_SYSTEM_KINETIS_K70
default "ttyS0"
config ADK_RUNTIME_CONSOLE_SERIAL_SPEED
diff --git a/target/config/Config.in.target b/target/config/Config.in.target
index ceb12ca12..e0eaa1fc4 100644
--- a/target/config/Config.in.target
+++ b/target/config/Config.in.target
@@ -5,6 +5,7 @@ config ADK_TARGET_CMDLINE
string
default "fbcon=rotate:1" if ADK_TARGET_SYSTEM_SHARP_ZAURUS
default "geodewdt.nowayout=1" if ADK_TARGET_SYSTEM_PCENGINES_ALIX1C
+ default "kinetis_platform=k70-som" if ADK_TARGET_SYSTEM_KINETIS_K70
default ""
choice
diff --git a/target/linux/config/Config.in.ethernet b/target/linux/config/Config.in.ethernet
index 4aeb0010e..1e034503e 100644
--- a/target/linux/config/Config.in.ethernet
+++ b/target/linux/config/Config.in.ethernet
@@ -64,9 +64,11 @@ config ADK_KERNEL_FEC
select ADK_KERNEL_NET_VENDOR_FREESCALE
select ADK_KERNEL_AT803X_PHY
depends on ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 || \
- ADK_TARGET_QEMU_M68K_MCF5208
+ ADK_TARGET_QEMU_M68K_MCF5208 || \
+ ADK_TARGET_SYSTEM_KINETIS_K70
default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default y if ADK_TARGET_QEMU_M68K_MCF5208
+ default y if ADK_TARGET_SYSTEM_KINETIS_K70
default n
help
FEC ethernet driver
diff --git a/target/linux/config/Config.in.kernel b/target/linux/config/Config.in.kernel
index a0a681c6d..c41e086c5 100644
--- a/target/linux/config/Config.in.kernel
+++ b/target/linux/config/Config.in.kernel
@@ -112,6 +112,9 @@ config ADK_KERNEL_AEABI
bool
default y if ADK_TARGET_ARCH_ARM
+config ADK_KERNEL_ARM_THUMB
+ bool
+
config ADK_KERNEL_THUMB2_KERNEL
bool
@@ -126,7 +129,8 @@ config ADK_KERNEL_CPU_LITTLE_ENDIAN
choice
prompt "Kernel Compression"
-depends on !ADK_TARGET_SYSTEM_MIKROTIK_RB532
+default ADK_KERNEL_COMPRESS_NONE if ADK_TARGET_SYSTEM_MIKROTIK_RB532 \
+ || ADK_TARGET_SYSTEM_KINETIS_K70
default ADK_KERNEL_COMP_GZIP if ADK_TARGET_BOARD_BCM28XX
config ADK_KERNEL_COMP_XZ
@@ -171,6 +175,10 @@ config ADK_KERNEL_COMP_GZIP
select ADK_KERNEL_KERNEL_GZIP
select ADK_KERNEL_INITRAMFS_COMPRESSION_GZIP
+config ADK_KERNEL_COMPRESS_NONE
+ bool "use no compression"
+ select ADK_KERNEL_INITRAMFS_COMPRESSION_NONE
+
endchoice
menu "Kernel options"
@@ -243,7 +251,6 @@ config ADK_KERNEL_PREEMPT
help
Enable preemptive mode.
-
choice
prompt "tick configuration"
diff --git a/target/linux/config/Config.in.usb b/target/linux/config/Config.in.usb
index fbbe5c09b..e6023b302 100644
--- a/target/linux/config/Config.in.usb
+++ b/target/linux/config/Config.in.usb
@@ -46,6 +46,7 @@ config ADK_KERNEL_USB
default m if ADK_TARGET_SYSTEM_LEMOTE_YEELONG
default m if ADK_TARGET_SYSTEM_ACMESYSTEMS_FOXG20
default m if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
+ default y if ADK_TARGET_SYSTEM_KINETIS_K70
default n
help
Universal Serial Bus (USB) is a specification for a serial bus
@@ -198,6 +199,16 @@ config ADK_KERNEL_USB_SL811_HCD
board has this chip, and you want to use it as a host controller.
If unsure, say N.
+config ADK_KERNEL_USB_EHCI_MXC
+ bool "Freescale EHCI MXC USB controller"
+ depends on ADK_KERNEL_USB
+ depends on ADK_TARGET_SYSTEM_KINETIS_K70
+ select ADK_KERNEL_GPIOLIB
+ default y if ADK_TARGET_SYSTEM_KINETIS_K70
+ default n
+ help
+ Freescale USB controller.
+
endmenu
menu "USB devices support"
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
index fb662723c..8e3dc2098 100644
--- a/toolchain/uclibc-ng/Makefile
+++ b/toolchain/uclibc-ng/Makefile
@@ -177,6 +177,7 @@ endif
ifeq ($(ADK_TARGET_ARCH_ARM),y)
ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
$(SED) 's/.*\(COMPILE_IN_THUMB_MODE\).*/\1=y/' ${WRKBUILD}/.config
+ $(SED) 's/.*\(UCLIBC_HAS_CONTEXT_FUNCS\).*/# \1 is not set/' ${WRKBUILD}/.config
endif
endif