summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2016-05-13 08:55:59 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2016-05-13 08:56:08 +0200
commitc201a77de667d207b4d150cbecc5a9225336de47 (patch)
tree0a0c75dd4591e3601e2dddc3d06d69740bf65df2
parent84bce194674cc57e556ec52826a6014518eb4dd1 (diff)
fix building for imgtec ci20, add helper header for Darwin
-rw-r--r--adk/include/byteswap.h18
-rw-r--r--mk/kernel-vars.mk2
-rw-r--r--target/linux/config/Config.in.serial2
-rw-r--r--target/mips/kernel/imgtec-ci207
-rw-r--r--target/mips/systems/imgtec-ci202
5 files changed, 25 insertions, 6 deletions
diff --git a/adk/include/byteswap.h b/adk/include/byteswap.h
new file mode 100644
index 000000000..f557cd468
--- /dev/null
+++ b/adk/include/byteswap.h
@@ -0,0 +1,18 @@
+#if defined(__linux__) || defined(__CYGWIN__)
+#include_next <byteswap.h>
+#else
+static inline unsigned short bswap_16(unsigned short val)
+{
+ return ((val & 0xff) << 8) | ((val >> 8) & 0xff);
+}
+static inline unsigned long bswap_32(unsigned long val)
+{
+ return bswap_16((unsigned short)val) << 16 |
+ bswap_16((unsigned short)(val >> 16));
+}
+static inline unsigned long long bswap_64(unsigned long long val)
+{
+ return ((((unsigned long long)bswap_32(val)) << 32) |
+ (((unsigned long long)bswap_32(val >> 32)) & 0xffffffffULL));
+}
+#endif
diff --git a/mk/kernel-vars.mk b/mk/kernel-vars.mk
index 1b1baee87..addd7ab4b 100644
--- a/mk/kernel-vars.mk
+++ b/mk/kernel-vars.mk
@@ -18,7 +18,7 @@ endif
# non-Linux platforms need elf.h
ifneq ($(OS_FOR_BUILD),Linux)
KERNEL_MAKE_OPTS+= HOSTCFLAGS='$(HOST_CPPFLAGS) ${HOST_CFLAGS}'
-KERNEL_MAKE_OPTS+= HOST_EXTRACFLAGS='-I ${ADK_TOPDIR}/adk/include -DKBUILD_NO_NLS'
+KERNEL_MAKE_OPTS+= HOST_EXTRACFLAGS='-I${ADK_TOPDIR}/adk/include -DKBUILD_NO_NLS'
else
KERNEL_MAKE_OPTS+= HOSTCFLAGS='${HOST_CFLAGS}'
endif
diff --git a/target/linux/config/Config.in.serial b/target/linux/config/Config.in.serial
index b3144f527..7d3fb7ada 100644
--- a/target/linux/config/Config.in.serial
+++ b/target/linux/config/Config.in.serial
@@ -79,6 +79,7 @@ config ADK_KERNEL_SERIAL_8250
select ADK_KERNEL_SERIAL_8250_PNP if ADK_TARGET_SYSTEM_PCENGINES_APU
select ADK_KERNEL_SERIAL_8250_CONSOLE
depends on ADK_TARGET_SYSTEM_XILINX_KINTEX7 \
+ || ADK_TARGET_SYSTEM_IMGTEC_CI20 \
|| ADK_TARGET_SYSTEM_LINKSYS_NSLU2 \
|| ADK_TARGET_SYSTEM_PCENGINES_APU \
|| ADK_TARGET_SYSTEM_PCENGINES_ALIX \
@@ -96,6 +97,7 @@ config ADK_KERNEL_SERIAL_8250
|| ADK_TARGET_SYSTEM_MIKROTIK_RB532 \
|| ADK_TARGET_SYSTEM_MIKROTIK_RB4XX
default y if ADK_TARGET_SYSTEM_XILINX_KINTEX7
+ default y if ADK_TARGET_SYSTEM_IMGTEC_CI20
default y if ADK_TARGET_SYSTEM_LINKSYS_NSLU2
default y if ADK_TARGET_SYSTEM_PCENGINES_APU
default y if ADK_TARGET_SYSTEM_PCENGINES_ALIX
diff --git a/target/mips/kernel/imgtec-ci20 b/target/mips/kernel/imgtec-ci20
index 3f3ae2b1d..e40370c50 100644
--- a/target/mips/kernel/imgtec-ci20
+++ b/target/mips/kernel/imgtec-ci20
@@ -1,5 +1,4 @@
CONFIG_MIPS=y
-CONFIG_MACH_JZ4740=y
-CONFIG_CPU_MIPS32_R1=y
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_MACH_INGENIC=y
+CONFIG_MACH_JZ4780=y
+CONFIG_JZ4780_CI20=y
diff --git a/target/mips/systems/imgtec-ci20 b/target/mips/systems/imgtec-ci20
index 35ca91e3b..5b2d80653 100644
--- a/target/mips/systems/imgtec-ci20
+++ b/target/mips/systems/imgtec-ci20
@@ -2,7 +2,7 @@ config ADK_TARGET_SYSTEM_IMGTEC_CI20
bool "Imagination Creator CI20"
depends on ADK_EXPERIMENTAL
depends on ADK_TARGET_LITTLE_ENDIAN
- select ADK_TARGET_CPU_MIPS_MIPS32
+ select ADK_TARGET_CPU_MIPS_MIPS32R2
select ADK_TARGET_WITH_SERIAL
select ADK_TARGET_WITH_NAND
select ADK_TARGET_WITH_USB