nuvoton: move npcm7xx support into meta-nuvoton layer

Move support for the npcm7xx SOCs directly into the meta-nuvoton BSP
layer. This matches the layout for other chip vendors' BSPs.

Change-Id: I47ac7a5b02cf87f6dd60d0f6fba2463c18e9fdf1
Signed-off-by: Benjamin Fair <benjaminfair@google.com>
diff --git a/conf/layer.conf b/conf/layer.conf
index 62d1a53..1fefedb 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -1,9 +1,9 @@
 # We have a conf and classes directory, add to BBPATH
 BBPATH .= ":${LAYERDIR}"
 
-BBFILES += "${LAYERDIR}/common/recipes-*/*/*.bb \
-            ${LAYERDIR}/common/recipes-*/*/*.bbappend"
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+            ${LAYERDIR}/recipes-*/*/*.bbappend"
 
-BBFILE_COLLECTIONS += "nuvoton"
-BBFILE_PATTERN_nuvoton = ""
-LAYERVERSION_nuvoton = "1"
+BBFILE_COLLECTIONS += "nuvoton-layer"
+BBFILE_PATTERN_nuvoton-layer = ""
+LAYERVERSION_nuvoton-layer = "1"
diff --git a/conf/machine/evb-npcm750.conf b/conf/machine/evb-npcm750.conf
new file mode 100644
index 0000000..e06e93a
--- /dev/null
+++ b/conf/machine/evb-npcm750.conf
@@ -0,0 +1,9 @@
+KMACHINE = "nuvoton"
+KERNEL_DEVICETREE = "${KMACHINE}-npcm750-evb.dtb"
+
+UBOOT_MACHINE = "PolegSVB_config"
+
+FLASH_SIZE = "32768"
+
+require conf/machine/include/npcm7xx.inc
+require conf/machine/include/obmc-bsp-common.inc
diff --git a/conf/machine/include/npcm7xx.inc b/conf/machine/include/npcm7xx.inc
new file mode 100644
index 0000000..3d8847d
--- /dev/null
+++ b/conf/machine/include/npcm7xx.inc
@@ -0,0 +1,22 @@
+#@TYPE: Machine
+#@NAME: Nuvoton NPCM7XX
+#@DESCRIPTION: Common machine configuration for Nuvoton NPCM7XX Chip
+
+require conf/machine/include/nuvoton.inc
+
+KERNEL_IMAGETYPE ?= "uImage"
+KERNEL_EXTRA_ARGS ?= "UIMAGE_LOADADDR=0x00008000"
+
+UBOOT_MACHINE ?= "PolegSVB_config"
+UBOOT_ENTRYPOINT ?= "0x00008000"
+UBOOT_LOADADDRESS ?= "0x00008000"
+
+DEFAULTTUNE ?= "arm7a-novfp"
+
+SERIAL_CONSOLES = "115200;ttyS3"
+
+SOC_FAMILY = "npcm7xx"
+include conf/machine/include/soc-family.inc
+MACHINEOVERRIDES .= ":npcm7xx"
+
+require conf/machine/include/tune-arm7a-novfp.inc
diff --git a/conf/machine/include/nuvoton.inc b/conf/machine/include/nuvoton.inc
new file mode 100644
index 0000000..068fe35
--- /dev/null
+++ b/conf/machine/include/nuvoton.inc
@@ -0,0 +1,6 @@
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-nuvoton"
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-nuvoton"
+PREFERRED_PROVIDER_u-boot ?= "u-boot-nuvoton"
+PREFERRED_PROVIDER_u-boot-fw-utils ?= "u-boot-fw-utils-nuvoton"
+
+MACHINEOVERRIDES .= ":nuvoton"
diff --git a/conf/machine/include/tune-arm7a-novfp.inc b/conf/machine/include/tune-arm7a-novfp.inc
new file mode 100644
index 0000000..18730db
--- /dev/null
+++ b/conf/machine/include/tune-arm7a-novfp.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "arm7a-novfp"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[arm7a-novfp] = "Enable arm7a-novfp specific processor optimizations"
+
+AVAILTUNES += "arm7a-novfp"
+ARMPKGARCH_tune-arm7a-novfp = "armv7a"
+TUNE_FEATURES_tune-armv7a = "arm armv7a"
+TUNE_FEATURES_tune-arm7a-novfp = "${TUNE_FEATURES_tune-armv7a} arm7a-novfp"
+PACKAGE_EXTRA_ARCHS_tune-arm7a-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv7a}"