This commit is contained in:
coolsnowwolf 2018-01-09 14:38:15 +08:00
parent b780d3bfb6
commit 229cde62a4
1228 changed files with 18795 additions and 30035 deletions

View File

@ -17,6 +17,7 @@ menu "Target Images"
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
default TARGET_INITRAMFS_COMPRESSION_NONE
depends on TARGET_ROOTFS_INITRAMFS
help
@ -61,7 +62,7 @@ menu "Target Images"
config TARGET_ROOTFS_TARGZ
bool "tar.gz"
default n if USES_TARGZ
default y if USES_TARGZ
help
Build a compressed tar archive of the root filesystem.
@ -69,7 +70,7 @@ menu "Target Images"
menuconfig TARGET_ROOTFS_EXT4FS
bool "ext4"
default n if USES_EXT4
default y if USES_EXT4
help
Build an ext4 root filesystem.
@ -114,7 +115,7 @@ menu "Target Images"
config TARGET_ROOTFS_ISO
bool "iso"
default n
depends on TARGET_x86
depends on TARGET_x86_generic
help
Create a bootable ISO image.
@ -141,7 +142,7 @@ menu "Target Images"
int "Block size (in KiB)"
depends on TARGET_ROOTFS_SQUASHFS
default 64 if LOW_MEMORY_FOOTPRINT
default 1024
default 256
menuconfig TARGET_ROOTFS_UBIFS
bool "ubifs"
@ -184,31 +185,22 @@ menu "Target Images"
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
select PACKAGE_grub2
default y
config EFI_IMAGES
bool "Build EFI GRUB images (Linux x86 or x86_64 host only)"
depends on TARGET_x86
depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
select PACKAGE_grub2
select PACKAGE_grub2-efi
default n
config GRUB_CONSOLE
bool "Use Console Terminal (in addition to Serial)"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2)
default y
config GRUB_SERIAL
string "Serial port device"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
default "hvc0" if TARGET_x86_xen_domu
default "ttyS0" if ! TARGET_x86_xen_domu
config GRUB_BAUDRATE
int "Serial port baud rate"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
default 38400 if TARGET_x86_generic
default 115200
@ -219,41 +211,40 @@ menu "Target Images"
config GRUB_BOOTOPTS
string "Extra kernel boot options"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
default "xencons=hvc" if TARGET_x86_xen_domu
help
If you don't know, just leave it blank.
config GRUB_TIMEOUT
string "Seconds to wait before booting the default entry"
depends on GRUB_IMAGES || EFI_IMAGES
default "0"
depends on GRUB_IMAGES
default "5"
help
If you don't know, 5 seconds is a reasonable default.
config VDI_IMAGES
bool "Build VirtualBox image files (VDI)"
depends on TARGET_x86 || TARGET_x86_64
depends on GRUB_IMAGES || EFI_IMAGES
select GRUB_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-e1000
config VMDK_IMAGES
bool "Build VMware image files (VMDK)"
depends on TARGET_x86 || TARGET_x86_64
depends on GRUB_IMAGES || EFI_IMAGES
select GRUB_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-e1000
default y
config TARGET_IMAGES_PAD
bool "Pad images to filesystem size (for JFFS2)"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
config TARGET_IMAGES_GZIP
bool "GZip images"
depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || TARGET_x86
default n
default y
comment "Image Options"
@ -261,19 +252,19 @@ menu "Target Images"
config TARGET_KERNEL_PARTSIZE
int "Kernel partition size (in MB)"
depends on GRUB_IMAGES || EFI_IMAGES
default 8
depends on GRUB_IMAGES
default 16
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
depends on GRUB_IMAGES || EFI_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
default 96
depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
default 256
help
Select the root filesystem partition size.
config TARGET_ROOTFS_PARTNAME
string "Root partition on target device"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
help
Override the root partition on the final device. If left empty,
it will be mounted by PARTUUID which makes the kernel find the

View File

@ -62,7 +62,7 @@ config KERNEL_PROFILING
config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default n
default y if !SMALL_FLASH
help
This will give you more information in stack traces from kernel oopses.
@ -254,7 +254,7 @@ config KERNEL_DEVTMPFS
default n
help
devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
devices nodes for all registered devices ti simplify boot, but leaves more
devices nodes for all registered devices to simplify boot, but leaves more
complex tasks to userspace (e.g. udev).
if KERNEL_DEVTMPFS

View File

@ -103,7 +103,7 @@ hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH)
endif
define DownloadMethod/unknown
@echo "ERROR: No download method available"; false
echo "ERROR: No download method available"; false
endef
define DownloadMethod/default

View File

@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/depends.mk
include $(INCLUDE_DIR)/quilt.mk
BUILD_TYPES += host
HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS)))
HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST))
@ -78,6 +78,10 @@ HOST_MAKE_FLAGS =
HOST_CONFIGURE_CMD = $(BASH) ./configure
ifeq ($(HOST_OS),Darwin)
HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin
endif
define Host/Configure/Default
$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
if [ -x configure ]; then \
@ -128,6 +132,7 @@ define Host/Exports/Default
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
endef
Host/Exports=$(Host/Exports/Default)

View File

@ -102,8 +102,7 @@ define Build/tplink-safeloader
endef
define Build/append-dtb
$(call Image/BuildDTB,$(if $(DEVICE_DTS_DIR),$(DEVICE_DTS_DIR),$(DTS_DIR))/$(DEVICE_DTS).dts,$@.dtb)
cat $@.dtb >> $@
cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@
endef
define Build/install-dtb
@ -114,6 +113,11 @@ define Build/install-dtb
)
endef
define Build/install-zImage
$(CP) $(KDIR)/zImage \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
endef
define Build/fit
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o $@.its -k $@ \
@ -244,14 +248,20 @@ endef
define Build/tplink-v2-header
$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
-c -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) -k $@ -o $@.new
-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
-T $(TPLINK_HVERSION) -V "ver. 2.0" \
-k $@ -o $@.new $(1)
@mv $@.new $@
endef
define Build/tplink-v2-image
$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
-a 0x4 -j -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) \
-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
-T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1)
cat $@.new >> $@
rm -rf $@.new
endef
@ -271,7 +281,7 @@ metadata_json = \
}'
define Build/append-metadata
$(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
$(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
endef
define Build/kernel2minor

View File

@ -435,7 +435,27 @@ define Device/Build/compile
endef
ifndef IB
define Device/Build/dtb
ifndef BUILD_DTS_$(1)
BUILD_DTS_$(1) := 1
$(KDIR)/image-$(1).dtb: FORCE
$(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@)
image_prepare: $(KDIR)/image-$(1).dtb
endif
endef
endif
define Device/Build/kernel
$$(eval $$(foreach dts,$$(DEVICE_DTS), \
$$(call Device/Build/dtb,$$(notdir $$(dts)), \
$$(if $$(DEVICE_DTS_DIR),$$(DEVICE_DTS_DIR),$$(DTS_DIR)), \
$$(dts) \
) \
))
$(KDIR)/$$(KERNEL_NAME):: image_prepare
$$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
$(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1))

View File

@ -4,13 +4,13 @@ LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .108
LINUX_VERSION-4.9 = .72
LINUX_VERSION-4.14 = .6
LINUX_VERSION-4.9 = .73
LINUX_VERSION-4.14 = .12
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a
LINUX_KERNEL_HASH-4.9.72 = 69f201f1eb9eade9a3cde26d3896a53df9fddf1e19f9fa7b36331b8b1976b83b
LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc
LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b
LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
@ -24,4 +24,4 @@ KERNEL_PATCHVER ?= $(KERNEL)
# disable the md5sum check for unknown kernel versions
LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION)))
LINUX_KERNEL_HASH?=x
LINUX_KERNEL_HASH?=x

View File

@ -52,7 +52,7 @@ else
LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))
LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown)
LINUX_UNAME_VERSION:=$(if $(word 3,$(subst ., ,$(KERNEL_BASE))),$(KERNEL_BASE),$(KERNEL_BASE).0)
LINUX_UNAME_VERSION:=$(KERNEL_BASE)
ifneq ($(findstring -rc,$(LINUX_VERSION)),)
LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION))))
endif
@ -64,7 +64,7 @@ else
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING)
else
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release))
LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
endif
MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
@ -85,6 +85,8 @@ else ifneq (,$(findstring $(ARCH) , armeb ))
LINUX_KARCH := arm
else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
LINUX_KARCH := mips
else ifneq (,$(findstring $(ARCH) , powerpc64 ))
LINUX_KARCH := powerpc
else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
LINUX_KARCH := sh
else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
@ -121,61 +123,53 @@ ifdef CONFIG_USE_SPARSE
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
endif
PKG_EXTMOD_SUBDIRS ?= .
define populate_module_symvers
@mkdir -p $(PKG_INFO_DIR)
cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
done
endef
define collect_module_symvers
for subdir in $(PKG_EXTMOD_SUBDIRS); do \
grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
done; \
sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \
mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers
endef
define KernelPackage/hooks
ifneq ($(PKG_NAME),kernel)
Hooks/Compile/Pre += populate_module_symvers
Hooks/Compile/Post += collect_module_symvers
endif
define KernelPackage/hooks
endef
endef
define KernelPackage/Defaults
FILES:=
AUTOLOAD:=
MODPARAMS:=
PKGFLAGS+=nonshared
endef
# 1: name
# 2: install prefix
# 3: module priority prefix
# 4: required for boot
# 5: module list
define ModuleAutoLoad
$(SH_FUNC) \
export modules=; \
probe_module() { \
local mods="$$$$$$$$1"; \
local boot="$$$$$$$$2"; \
local mod; \
shift 2; \
for mod in $$$$$$$$mods; do \
mkdir -p $(2)/etc/modules.d; \
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \
done; \
if [ -e $(2)/etc/modules.d/$(1) ]; then \
if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$(1) ]; then \
mkdir -p $(2)/etc/modules-boot.d; \
ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \
fi; \
modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$mods"; \
fi; \
}; \
add_module() { \
local priority="$$$$$$$$1"; \
local mods="$$$$$$$$2"; \
local boot="$$$$$$$$3"; \
local mod; \
shift 3; \
for mod in $$$$$$$$mods; do \
mkdir -p $(2)/etc/modules.d; \
echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \
done; \
if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \
if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$$$$$$$$priority-$(1) ]; then \
mkdir -p $(2)/etc/modules-boot.d; \
ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \
fi; \
modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$priority-$(1)"; \
fi; \
}; \
$(3) \
if [ -n "$$$$$$$$modules" ]; then \
modules="$$$$$$$$(echo "$$$$$$$$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; \
mkdir -p $(2)/etc/modules.d; \
mkdir -p $(2)/CONTROL; \
echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \
echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst-pkg; \
echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst-pkg; \
echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst-pkg; \
chmod 0755 $(2)/CONTROL/postinst-pkg; \
fi
$(if $(5), \
mkdir -p $(2)/etc/modules.d; \
($(foreach mod,$(5), \
echo "$(mod)$(if $(MODPARAMS.$(mod)), $(MODPARAMS.$(mod)),$(if $(MODPARAMS), $(MODPARAMS)))"; )) > $(2)/etc/modules.d/$(3)$(1); \
$(if $(4), \
mkdir -p $(2)/etc/modules-boot.d; \
ln -sf ../modules.d/$(3)$(1) $(2)/etc/modules-boot.d/;))
endef
ifeq ($(DUMP)$(TARGET_BUILD),)
@ -228,6 +222,7 @@ $(call KernelPackage/$(1)/config)
endif
$(call KernelPackage/depends)
$(call KernelPackage/hooks)
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
ifneq ($(strip $(FILES)),)
@ -243,7 +238,7 @@ $(call KernelPackage/$(1)/config)
exit 1; \
fi; \
done;
$(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
$(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD)))
$(call KernelPackage/$(1)/install,$$(1))
endef
endif
@ -265,12 +260,17 @@ endef
version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1))
# 1: priority (optional)
# 2: module list
# 3: boot flag
define AutoLoad
add_module "$(1)" "$(call version_filter,$(2))" "$(3)";
$(if $(1),$(1),0) $(if $(3),1,0) $(call version_filter,$(2))
endef
# 1: module list
# 2: boot flag
define AutoProbe
probe_module "$(call version_filter,$(1))" "$(2)";
$(call AutoLoad,,$(1),$(2))
endef
version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0)

View File

@ -262,6 +262,10 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_i
$(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32))
# checksum
$(eval $(call nf_add,IPT_CHECKSUM,CONFIG_NETFILTER_XT_TARGET_CHECKSUM, $(P_XT)xt_CHECKSUM))
# netlink
@ -366,7 +370,6 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
IPT_BUILTIN += $(NF_NATHELPER-y)
IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
IPT_BUILTIN += $(IPT_ULOG-y)
IPT_BUILTIN += $(IPT_DEBUG-y)
IPT_BUILTIN += $(IPT_TPROXY-y)
IPT_BUILTIN += $(NFNETLINK-y)
IPT_BUILTIN += $(NFNETLINK_LOG-y)

View File

@ -57,6 +57,8 @@ define Package/Default
DEFAULT_VARIANT:=
USERID:=
ALTERNATIVES:=
LICENSE:=$(PKG_LICENSE)
LICENSE_FILES:=$(PKG_LICENSE_FILES)
endef
Build/Patch:=$(Build/Patch/Default)

View File

@ -46,8 +46,8 @@ $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
Maintainer: $(MAINTAINER)
$(if $(USERID),Require-User: $(USERID)
)Source: $(PKG_SOURCE)
$(if $(PKG_LICENSE),License: $(PKG_LICENSE)
)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES)
$(if $(LICENSE),License: $(LICENSE)
)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES)
)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
)$(if $(BUILDONLY),Build-Only: $(BUILDONLY)

View File

@ -161,8 +161,8 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
)$$(call addfield,Source,$(SOURCE)
)$$(call addfield,License,$$(PKG_LICENSE)
)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES)
)$$(call addfield,License,$(LICENSE)
)$$(call addfield,LicenseFiles,$(LICENSE_FILES)
)$$(call addfield,Section,$(SECTION)
)$$(call addfield,Require-User,$(USERID)
)$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed

View File

@ -69,9 +69,9 @@ ifneq ($(PREV_STAMP_PREPARED),)
STAMP_PREPARED:=$(PREV_STAMP_PREPARED)
CONFIG_AUTOREBUILD:=
else
STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
endif
STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed
@ -144,6 +144,9 @@ endef
Build/Exports=$(Build/Exports/Default)
define Build/CoreTargets
STAMP_PREPARED:=$$(STAMP_PREPARED)
STAMP_CONFIGURED:=$$(STAMP_CONFIGURED)
$(if $(QUILT),$(Build/Quilt))
$(call Build/Autoclean)
$(call DefaultTargets)
@ -165,11 +168,11 @@ define Build/CoreTargets
$(call Build/Exports,$(STAMP_CONFIGURED))
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS)
rm -f $(STAMP_CONFIGURED_WILDCARD)
$(CleanStaging)
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
$(Build/Configure)
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
rm -f $(STAMP_CONFIGURED_WILDCARD)
touch $$@
$(call Build/Exports,$(STAMP_BUILT))

View File

@ -27,32 +27,36 @@ $(eval $(call TestHostCommand,proper-umask, \
umask | grep -xE 00[012][012]))
$(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc), \
$(CC) --version | grep gcc, \
gcc --version | grep gcc, \
gcc49 --version | grep gcc, \
Please install the GNU C Compiler (gcc) 4.8 or later \
$(CC) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
gcc -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
gcc48 --version | grep gcc, \
gcc47 --version | grep gcc, \
gcc46 --version | grep gcc, \
gcc49 --version | grep gcc, \
gcc5 --version | grep gcc, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-gcc, \
Please reinstall the GNU C Compiler - it appears to be broken, \
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
gcc -x c -o $(TMP_DIR)/a.out -))
$(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++), \
$(CXX) --version | grep g++, \
g++ --version | grep g++, \
g++49 --version | grep g++, \
Please install the GNU C++ Compiler (g++) 4.8 or later \
$(CXX) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
g++ -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \
g++48 --version | grep g++, \
g++47 --version | grep g++, \
g++46 --version | grep g++, \
g++49 --version | grep g++, \
g++5 --version | grep g++, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++ --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-g++, \
Please reinstall the GNU C++ Compiler - it appears to be broken, \
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
$(TMP_DIR)/a.out))

2
include/site/darwin Normal file
View File

@ -0,0 +1,2 @@
ac_cv_func_futimens=no
ac_cv_func_utimensat=no

26
include/site/powerpc64 Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
. $TOPDIR/include/site/linux
ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
ac_cv_sizeof_char=1
ac_cv_sizeof_char_p=8
ac_cv_sizeof_double=8
ac_cv_sizeof_float=4
ac_cv_sizeof_int=4
ac_cv_sizeof_long=8
ac_cv_sizeof_long_double=16
ac_cv_sizeof_long_int=8
ac_cv_sizeof_long_long=8
ac_cv_sizeof_long_long_int=8
ac_cv_sizeof_short=2
ac_cv_sizeof_short_int=2
ac_cv_sizeof_signed_char=1
ac_cv_sizeof_unsigned_char=1
ac_cv_sizeof_unsigned_int=4
ac_cv_sizeof_unsigned_long=8
ac_cv_sizeof_unsigned_long_int=8
ac_cv_sizeof_unsigned_long_long_int=8
ac_cv_sizeof_unsigned_short=2
ac_cv_sizeof_unsigned_short_int=2
ac_cv_sizeof_void_p=8

View File

@ -21,7 +21,7 @@ luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule l
# For nas targets
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
# For router targets
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall
DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c
DEFAULT_PACKAGES.bootloader:=
ifneq ($(DUMP),)
@ -190,7 +190,7 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7
CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 -mtune=cortex-a15
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
CPU_CFLAGS_fa526 = -mcpu=fa526
CPU_CFLAGS_mpcore = -mcpu=mpcore
@ -209,6 +209,10 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_440:=-mcpu=440
CPU_CFLAGS_464fp:=-mcpu=464fp
endif
ifeq ($(ARCH),powerpc64)
CPU_TYPE ?= powerpc64
CPU_CFLAGS_powerpc64:=-mcpu=powerpc64
endif
ifeq ($(ARCH),sparc)
CPU_TYPE = sparc
CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc

View File

@ -104,6 +104,9 @@ scripts/config/mconf:
$(eval $(call rdep,scripts/config,scripts/config/mconf))
scripts/config/qconf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)"
scripts/config/conf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
@ -136,6 +139,12 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE
[ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \
$< Config.in
xconfig: scripts/config/qconf prepare-tmpinfo FORCE
if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \
cp $(HOME)/.openwrt/defconfig .config; \
fi
$< Config.in
prepare_kernel_conf: .config FORCE
ifeq ($(wildcard staging_dir/host/bin/quilt),)

View File

@ -101,4 +101,4 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
-e 's,%P,$(VERSION_PRODUCT),g' \
-e 's,%h,$(VERSION_HWREV),g'
VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))
VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))

View File

@ -9,9 +9,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=174
PKG_RELEASE:=181
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
@ -21,7 +22,12 @@ PKG_LICENSE:=GPL-2.0
# Extend depends from version.mk
PKG_CONFIG_DEPENDS += \
CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \
CONFIG_NAND_SUPPORT
CONFIG_NAND_SUPPORT \
CONFIG_CLEAN_IPKG \
CONFIG_PER_FEED_REPO \
CONFIG_PER_FEED_REPO_ADD_DISABLED \
CONFIG_PER_FEED_REPO_ADD_COMMENTED \
$(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
include $(INCLUDE_DIR)/package.mk
@ -148,6 +154,7 @@ define Package/base-files/install
mkdir -p $(1)/CONTROL
mkdir -p $(1)/dev
mkdir -p $(1)/etc/config
mkdir -p $(1)/etc/crontabs
mkdir -p $(1)/etc/rc.d
mkdir -p $(1)/overlay
@ -183,6 +190,11 @@ define Package/base-files/install
$(if $(CONFIG_INCLUDE_CONFIG), \
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
$(VERSION_SED) $(1)/etc/opkg/distfeeds.conf)
endef
ifneq ($(DUMP),1)

View File

@ -119,17 +119,14 @@ generate_network() {
;;
pppoe)
# fixup IPv6 slave interface
ifname="pppoe-$1"
uci -q batch <<-EOF
set network.$1.proto='pppoe'
set network.$1.username='username'
set network.$1.password='password'
set network.$1.ipv6='auto'
set network.$1.ipv6='1'
delete network.${1}6
set network.${1}6='interface'
set network.${1}6.ifname='$ifname'
set network.${1}6.ifname='@${1}'
set network.${1}6.proto='dhcpv6'
EOF
;;

View File

@ -1,13 +0,0 @@
config global
option from_fstab '1'
option anon_swap '1'
option anon_mount '1'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

View File

@ -72,6 +72,7 @@ load_led() {
[ -n "$dev" ] && {
echo $dev > /sys/class/leds/${sysfs}/device_name
echo $mode > /sys/class/leds/${sysfs}/mode
echo $interval > /sys/class/leds/${sysfs}/interval
}
;;

View File

@ -1,6 +1,9 @@
#!/bin/sh
[ -e /tmp/.failsafe ] && export FAILSAFE=1
[ -f /etc/banner ] && cat /etc/banner
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
fgrep -sq '/ overlay ro,' /proc/mounts && {
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
echo 'Please try to remove files from /overlay/upper/... and reboot!'

View File

@ -41,14 +41,15 @@ disable() {
}
enable() {
err=1
name="$(basename "${initscript}")"
disable
[ -n "$START" -o -n "$STOP" ] || {
echo "/etc/init.d/$name does not have a START or STOP value"
return 1
}
[ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
[ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}"
[ "$START" ] && \
ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \
err=0
[ "$STOP" ] && \
ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \
err=0
return $err
}
enabled() {
@ -88,6 +89,10 @@ service_triggers() {
return 0
}
service_data() {
return 0
}
service_running() {
return 0
}
@ -122,12 +127,14 @@ ${INIT_TRACE:+set -x}
}
stop() {
procd_lock
stop_service "$@"
procd_kill "$(basename ${basescript:-$initscript})" "$1"
}
reload() {
if eval "type reload_service" 2>/dev/null >/dev/null; then
procd_lock
reload_service "$@"
else
start

View File

@ -1,5 +1,6 @@
kernel.panic=3
kernel.core_pattern=/tmp/%e.%t.%p.%s.core
fs.suid_dumpable=2
net.ipv4.conf.default.arp_ignore=1
net.ipv4.conf.all.arp_ignore=1

View File

@ -202,7 +202,7 @@ add_group_and_user() {
if [ -n "$gname" ] && [ -n "$gid" ]; then
group_exists "$gname" || group_add "$gname" "$gid"
elif [ -n "$gname" ]; then
group_add_next "$gname"; gid=$?
gid="$(group_add_next "$gname")"
fi
if [ -n "$uname" ]; then
@ -235,12 +235,16 @@ default_postinst() {
rm -fR $root/rootfs-overlay/
fi
if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then
kmodloader
fi
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do (
cd /etc/uci-defaults
[ -f "$i" ] && . "$i" && rm -f "$i"
[ -f "$i" ] && . ./"$i" && rm -f "$i"
) done
uci commit
fi
@ -292,9 +296,7 @@ group_add() {
[ -f "${IPKG_INSTROOT}/etc/group" ] || return 1
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/group
echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group
rc=$?
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group
return $rc
}
group_exists() {
@ -304,14 +306,17 @@ group_exists() {
group_add_next() {
local gid gids
gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
[ -n "$gid" ] && return $gid
if [ -n "$gid" ]; then
echo $gid
return
fi
gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3)
gid=65536
while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do
gid=$((gid + 1))
done
group_add $1 $gid
return $gid
echo $gid
}
group_add_user() {
@ -344,9 +349,7 @@ user_add() {
[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow
rc=$?
[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
return $rc
}
user_exists() {

View File

@ -1,6 +1,18 @@
#!/bin/sh
# Copyright (C) 2013 OpenWrt.org
get_dt_led() {
local label
local ledpath
local basepath="/proc/device-tree"
local nodepath="$basepath/aliases/led-$1"
[ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
[ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label")
echo "$label"
}
led_set_attr() {
[ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
}

View File

@ -117,24 +117,6 @@ export_bootdevice() {
esac
case "$disk" in
PARTUUID=[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]0002)
uuid="${disk#PARTUUID=}"
uuid="${uuid%0002}0002"
for disk in $(find /dev -type b); do
set -- $(dd if=$disk bs=1 skip=$((2*512+256+128+16)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \
for(i=1;i<9;i=i+2) first=substr($0,i,1) substr($0,i+1,1) first; \
for(i=9;i<13;i=i+2) second=substr($0,i,1) substr($0,i+1,1) second; \
for(i=13;i<16;i=i+2) third=substr($0,i,1) substr($0,i+1,1) third; \
fourth = substr($0,17,4); \
five = substr($0,21,12); \
} END { print toupper(first"-"second"-"third"-"fourth"-"five) }')
if [ "$1" = "$uuid" ]; then
uevent="/sys/class/block/${disk##*/}/uevent"
export SAVE_PARTITIONS=0
break
fi
done
;;
PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
uuid="${disk#PARTUUID=}"
uuid="${uuid%-02}"
@ -178,6 +160,14 @@ export_partdevice() {
return 1
}
hex_le32_to_cpu() {
[ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && {
echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}"
return
}
echo "$@"
}
get_partitions() { # <device> <filename>
local disk="$1"
local filename="$2"
@ -185,8 +175,8 @@ get_partitions() { # <device> <filename>
if [ -b "$disk" -o -f "$disk" ]; then
v "Reading partition table from $filename..."
local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")"
if [ "$magic" != 0xAA55 ]; then
local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null)
if [ "$magic" != $'\x55\xAA' ]; then
v "Invalid partition table on $disk"
exit
fi
@ -197,9 +187,9 @@ get_partitions() { # <device> <filename>
for part in 1 2 3 4; do
set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk")
local type="$(($1 % 256))"
local lba="$(($2))"
local num="$(($3))"
local type="$(( $(hex_le32_to_cpu $1) % 256))"
local lba="$(( $(hex_le32_to_cpu $2) ))"
local num="$(( $(hex_le32_to_cpu $3) ))"
[ $type -gt 0 ] || continue

View File

@ -239,30 +239,23 @@ nand_upgrade_ubifs() {
nand_do_upgrade_success
}
nand_board_name() {
if type 'platform_nand_board_name' >/dev/null 2>/dev/null; then
platform_nand_board_name
return
fi
cat /tmp/sysinfo/board_name
}
nand_upgrade_tar() {
local tar_file="$1"
local board_name="$(nand_board_name)"
local kernel_mtd="$(find_mtd_index $CI_KERNPART)"
local kernel_length=`(tar xf $tar_file sysupgrade-$board_name/kernel -O | wc -c) 2> /dev/null`
local rootfs_length=`(tar xf $tar_file sysupgrade-$board_name/root -O | wc -c) 2> /dev/null`
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}
local rootfs_type="$(identify_tar "$tar_file" sysupgrade-$board_name/root)"
local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null`
local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null`
local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)"
local has_kernel=1
local has_env=0
[ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && {
tar xf $tar_file sysupgrade-$board_name/kernel -O | mtd write - $CI_KERNPART
tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART
}
[ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0
@ -271,12 +264,12 @@ nand_upgrade_tar() {
local ubidev="$( nand_find_ubi "$CI_UBIPART" )"
[ "$has_kernel" = "1" ] && {
local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)"
tar xf $tar_file sysupgrade-$board_name/kernel -O | \
tar xf $tar_file ${board_dir}/kernel -O | \
ubiupdatevol /dev/$kern_ubivol -s $kernel_length -
}
local root_ubivol="$(nand_find_volume $ubidev rootfs)"
tar xf $tar_file sysupgrade-$board_name/root -O | \
tar xf $tar_file ${board_dir}/root -O | \
ubiupdatevol /dev/$root_ubivol -s $rootfs_length -
nand_do_upgrade_success

View File

@ -84,6 +84,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
local loop="${2:-0}"
local run=true
local stat
local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat)
echo -n "Sending $sig to remaining processes ... "
@ -96,8 +97,8 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
read pid name state ppid rest < $stat
name="${name#(}"; name="${name%)}"
# Skip PID1, ourself and our children
[ $pid -ne 1 -a $pid -ne $$ -a $ppid -ne $$ ] || continue
# Skip PID1, our parent, ourself and our children
[ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue
local cmdline
read cmdline < /proc/$pid/cmdline

View File

@ -108,14 +108,8 @@ add_uci_conffiles() {
add_overlayfiles() {
local file="$1"
if [ -d /overlay/upper ]; then
local overlaydir="/overlay/upper"
else
local overlaydir="/overlay"
fi
find $overlaydir/etc/ -type f -o -type l | sed \
find /overlay/upper/etc/ -type f -o -type l | sed \
-e 's,^/overlay\/upper/,/,' \
-e 's,^/overlay/,/,' \
-e '\,/META_[a-zA-Z0-9]*$,d' \
-e '\,/functions.sh$,d' \
-e '\,/[^/]*-opkg$,d' \
@ -126,9 +120,16 @@ add_overlayfiles() {
# hooks
sysupgrade_image_check="fwtool_check_image platform_check_image"
sysupgrade_pre_upgrade="fwtool_pre_upgrade"
[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \
sysupgrade_init_conffiles="add_uci_conffiles" || \
if [ $SAVE_OVERLAY = 1 ]; then
[ ! -d /overlay/upper/etc ] && {
echo "Cannot find '/overlay/upper/etc', required for '-c'"
exit 1
}
sysupgrade_init_conffiles="add_overlayfiles"
else
sysupgrade_init_conffiles="add_uci_conffiles"
fi
include /lib/upgrade
@ -152,7 +153,7 @@ do_save_conffiles() {
}
if [ $CONF_BACKUP_LIST -eq 1 ]; then
add_uci_conffiles "$CONFFILES"
run_hooks "$CONFFILES" $sysupgrade_init_conffiles
cat "$CONFFILES"
rm -f "$CONFFILES"
exit 0

View File

@ -1,8 +1,8 @@
NAME="%D"
VERSION="%V, %N"
VERSION="%V"
ID="%d"
ID_LIKE="lede openwrt"
PRETTY_NAME="%D %N %V"
PRETTY_NAME="%D %V"
VERSION_ID="%v"
HOME_URL="%m"
BUG_URL="%b"
@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M"
LEDE_DEVICE_MANUFACTURER_URL="%m"
LEDE_DEVICE_PRODUCT="%P"
LEDE_DEVICE_REVISION="%h"
LEDE_RELEASE="%D %N %V %C"
LEDE_RELEASE="%D %V %C"

View File

@ -163,13 +163,6 @@ if VERSIONOPT
This is the name of the release distribution.
If unspecified, it defaults to OpenWrt.
config VERSION_NICK
string
prompt "Release version nickname"
help
This is the release codename embedded in the image.
If unspecified, it defaults to the name of source branch.
config VERSION_NUMBER
string
prompt "Release version number"

View File

@ -0,0 +1,52 @@
#
# Copyright (C) 2017 Hauke Mehrtens
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=arm-trusted-firmware-sunxi
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware
PKG_SOURCE_DATE:=2016-07-12
PKG_SOURCE_VERSION:=87e8aedd80e6448a55b2328768d956fcb5f5d410
PKG_MIRROR_HASH:=4e71a7d4bc0613533854c646b0fa574b18503c0ab28621aac67c70b9827562d8
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=license.md
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
include $(INCLUDE_DIR)/package.mk
define Package/arm-trusted-firmware-sunxi
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:=ARM Trusted Firmware for Allwinner
DEPENDS:=@TARGET_sunxi_cortexa53
endef
export GCC_HONOUR_COPTS=s
MAKE_VARS = \
CROSS_COMPILE="$(TARGET_CROSS)"
MAKE_FLAGS += \
PLAT=sun50iw1p1 \
DEBUG=1 \
bl31
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/debug/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin
endef
define Package/arm-trusted-firmware-sunxi/install
endef
$(eval $(call BuildPackage,arm-trusted-firmware-sunxi))

View File

@ -0,0 +1,94 @@
#
# Copyright (C) 2016 Microchip Technology Inc.
# <Sandeepsheriker.mallikarjun@microchip.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=at91bootstrap
PKG_VERSION:=v3.8.8
PKG_RELEASE:=
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git
PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db
PKG_BUILD_DIR = \
$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include at91bootstrap.mk
include $(INCLUDE_DIR)/package.mk
define AT91Bootstrap/Default
BUILD_TARGET:=at91
BUILD_SUBTARGET:=sama5
AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
endef
define at91bootstrap/sama5d2_xplaineddf_uboot
TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define at91bootstrap/sama5d2_xplaineddf_qspi_uboot
TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define at91bootstrap/sama5d2_xplainedsd_uboot
TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define at91bootstrap/sama5d3_xplainednf_uboot
TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define at91bootstrap/sama5d3_xplainedsd_uboot
TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define at91bootstrap/sama5d4_xplainednf_uboot
TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define at91bootstrap/sama5d4_xplaineddf_uboot_secure
TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define at91bootstrap/sama5d4_xplainedsd_uboot_secure
TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
AT91BOOTSTRAP_TARGETS := \
sama5d2_xplaineddf_uboot \
sama5d2_xplaineddf_qspi_uboot \
sama5d2_xplainedsd_uboot \
sama5d3_xplainednf_uboot \
sama5d3_xplainedsd_uboot \
sama5d4_xplainednf_uboot_secure \
sama5d4_xplaineddf_uboot_secure \
sama5d4_xplainedsd_uboot_secure
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS)
endef
$(eval $(call BuildPackage/AT91Bootstrap))

View File

@ -0,0 +1,88 @@
PKG_TARGETS := bin
PKG_FLAGS:=nonshared
export GCC_HONOUR_COPTS=s
define Package/at91bootstrap/install/default
$(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/
endef
Package/at91bootstrap/install = $(Package/at91bootstrap/install/default)
define AT91Bootstrap/Init
BUILD_TARGET:=
BUILD_SUBTARGET:=
BUILD_DEVICES:=
NAME:=
DEPENDS:=
HIDDEN:=
DEFAULT:=
VARIANT:=$(1)
AT91BOOTSTRAP_CONFIG:=$(1)
endef
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
AT91BOOTSTRAP_MAKE_FLAGS = \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \
HOSTLDFLAGS=""
define Build/AT91Bootstrap/Target
$(eval $(call AT91Bootstrap/Init,$(1)))
$(eval $(call AT91Bootstrap/Default,$(1)))
$(eval $(call AT91Bootstrap/$(1),$(1)))
define Package/at91bootstrap-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:= .$(NAME)
VARIANT:=$(VARIANT)
DEPENDS:=@!IN_SDK $(DEPENDS)
HIDDEN:=$(HIDDEN)
ifneq ($(BUILD_TARGET),)
DEPENDS += @$(TARGET_DEP)
ifneq ($(BUILD_DEVICES),)
DEFAULT := y if ($(TARGET_DEP)_Default \
$(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
$(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \
$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
endif
endif
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
endef
define Package/at91bootstrap-$(1)/install
$$(Package/at91bootstrap/install)
endef
endef
define Build/Configure/AT91Bootstrap
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(AT91BOOTSTRAP_CONFIG)_defconfig
endef
define Build/Compile/AT91Bootstrap
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) \
$(AT91BOOTSTRAP_MAKE_FLAGS)
endef
define BuildPackage/AT91Bootstrap/Defaults
Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap)
Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap)
endef
define BuildPackage/AT91Bootstrap
$(eval $(call BuildPackage/AT91Bootstrap/Defaults))
$(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
$(eval $(call Build/AT91Bootstrap/Target,$(type)))
)
$(eval $(call Build/DefaultTargets))
$(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \
$(call BuildPackage,at91bootstrap-$(type))
)
endef

View File

@ -1,24 +1,34 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub
PKG_CPE_ID:=cpe:/a:gnu:grub2
PKG_VERSION:=2.02
PKG_RELEASE:=1
PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/grub
PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f
PKG_FIXUP:=autoreconf
HOST_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=grub2/host
PKG_SSP:=0
PKG_FLAGS:=nonshared
PATCH_DIR := ../patches
HOST_PATCH_DIR := ../patches
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/grub2/Default
define Package/grub2
CATEGORY:=Boot Loaders
SECTION:=boot
TITLE:=GRand Unified Bootloader
@ -26,6 +36,19 @@ define Package/grub2/Default
DEPENDS:=@TARGET_x86||TARGET_x86_64
endef
define Package/grub2-editenv
CATEGORY:=Utilities
SECTION:=utils
SUBMENU:=Boot Loaders
TITLE:=Grub2 Environment editor
URL:=http://www.gnu.org/software/grub/
DEPENDS:=@TARGET_x86||TARGET_x86_64
endef
define Package/grub2-editenv/description
Edit grub2 environment files.
endef
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
CONFIGURE_VARS += \
@ -59,3 +82,11 @@ define Host/Configure
$(Host/Configure/Default)
endef
define Package/grub2-editenv/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,grub2))
$(eval $(call BuildPackage,grub2-editenv))

View File

@ -1,22 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub-efi
include ../common.mk
TAR_OPTIONS:= --transform 's/grub-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}/' $(TAR_OPTIONS)
PKG_BUILD_DEPENDS:=grub2-efi/host
CONFIGURE_ARGS += --with-platform=efi
HOST_CONFIGURE_ARGS += --with-platform=efi --program-suffix=-efi
define Package/grub2-efi
$(call Package/grub2/Default)
HIDDEN:=1
TITLE += (with EFI support)
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,grub2-efi))

View File

@ -1,33 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub
include ../common.mk
PKG_BUILD_DEPENDS:=grub2/host
define Package/grub2
$(call Package/grub2/Default)
endef
define Package/grub2-editenv
CATEGORY:=Utilities
SECTION:=utils
TITLE:=Grub2 Environment editor
URL:=http://www.gnu.org/software/grub/
DEPENDS:=@TARGET_x86||TARGET_x86_64
endef
define Package/grub2-editenv/description
Edit grub2 environment files.
endef
define Package/grub2-editenv/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,grub2))
$(eval $(call BuildPackage,grub2-editenv))

View File

@ -10,13 +10,14 @@
#include <errno.h>
--- a/src/mtd.h
+++ b/src/mtd.h
@@ -25,8 +25,10 @@
@@ -25,8 +25,11 @@
#ifndef MTD_H
#define MTD_H
+#define _GNU_SOURCE
#include <mtd/mtd-user.h>
#include <endian.h>
+#include <stdint.h>
+#include <fcntl.h>
#include "BootControlBlocks.h"

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rbcfg
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -2,6 +2,7 @@
* RouterBOOT configuration utility
*
* Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2017 Thibaut VARENE <varenet@parisc-linux.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
@ -29,6 +30,7 @@
#define RB_ERR_INVALID 2
#define RB_ERR_NOMEM 3
#define RB_ERR_IO 4
#define RB_ERR_NOTWANTED 5
#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
@ -67,6 +69,11 @@ struct rbcfg_command {
int (*exec)(int argc, const char *argv[]);
};
struct rbcfg_soc {
const char *needle;
const int type;
};
static void usage(void);
/* Globals */
@ -135,12 +142,32 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = {
RB_CPU_MODE_REGULAR),
};
static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = {
};
static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = {
CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
};
static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = {
CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3),
};
static const struct rbcfg_value rbcfg_booter[] = {
CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR),
CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP),
};
static const struct rbcfg_env rbcfg_envs[] = {
static struct rbcfg_env rbcfg_envs[] = {
{
.name = "boot_delay",
.id = RB_ID_BOOT_DELAY,
@ -177,6 +204,12 @@ static const struct rbcfg_env rbcfg_envs[] = {
.type = RBCFG_ENV_TYPE_U32,
.values = rbcfg_cpu_mode,
.num_values = ARRAY_SIZE(rbcfg_cpu_mode),
}, {
.name = "cpu_freq",
.id = RB_ID_CPU_FREQ,
.type = RBCFG_ENV_TYPE_U32,
.values = rbcfg_cpu_freq_dummy,
.num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy),
}, {
.name = "uart_speed",
.id = RB_ID_UART_SPEED,
@ -240,8 +273,10 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
buf += 2;
buflen -= 2;
if (id == RB_ID_TERMINATOR)
if (id == RB_ID_TERMINATOR) {
ret = RB_ERR_NOTWANTED;
break;
}
if (buflen < len)
break;
@ -257,7 +292,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
buflen -= len;
}
if (ret)
if (RB_ERR_NOTFOUND == ret)
fprintf(stderr, "no tag found with id=%u\n", tag_id);
return ret;
@ -748,6 +783,96 @@ usage(void)
fprintf(stderr, "\n");
}
#define RBCFG_SOC_UNKNOWN 0
#define RBCFG_SOC_QCA953X 1
#define RBCFG_SOC_AR9344 2
static const struct rbcfg_soc rbcfg_socs[] = {
{
.needle = "QCA953",
.type = RBCFG_SOC_QCA953X,
}, {
.needle = "AR9344",
.type = RBCFG_SOC_AR9344,
},
};
#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */
static int cpuinfo_find_soc(void)
{
FILE *fp;
char temp[CPUINFO_BUFSIZE];
char *haystack, *needle;
int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN;
fp = fopen("/proc/cpuinfo", "r");
if (!fp)
goto end;
/* first, extract the system type line */
needle = "system type";
while(fgets(temp, CPUINFO_BUFSIZE, fp)) {
if (!strncmp(temp, needle, strlen(needle))) {
found = 1;
break;
}
}
fclose(fp);
/* failsafe in case cpuinfo format changes */
if (!found)
goto end;
/* skip the field header */
haystack = strchr(temp, ':');
/* then, try to identify known SoC, stop at first match */
for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) {
if ((strstr(haystack, rbcfg_socs[i].needle))) {
soc_type = rbcfg_socs[i].type;
break;
}
}
end:
return soc_type;
}
static void fixup_rbcfg_envs(void)
{
int i, num_val, soc_type;
const struct rbcfg_value * env_value;
/* detect SoC */
soc_type = cpuinfo_find_soc();
/* update rbcfg_envs */
switch (soc_type) {
case RBCFG_SOC_QCA953X:
env_value = rbcfg_cpu_freq_qca953x;
num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x);
break;
case RBCFG_SOC_AR9344:
env_value = rbcfg_cpu_freq_ar9344;
num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344);
break;
}
for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) {
if (RBCFG_SOC_UNKNOWN == soc_type)
rbcfg_envs[i].id = RB_ID_TERMINATOR;
else {
rbcfg_envs[i].values = env_value;
rbcfg_envs[i].num_values = num_val;
}
break;
}
}
}
int main(int argc, const char *argv[])
{
const struct rbcfg_command *cmd = NULL;
@ -756,6 +881,8 @@ int main(int argc, const char *argv[])
rbcfg_name = (char *) argv[0];
fixup_rbcfg_envs();
if (argc < 2) {
usage();
return EXIT_FAILURE;

View File

@ -32,6 +32,7 @@
#define RB_ID_BOOT_PROTOCOL 9
#define RB_ID_SOFT_10 10
#define RB_ID_SOFT_11 11
#define RB_ID_CPU_FREQ 12
#define RB_ID_BOOTER 13
#define RB_UART_SPEED_115200 0
@ -71,6 +72,13 @@
#define RB_BOOT_PROTOCOL_BOOTP 0
#define RB_BOOT_PROTOCOL_DHCP 1
#define RB_CPU_FREQ_L2 (0 << 3)
#define RB_CPU_FREQ_L1 (1 << 3)
#define RB_CPU_FREQ_N0 (2 << 3)
#define RB_CPU_FREQ_H1 (3 << 3)
#define RB_CPU_FREQ_H2 (4 << 3)
#define RB_CPU_FREQ_H3 (5 << 3)
#define RB_BOOTER_REGULAR 0
#define RB_BOOTER_BACKUP 1

View File

@ -17,21 +17,73 @@ include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=at91
BUILD_SUBTARGET:=legacy
UBOOT_IMAGE:=u-boot.bin boot.bin
endef
define U-Boot/at91sam9m10g45ek_nandflash
NAME:=AT91SAM9M10G45-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9m10g45ek
endef
define U-Boot/at91sam9x5ek_nandflash
NAME:=AT91SAM9X5-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek
endef
define U-Boot/sama5d3_xplained_nandflash
NAME:=SAMA5D3 Xplained board (NandFlash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define U-Boot/sama5d3_xplained_mmc
NAME:=SAMA5D3 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define U-Boot/sama5d2_xplained_spiflash
NAME:=SAMA5D2 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define U-Boot/sama5d2_xplained_mmc
NAME:=SAMA5D2 Xplained board (SDcard/EMMC)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define U-Boot/sama5d4_xplained_spiflash
NAME:=SAMA5D4 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define U-Boot/sama5d4_xplained_mmc
NAME:=SAMA5D4 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define U-Boot/sama5d4_xplained_nandflash
NAME:=SAMA5D4 Xplained board (NandFlash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
UBOOT_TARGETS := \
at91sam9m10g45ek_nandflash \
at91sam9x5ek_nandflash
at91sam9x5ek_nandflash \
sama5d3_xplained_nandflash \
sama5d3_xplained_mmc \
sama5d2_xplained_mmc \
sama5d2_xplained_spiflash \
sama5d4_xplained_mmc \
sama5d4_xplained_spiflash \
sama5d4_xplained_nandflash
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \

View File

@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
PKG_BUILD_DEPENDS:=+fstools
PKG_BUILD_DEPENDS:=fstools
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README

View File

@ -66,6 +66,7 @@ dap-2695-a1|\
wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
;;
dr342|\
dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
;;
@ -76,6 +77,9 @@ rambutan)
qihoo-c301)
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
;;
wi2a-ac200i)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000"
;;
esac
config_load ubootenv

View File

@ -13,19 +13,19 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
BTHOMEHUBV2B)
bt,homehub-v2b)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
;;
BTHOMEHUBV3A)
bt,homehub-v3a)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1"
;;
GIGASX76X)
siemens,gigaset-sx76x)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
;;
P2812HNUF1)
zyxel,p-2812hnu-f1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
;;
WBMR300)
buffalo,wbmr-300hpd)
idx="$(find_mtd_index ubootconfig)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2"

View File

@ -20,7 +20,6 @@ all5002)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
linkits7688|\
linkits7688d|\
miwifi-nano|\
sk-wb8|\
wsr-1166|\
@ -28,6 +27,9 @@ wsr-600|\
zbt-wg2626)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
mir3g)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;;
esac
config_load ubootenv

View File

@ -7,10 +7,10 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=2017.03
PKG_VERSION:=2017.09
PKG_RELEASE:=1
PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f
PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk

View File

@ -27,23 +27,23 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 9205b1e..819bd3b 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME
@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME
config TARGET_NAS220
bool "BlackArmor NAS220"
bool "BlackArmor NAS220"
+config TARGET_NSA310
+ bool "Zyxel NSA310 Board"
+
config TARGET_NSA310S
bool "Zyxel NSA310S"
@@ -77,6 +80,7 @@ source "board/raidsonic/ib62x0/Kconfig"
bool "Zyxel NSA310S"
@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig"
source "board/Seagate/dockstar/Kconfig"
source "board/Seagate/goflexhome/Kconfig"
source "board/Seagate/nas220/Kconfig"
+source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
endif
diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig
new file mode 100644
@ -528,7 +528,7 @@ new file mode 100644
index 0000000..d26ef35
--- /dev/null
+++ b/configs/nsa310_defconfig
@@ -0,0 +1,22 @@
@@ -0,0 +1,34 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_TARGET_NSA310=y
@ -544,19 +544,31 @@ index 0000000..d26ef35
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DATE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_CMD_UBI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h
new file mode 100644
index 0000000..86ef825
--- /dev/null
+++ b/include/configs/nsa310.h
@@ -0,0 +1,144 @@
@@ -0,0 +1,126 @@
+/* Copyright (C) 2015-2016 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
@ -594,7 +606,7 @@ index 0000000..86ef825
+ */
+#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
+#define CONFIG_KW88F6281 /* SOC Name */
+#define CONFIG_MACH_NSA310 /* Machine type */
+
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+
+/*
@ -605,14 +617,8 @@ index 0000000..86ef825
+/*
+ * Commands configuration
+ */
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
@ -624,10 +630,7 @@ index 0000000..86ef825
+ * Environment variables configurations
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_ENV_IS_IN_NAND 1
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
+#else
+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */
+#endif
+
+/* max 4k env size is enough, but in case of nand
@ -665,7 +668,6 @@ index 0000000..86ef825
+#define CONFIG_NET_MULTI
+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
+#define CONFIG_PHY_BASE_ADR 0x1
+#define CONFIG_PHY_GIGE
+#define CONFIG_RESET_PHY_R
+#endif /* CONFIG_CMD_NET */
+
@ -680,24 +682,16 @@ index 0000000..86ef825
+/*
+ * File system
+ */
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_JFFS2
+#define CONFIG_JFFS2_NAND
+#define CONFIG_JFFS2_LZO
+#define CONFIG_CMD_UBIFS
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_LZO
+
+/*
+ * Date Time
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MV
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_DNS
+#endif /* CONFIG_CMD_DATE */
+
+#endif /* _CONFIG_NSA310_H */

View File

@ -2,22 +2,22 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 819bd3b..6a2d578 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -59,6 +59,9 @@ config TARGET_NSA310
@@ -62,6 +62,9 @@ config TARGET_NSA310
config TARGET_NSA310S
bool "Zyxel NSA310S"
bool "Zyxel NSA310S"
+config TARGET_NSA325
+ bool "Zyxel NSA325 board"
+
endchoice
config SYS_SOC
@@ -82,5 +85,6 @@ source "board/Seagate/goflexhome/Kconfig"
@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig
source "board/Seagate/nas220/Kconfig"
source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
+source "board/zyxel/nsa325/Kconfig"
endif
diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig
new file mode 100644
@ -511,7 +511,7 @@ new file mode 100644
index 0000000..48e09cc
--- /dev/null
+++ b/configs/nsa325_defconfig
@@ -0,0 +1,22 @@
@@ -0,0 +1,34 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_TARGET_NSA325=y
@ -527,19 +527,31 @@ index 0000000..48e09cc
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_CMD_DATE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_CMD_UBI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h
new file mode 100644
index 0000000..e5a8e2a
--- /dev/null
+++ b/include/configs/nsa325.h
@@ -0,0 +1,148 @@
@@ -0,0 +1,129 @@
+/*
+ * (C) Copyright 2016 bodhi <mibodhi@gmail.com>
+ *
@ -579,7 +591,6 @@ index 0000000..e5a8e2a
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */
+#define CONFIG_KIRKWOOD 1 /* SOC Family Name */
+#define CONFIG_KW88F6281 1 /* SOC Name */
+
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
@ -592,14 +603,8 @@ index 0000000..e5a8e2a
+/*
+ * Commands configuration
+ */
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
@ -611,10 +616,7 @@ index 0000000..e5a8e2a
+ * Environment variables configurations
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_ENV_IS_IN_NAND 1
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
+#else
+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */
+#endif
+/*
+ * max 4k env size is enough, but in case of nand
@ -650,7 +652,6 @@ index 0000000..e5a8e2a
+#ifdef CONFIG_CMD_NET
+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
+#define CONFIG_PHY_BASE_ADR 0x1
+#define CONFIG_PHY_GIGE
+#define CONFIG_NETCONSOLE
+#endif /* CONFIG_CMD_NET */
+
@ -665,24 +666,16 @@ index 0000000..e5a8e2a
+/*
+ * File system
+ */
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_JFFS2
+#define CONFIG_JFFS2_NAND
+#define CONFIG_JFFS2_LZO
+#define CONFIG_CMD_UBIFS
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_LZO
+
+/*
+ * Date Time
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MV
+#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_DNS
+#endif /* CONFIG_CMD_DATE */
+
+#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */

View File

@ -7,8 +7,8 @@
+#define CONFIG_SYS_MVFS
/*
* Commands configuration
@@ -45,29 +46,29 @@
* mv-common.h should be defined after CMD configs since it used them
@@ -37,29 +38,29 @@
* it has to be rounded to sector size
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */

View File

@ -1,7 +1,7 @@
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -51,30 +51,29 @@
#define CONFIG_ENV_IS_NOWHERE
@@ -44,30 +44,29 @@
#define CONFIG_ENV_SECT_SIZE 0x20000
#endif
#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_ENV_OFFSET 0x80000
@ -42,8 +42,8 @@
* Ethernet driver configuration
--- a/configs/iconnect_defconfig
+++ b/configs/iconnect_defconfig
@@ -9,6 +9,7 @@ CONFIG_SYS_PROMPT="iconnect => "
# CONFIG_CMD_FLASH is not set
@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => "
CONFIG_CMD_NAND=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y

View File

@ -1,6 +1,6 @@
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -54,27 +54,22 @@
@@ -49,27 +49,22 @@
*/
#define CONFIG_BOOTCOMMAND \
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \

View File

@ -1,6 +1,6 @@
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -49,23 +49,30 @@
@@ -44,23 +44,30 @@
#endif
#define CONFIG_ENV_SIZE 0x20000 /* 128k */

View File

@ -1,16 +1,15 @@
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -77,20 +77,18 @@
@@ -70,20 +70,18 @@
*/
#define CONFIG_BOOTCOMMAND \
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
- "ubi part root; " \
- "ubifsmount ubi:root; " \
- "ubifsload 0x800000 ${kernel}; " \
- "bootm 0x800000"
+ "ubi part ubi; " \
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
"bootm 0x800000"
#define CONFIG_MTDPARTS \
- "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0"

View File

@ -1,43 +1,43 @@
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -87,4 +87,7 @@ source "board/Seagate/nas220/Kconfig"
@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
source "board/zyxel/nsa325/Kconfig"
+config SECOND_STAGE
+ bool "OpenWrt second stage hack"
+
endif
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -89,4 +89,6 @@
#define CONFIG_CMD_MTDPARTS
#define CONFIG_LZO
@@ -76,4 +76,6 @@
#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_DOCKSTAR_H */
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -99,4 +99,6 @@
@@ -94,4 +94,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_IB62x0_H */
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -94,4 +94,6 @@
@@ -83,4 +83,6 @@
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
#define CONFIG_CMD_MTDPARTS
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_ICONNECT_H */
--- /dev/null
+++ b/include/configs/openwrt-kirkwood-common.h
@@ -0,0 +1,40 @@
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2013 Luka Perkov <luka@openwrt.org>
+ *
@ -47,9 +47,6 @@
+#ifndef __OPENWRT_KIRKWOOD_COMMON_H
+#define __OPENWRT_KIRKWOOD_COMMON_H
+
+/* Commands */
+#define CONFIG_CMD_BOOTZ
+
+/* Ethernet */
+#if defined(CONFIG_CMD_NET)
+#define CONFIG_SERVERIP 192.168.1.2
@ -63,14 +60,8 @@
+#define CONFIG_ENV_IS_NOWHERE
+#endif
+
+/* Flattened uImage Tree */
+#define CONFIG_FIT 1
+#define CONFIG_FIT_VERBOSE 1
+
+/* Various */
+#define CONFIG_BZIP2
+#define CONFIG_LZMA
+#define CONFIG_LZO
+
+/* Unnecessary */
+#undef CONFIG_BOOTM_NETBSD
@ -80,37 +71,119 @@
+#endif /* __OPENWRT_KIRKWOOD_COMMON_H */
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -93,4 +93,6 @@
#define CONFIG_CMD_MTDPARTS
#define CONFIG_LZO
@@ -83,4 +83,6 @@
#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_POGO_E02_H */
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -99,4 +99,6 @@
@@ -96,4 +96,6 @@
#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
#endif /* CONFIG_CMD_IDE */
#endif /* CONFIG_IDE */
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_SHEEVAPLUG_H */
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -112,4 +112,6 @@
@@ -105,4 +105,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_GOFLEXHOME_H */
--- a/include/configs/nsa310.h
+++ b/include/configs/nsa310.h
@@ -141,4 +141,6 @@
#define CONFIG_CMD_DNS
@@ -123,4 +123,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_NSA310_H */
--- a/configs/dockstar_defconfig
+++ b/configs/dockstar_defconfig
@@ -25,3 +25,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/goflexhome_defconfig
+++ b/configs/goflexhome_defconfig
@@ -29,3 +29,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
-CONFIG_LZMA=y
CONFIG_OF_LIBFDT=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/iconnect_defconfig
+++ b/configs/iconnect_defconfig
@@ -24,5 +24,9 @@ CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
-CONFIG_LZMA=y
CONFIG_OF_LIBFDT=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/nsa310_defconfig
+++ b/configs/nsa310_defconfig
@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
CONFIG_LZMA=y
CONFIG_LZO=y
--- a/configs/pogo_e02_defconfig
+++ b/configs/pogo_e02_defconfig
@@ -25,3 +25,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/sheevaplug_defconfig
+++ b/configs/sheevaplug_defconfig
@@ -28,5 +28,8 @@ CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
-CONFIG_LZMA=y
CONFIG_OF_LIBFDT=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y

View File

@ -26,205 +26,205 @@ endef
define U-Boot/arv4519pw_ram
NAME:=Arcadyan arv4519pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4519PW
BUILD_DEVICES:=arcadyan_arv4519pw
DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
endef
define U-Boot/arv4519pw_nor
NAME:=Arcadyan arv4519pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4519PW
BUILD_DEVICES:=arcadyan_arv4519pw
endef
define U-Boot/arv4519pw_brn
NAME:=Arcadyan arv4519pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4519PW
BUILD_DEVICES:=arcadyan_arv4519pw
endef
define U-Boot/arv7506pw11_ram
NAME:=Arcadyan ARV7506PW11 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7506PW11
BUILD_DEVICES:=arcadyan_arv7506pw11
DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h
endef
define U-Boot/arv7506pw11_nor
NAME:=Arcadyan ARV7506PW11 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7506PW11
BUILD_DEVICES:=arcadyan_arv7506pw11
endef
define U-Boot/arv7506pw11_brn
NAME:=Arcadyan ARV7506PW11 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7506PW11
BUILD_DEVICES:=arcadyan_arv7506pw11
endef
define U-Boot/arv7510pw_ram
NAME:=Arcadyan arv7510pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4510PW
BUILD_DEVICES:=arcadyan_arv4510pw
DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
endef
define U-Boot/arv7510pw_nor
NAME:=Arcadyan arv7510pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4510PW
BUILD_DEVICES:=arcadyan_arv4510pw
endef
define U-Boot/arv7510pw_brn
NAME:=Arcadyan arv7510pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV4510PW
BUILD_DEVICES:=arcadyan_arv4510pw
endef
define U-Boot/arv7510pw22_ram
NAME:=Arcadyan arv7510pw22 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7510PW22
BUILD_DEVICES:=arcadyan_arv7510pw22
DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
endef
define U-Boot/arv7510pw22_nor
NAME:=Arcadyan arv7510pw22 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7510PW22
BUILD_DEVICES:=arcadyan_arv7510pw22
endef
define U-Boot/arv7510pw22_brn
NAME:=Arcadyan arv7510pw22 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7510PW22
BUILD_DEVICES:=arcadyan_arv7510pw22
endef
define U-Boot/arv7518pw_ram
NAME:=Arcadyan arv7518pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7518PW
BUILD_DEVICES:=arcadyan_arv7518pw
DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
endef
define U-Boot/arv7518pw_nor
NAME:=Arcadyan arv7518pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7518PW
BUILD_DEVICES:=arcadyan_arv7518pw
endef
define U-Boot/arv7518pw_brn
NAME:=Arcadyan arv7518pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV7518PW
BUILD_DEVICES:=arcadyan_arv7518pw
endef
define U-Boot/arv752dpw_ram
NAME:=Arcadyan arv752dpw (RAM)
BUILD_SUBTARGET:=xway
DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
BUILD_DEVICES:=ARV752DPW
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define U-Boot/arv752dpw_nor
NAME:=Arcadyan arv752dpw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV752DPW
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define U-Boot/arv752dpw_brn
NAME:=Arcadyan arv752dpw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV752DPW
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define U-Boot/arv752dpw22_ram
NAME:=Arcadyan arv752dpw22 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV752DPW22
BUILD_DEVICES:=arcadyan_arv752dpw22
DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
endef
define U-Boot/arv752dpw22_nor
NAME:=Arcadyan arv752dpw22 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV752DPW22
BUILD_DEVICES:=arcadyan_arv752dpw22
endef
define U-Boot/arv752dpw22_brn
NAME:=Arcadyan arv752dpw22 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV752DPW22
BUILD_DEVICES:=arcadyan_arv752dpw22
endef
define U-Boot/arv8539pw22_ram
NAME:=Speedport W 504V Typ A (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV8539PW22
BUILD_DEVICES:=arcadyan_arv8539pw22
DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
endef
define U-Boot/arv8539pw22_nor
NAME:=Speedport W 504V Typ A (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV8539PW22
BUILD_DEVICES:=arcadyan_arv8539pw22
endef
define U-Boot/arv8539pw22_brn
NAME:=Speedport W 504V Typ A (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ARV8539PW22
BUILD_DEVICES:=arcadyan_arv8539pw22
endef
define U-Boot/gigasx76x_ram
NAME:=Siemens Gigaset sx76x (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=GIGASX76X
BUILD_DEVICES:=siemens_gigaset-sx76x
DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
endef
define U-Boot/gigasx76x_nor
NAME:=Siemens Gigaset sx76x (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=GIGASX76X
BUILD_DEVICES:=siemens_gigaset-sx76x
endef
define U-Boot/acmp252_ram
NAME:=AudioCodes MP-252 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ACMP252
BUILD_DEVICES:=audiocodes_mp-252
DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
endef
define U-Boot/acmp252_nor
NAME:=AudioCodes MP-252 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=ACMP252
BUILD_DEVICES:=audiocodes_mp-252
endef
define U-Boot/bthomehubv5a_ram
NAME:=BT Home Hub 5A (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=BTHOMEHUBV5A
BUILD_DEVICES:=bt_homehub-v5a
DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h
endef
define U-Boot/easy50712_ram
NAME:=Lantiq EASY50712 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=EASY50712
BUILD_DEVICES:=lantiq_easy50712
DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
endef
define U-Boot/easy50712_nor
NAME:=Lantiq EASY50712 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=EASY50712
BUILD_DEVICES:=lantiq_easy50712
endef
define U-Boot/easy50712_norspl
NAME:=Lantiq EASY50712 (NOR SPL)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=EASY50712
BUILD_DEVICES:=lantiq_easy50712
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
DEPENDS+=@BROKEN
endef
@ -232,20 +232,20 @@ endef
define U-Boot/easy80920_ram
NAME:=Lantiq EASY80920 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=EASY80920NOR EASY80920NAND
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
endef
define U-Boot/easy80920_nor
NAME:=Lantiq EASY80920 (NOR)
BUILD_DEVICES:=EASY80920NOR EASY80920NAND
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
BUILD_SUBTARGET:=xrx200
endef
define U-Boot/easy80920_norspl
NAME:=Lantiq EASY80920 (NOR SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=EASY80920NOR EASY80920NAND
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
DEPENDS+=@BROKEN
endef
@ -253,7 +253,7 @@ endef
define U-Boot/easy80920_sfspl
NAME:=Lantiq EASY80920 (SPI SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=EASY80920NOR EASY80920NAND
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
DEPENDS+=@BROKEN
endef
@ -261,20 +261,20 @@ endef
define U-Boot/fb3370_eva
NAME:=AVM FRITZ3370 (EVA)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=FRITZ3370
BUILD_DEVICES:=avm_fritz3370
endef
define U-Boot/fb3370_ram
NAME:=AVM FRITZ3370 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=FRITZ3370
BUILD_DEVICES:=avm_fritz3370
DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
endef
define U-Boot/fb3370_sfspl
NAME:=AVM FRITZ3370 (SPI SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=FRITZ3370
BUILD_DEVICES:=avm_fritz3370
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
DEPENDS+=@BROKEN
endef
@ -282,14 +282,14 @@ endef
define U-Boot/p2812hnufx_ram
NAME:=ZyXEL P-2812HNU-Fx (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=P2812HNUF1
BUILD_DEVICES:=zyxel_p-2812hnu-f1
DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
endef
define U-Boot/p2812hnufx_nandspl
NAME:=ZyXEL P-2812HNU-Fx (NAND SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=P2812HNUF1
BUILD_DEVICES:=zyxel_p-2812hnu-f1
UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl
DEPENDS+=@BROKEN
endef
@ -297,38 +297,38 @@ endef
define U-Boot/vgv7510kw22_brn
NAME:=Arcadyan VGV7510KW22 (BRN)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7510KW22NOR
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
endef
define U-Boot/vgv7510kw22_nor
NAME:=Arcadyan VGV7510KW22 (NOR)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7510KW22NOR
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
endef
define U-Boot/vgv7510kw22_ram
NAME:=Arcadyan VGV7510KW22 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7510KW22NOR
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
endef
define U-Boot/vgv7519_brn
NAME:=Arcadyan VGV7519 (BRN)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7519NOR VGV7519BRN
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
endef
define U-Boot/vgv7519_nor
NAME:=Arcadyan VGV7519 (NOR)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7519NOR VGV7519BRN
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
endef
define U-Boot/vgv7519_ram
NAME:=Arcadyan VGV7519 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=VGV7519NOR VGV7519BRN
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
endef

View File

@ -1,51 +0,0 @@
#
# Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape-32bit
PKG_VERSION:=v1.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_MIRROR_HASH:=a29edbeddde4b3007ac349c2a5ee434719049ac4753e459dbb1bab21e1c585da
PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
PKG_SOURCE_VERSION:=6476195551ea83193afd06d0c441483c04729c8d
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/uboot-layerscape-32b
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_layerscape_32b
TITLE:=32-bit U-Boot for Layerscape boards
DEFAULT:=y
HIDDEN:=1
endef
define Build/Configure
endef
define Build/Compile
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-32b-uboot.bin
$(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-32b-uboot.bin
$(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin.swap $(STAGING_DIR_IMAGE)/ls1012ardb-32b-uboot.bin
endef
$(eval $(call BuildPackage,uboot-layerscape-32b))

View File

@ -0,0 +1,53 @@
#
# Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape-armv8_32b
PKG_SOURCE_DATE:=2017-10-24
PKG_RELEASE:=1
# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit
# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets,
# 64-bit u-boot images git tree is provided here whose source code actually is
# uboot-layerscape's source code.
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git
PKG_SOURCE_VERSION:=43cb4c0fcab237f8daa39c393cc1441b76b99fcf
PKG_MIRROR_HASH:=ff7d1fcb85dda2be6a9e3785821b5791c7189d2d412b160a9621bb2dcad24dea
PKG_MAINTAINER:=Yangbo Lu <yangbo.lu@nxp.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/uboot-layerscape-armv8_32b
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_layerscape_armv8_32b
TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards
DEFAULT:=y
HIDDEN:=1
endef
define Build/Configure
endef
define Build/Compile
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin
$(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin
$(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin
$(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin
endef
$(eval $(call BuildPackage,uboot-layerscape-armv8_32b))

View File

@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=uboot-layerscape
PKG_VERSION:=v1.0
PKG_SOURCE_DATE:=2017-08-24
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_MIRROR_HASH:=462fea9bdf03ec4bc23f2f1bb3917c2ec57017eca1e11b8a609bf60cd51a94e7
PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git
PKG_SOURCE_VERSION:=69b5ea576a2b0448391a910114d6c05859bf78d0
PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git
PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af
PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=layerscape
BUILD_SUBTARGET:=64b
BUILD_SUBTARGET:=armv8_64b
BUILD_DEVICES:=$(1)
UBOOT_IMAGE:=u-boot-dtb.bin
HIDDEN:=y
@ -40,17 +40,34 @@ endef
define U-Boot/ls1012ardb
NAME:=NXP ls1012ardb 64b Dev Board
UBOOT_CONFIG:=ls1012ardb_qspi
UBOOT_IMAGE:=u-boot-swap.bin
endef
define U-Boot/ls1088ardb
NAME:=NXP ls1088ardb 64b Dev Board
UBOOT_CONFIG:=ls1088ardb_qspi
endef
define U-Boot/ls2088ardb
NAME:=NXP ls2088ardb 64b Dev Board
UBOOT_CONFIG:=ls2080ardb
endef
define U-Boot/ls1012afrdm
NAME:=NXP ls1012afrdm 64b Dev Board
UBOOT_CONFIG:=ls1012afrdm_qspi
endef
UBOOT_TARGETS := \
ls1043ardb \
ls1046ardb \
ls1012ardb
ls1012ardb \
ls1088ardb \
ls2088ardb \
ls1012afrdm
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-64b-uboot.bin
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin
endef
define Package/u-boot/install/default

View File

@ -0,0 +1,51 @@
From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Fri, 22 Sep 2017 11:00:12 +0800
Subject: [PATCH 1/3] armv8: ls1043a: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls1043a_common.h | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 0b3fb4e..5c01111 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -336,7 +336,19 @@
"sd_bootcmd=echo Trying load from SD ..;" \
"mmcinfo; mmc read $load_addr " \
"$kernel_addr_sd $kernel_size_sd ;" \
- " bootm $load_addr#$board\0"
+ " bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock8 " \
+ "rootfstype=squashfs,jffs2 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
+ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \
+ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \
+ "cp.b 61000000 $loadaddr 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#undef CONFIG_BOOTCOMMAND
@@ -351,6 +363,12 @@
"env exists secureboot && esbc_halt;"
#endif
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND "run lede_boot"
+
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \
"earlycon=uart8250,mmio,0x21c0500 " \
MTDPARTS_DEFAULT
--
2.7.4

View File

@ -0,0 +1,57 @@
From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Fri, 22 Sep 2017 11:36:43 +0800
Subject: [PATCH 2/3] armv8: ls1046ardb: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls1046a_common.h | 15 ++++++++++++++-
include/configs/ls1046ardb.h | 6 ++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index 4fc2f94..53bd41b 100644
--- a/include/configs/ls1046a_common.h
+++ b/include/configs/ls1046a_common.h
@@ -276,7 +276,20 @@
"sd_bootcmd=echo Trying load from SD ..;" \
"mmcinfo; mmc read $load_addr " \
"$kernel_addr_sd $kernel_size_sd ;" \
- " bootm $load_addr#$board\0"
+ " bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock9 " \
+ "rootfstype=ext4 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
+ "16M(kernel),30M(ext4rfs),2M(user)\0" \
+ "lede_run=sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index f8c15a6..c3b50b1 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -251,6 +251,12 @@
"env exists secureboot && esbc_halt;"
#endif
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND "run lede_boot"
+
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
#define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \
"15m(u-boot),48m(kernel.itb);" \
"7e800000.flash:16m(nand_uboot)," \
--
2.7.4

View File

@ -0,0 +1,51 @@
From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Thu, 28 Sep 2017 11:25:58 +0800
Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls1012ardb.h | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
index 5fe3218..242cdf0 100644
--- a/include/configs/ls1012ardb.h
+++ b/include/configs/ls1012ardb.h
@@ -127,13 +127,32 @@
"$kernel_addr $kernel_size; env exists secureboot " \
"&& sf read $kernelheader_addr_r $kernelheader_addr " \
"$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
- "bootm $load_addr#$board\0"
+ "bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock8 " \
+ "rootfstype=ext4 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
+ "16M(kernel),30M(ext4rfs),2M(user)\0" \
+ "lede_run=pfe stop && sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#undef CONFIG_BOOTCOMMAND
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
#define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
"env exists secureboot && esbc_halt;"
#endif
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND "run lede_boot"
+
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
#include <asm/fsl_secure_boot.h>
--
2.7.4

View File

@ -0,0 +1,58 @@
From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Mon, 16 Oct 2017 11:57:36 +0800
Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h
index 7bd152d..4cefa40 100644
--- a/include/configs/ls1088ardb.h
+++ b/include/configs/ls1088ardb.h
@@ -404,7 +404,20 @@
"env exists secureboot && mmc read $kernelheader_addr_r " \
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
" && esbc_validate ${kernelheader_addr_r};" \
- "bootm $load_addr#$BOARD\0"
+ "bootm $load_addr#$BOARD\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock10 " \
+ "rootfstype=ext4 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
+ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \
+ "16M(kernel),30M(ext4rfs),2M(user)\0" \
+ "lede_run=sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#undef CONFIG_BOOTCOMMAND
#if defined(CONFIG_QSPI_BOOT)
@@ -429,6 +442,18 @@
"run distro_bootcmd;run sd_bootcmd;" \
"env exists secureboot && esbc_halt;"
#endif
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \
+ "sf read 0x80300000 0xE00000 0x100000;" \
+ "fsl_mc start mc 0x80000000 0x80300000;" \
+ "sf read 0x80400000 0xd00000 0x100000;" \
+ "fsl_mc apply dpl 0x80400000;" \
+ "run lede_boot;"
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
/* MAC/PHY configuration */
#ifdef CONFIG_FSL_MC_ENET
#define CONFIG_PHYLIB_10G
--
2.7.4

View File

@ -0,0 +1,54 @@
From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Mon, 16 Oct 2017 12:37:05 +0800
Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 8a34990..8ae3944 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void);
"env exists secureboot && mmc read $kernelheader_addr_r " \
"$kernelhdr_addr_sd $kernelhdr_size_sd " \
" && esbc_validate ${kernelheader_addr_r};" \
- "bootm $load_addr#$board\0"
+ "bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock9 " \
+ "rootfstype=squashfs,jffs2 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \
+ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \
+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \
+ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \
+ "cp.b 581000000 $loadaddr 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#undef CONFIG_BOOTCOMMAND
#ifdef CONFIG_QSPI_BOOT
@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void);
"env exists secureboot && esbc_halt;"
#endif
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+ "fsl_mc start mc 0x580a00000 0x580e00000;" \
+ "fsl_mc apply dpl 0x580d00000;" \
+ "run lede_boot;"
+
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
#undef CONFIG_BOOTARGS
#define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \
"earlycon=uart8250,mmio,0x21c0600 " \
--
2.7.4

View File

@ -0,0 +1,49 @@
From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Tue, 24 Oct 2017 17:48:08 +0800
Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
include/configs/ls1012afrdm.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index a3f8824d27..36dff19bdd 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -73,12 +73,31 @@
"qspi_bootcmd=echo Trying load from qspi..;" \
"sf probe && sf read $load_addr " \
"$kernel_addr $kernel_size && bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock8 " \
+ "rootfstype=ext4 noinitrd " \
+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \
+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \
+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \
+ "16M(kernel),30M(ext4rfs),2M(user)\0" \
+ "lede_run=pfe stop && sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \
+ "bootm $loadaddr - $fdtaddr\0" \
+ "lede_boot=run lede_setenv;run lede_run\0"
#undef CONFIG_BOOTCOMMAND
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
#define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd"
#endif
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND "run lede_boot"
+
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY 3
+
/*
* USB
*/
--
2.14.1

View File

@ -16,6 +16,8 @@ PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
UBOOT_MAKE_FLAGS:=
define U-Boot/Default
BUILD_TARGET:=mvebu
HIDDEN:=1

View File

@ -11,18 +11,14 @@ Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
configs/clearfog_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig
index 41e94e6daf..f3572971be 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -34,6 +34,7 @@ CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
@@ -23,7 +23,7 @@ CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
-# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_SETEXPR=y
CONFIG_EFI_PARTITION=y
# CONFIG_PARTITION_UUIDS is not set
# CONFIG_SPL_PARTITION_UUIDS is not set
--
2.12.2
CONFIG_CMD_TFTPPUT=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y

View File

@ -0,0 +1,153 @@
From 59be82ef7e7ec4be6e1597d8aef65dd3d8c3a0d9 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@vdwaa.nl>
Date: Mon, 8 May 2017 21:31:19 +0200
Subject: [PATCH 1/2] rsa: Fix build with OpenSSL 1.1.x
The rsa_st struct has been made opaque in 1.1.x, add forward compatible
code to access the n, e, d members of rsa_struct.
EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
called to reinitialise an already created structure.
---
lib/rsa/rsa-sign.c | 44 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -9,6 +9,7 @@
#include <string.h>
#include <image.h>
#include <time.h>
+#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
@@ -20,6 +21,19 @@
#define HAVE_ERR_REMOVE_THREAD_STATE
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+static void RSA_get0_key(const RSA *r,
+ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
+{
+ if (n != NULL)
+ *n = r->n;
+ if (e != NULL)
+ *e = r->e;
+ if (d != NULL)
+ *d = r->d;
+}
+#endif
+
static int rsa_err(const char *msg)
{
unsigned long sslErr = ERR_get_error();
@@ -286,16 +300,22 @@ static int rsa_init(void)
{
int ret;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ret = SSL_library_init();
+#else
+ ret = OPENSSL_init_ssl(0, NULL);
+#endif
if (!ret) {
fprintf(stderr, "Failure to init SSL library\n");
return -1;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
OpenSSL_add_all_digests();
OpenSSL_add_all_ciphers();
+#endif
return 0;
}
@@ -335,12 +355,15 @@ err_set_rsa:
err_engine_init:
ENGINE_free(e);
err_engine_by_id:
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ENGINE_cleanup();
+#endif
return ret;
}
static void rsa_remove(void)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_cleanup_all_ex_data();
ERR_free_strings();
#ifdef HAVE_ERR_REMOVE_THREAD_STATE
@@ -349,6 +372,7 @@ static void rsa_remove(void)
ERR_remove_state(0);
#endif
EVP_cleanup();
+#endif
}
static void rsa_engine_remove(ENGINE *e)
@@ -409,7 +433,11 @@ static int rsa_sign_with_key(RSA *rsa, s
ret = rsa_err("Could not obtain signature");
goto err_sign;
}
- EVP_MD_CTX_cleanup(context);
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_MD_CTX_cleanup(context);
+ #else
+ EVP_MD_CTX_reset(context);
+ #endif
EVP_MD_CTX_destroy(context);
EVP_PKEY_free(key);
@@ -479,6 +507,7 @@ static int rsa_get_exponent(RSA *key, ui
{
int ret;
BIGNUM *bn_te;
+ const BIGNUM *key_e;
uint64_t te;
ret = -EINVAL;
@@ -487,17 +516,18 @@ static int rsa_get_exponent(RSA *key, ui
if (!e)
goto cleanup;
- if (BN_num_bits(key->e) > 64)
+ RSA_get0_key(key, NULL, &key_e, NULL);
+ if (BN_num_bits(key_e) > 64)
goto cleanup;
- *e = BN_get_word(key->e);
+ *e = BN_get_word(key_e);
- if (BN_num_bits(key->e) < 33) {
+ if (BN_num_bits(key_e) < 33) {
ret = 0;
goto cleanup;
}
- bn_te = BN_dup(key->e);
+ bn_te = BN_dup(key_e);
if (!bn_te)
goto cleanup;
@@ -527,6 +557,7 @@ int rsa_get_params(RSA *key, uint64_t *e
{
BIGNUM *big1, *big2, *big32, *big2_32;
BIGNUM *n, *r, *r_squared, *tmp;
+ const BIGNUM *key_n;
BN_CTX *bn_ctx = BN_CTX_new();
int ret = 0;
@@ -548,7 +579,8 @@ int rsa_get_params(RSA *key, uint64_t *e
if (0 != rsa_get_exponent(key, exponent))
ret = -1;
- if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) ||
+ RSA_get0_key(key, &key_n, NULL, NULL);
+ if (!BN_copy(n, key_n) || !BN_set_word(big1, 1L) ||
!BN_set_word(big2, 2L) || !BN_set_word(big32, 32L))
ret = -1;

View File

@ -0,0 +1,96 @@
From 65030804dc57f3488e4ffe21e72fc65cd245cb98 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@vdwaa.nl>
Date: Mon, 8 May 2017 21:31:20 +0200
Subject: [PATCH 2/2] tools: kwbimage fix build with OpenSSL 1.1.x
The rsa_st struct has been made opaque in 1.1.x, add forward compatible
code to access the n, e, d members of rsa_struct.
EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
called to reinitialise an already created structure.
Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
---
tools/kwbimage.c | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -18,10 +18,30 @@
#include "kwbimage.h"
#ifdef CONFIG_KWB_SECURE
+#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/evp.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+static void RSA_get0_key(const RSA *r,
+ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
+{
+ if (n != NULL)
+ *n = r->n;
+ if (e != NULL)
+ *e = r->e;
+ if (d != NULL)
+ *d = r->d;
+}
+
+#else
+void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
+{
+ EVP_MD_CTX_reset(ctx);
+}
+#endif
#endif
static struct image_cfg_element *image_cfg;
@@ -470,12 +490,16 @@ static int kwb_export_pubkey(RSA *key, s
char *keyname)
{
int size_exp, size_mod, size_seq;
+ const BIGNUM *key_e, *key_n;
uint8_t *cur;
char *errmsg = "Failed to encode %s\n";
- if (!key || !key->e || !key->n || !dst) {
+ RSA_get0_key(key, NULL, &key_e, NULL);
+ RSA_get0_key(key, &key_n, NULL, NULL);
+
+ if (!key || !key_e || !key_n || !dst) {
fprintf(stderr, "export pk failed: (%p, %p, %p, %p)",
- key, key->e, key->n, dst);
+ key, key_e, key_n, dst);
fprintf(stderr, errmsg, keyname);
return -EINVAL;
}
@@ -490,8 +514,8 @@ static int kwb_export_pubkey(RSA *key, s
* do the encoding manually.
*/
- size_exp = BN_num_bytes(key->e);
- size_mod = BN_num_bytes(key->n);
+ size_exp = BN_num_bytes(key_e);
+ size_mod = BN_num_bytes(key_n);
size_seq = 4 + size_mod + 4 + size_exp;
if (size_mod > 256) {
@@ -520,14 +544,14 @@ static int kwb_export_pubkey(RSA *key, s
*cur++ = 0x82;
*cur++ = (size_mod >> 8) & 0xFF;
*cur++ = size_mod & 0xFF;
- BN_bn2bin(key->n, cur);
+ BN_bn2bin(key_n, cur);
cur += size_mod;
/* Exponent */
*cur++ = 0x02; /* INTEGER */
*cur++ = 0x82;
*cur++ = (size_exp >> 8) & 0xFF;
*cur++ = size_exp & 0xFF;
- BN_bn2bin(key->e, cur);
+ BN_bn2bin(key_e, cur);
if (hashf) {
struct hash_v1 pk_hash;

View File

@ -9,9 +9,9 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2016.03
PKG_VERSION:=2017.07
PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb
PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff
PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
@ -26,93 +26,162 @@ define U-Boot/Default
endef
define U-Boot/A10-OLinuXino-Lime
BUILD_SUBTARGET:=cortexa8
NAME:=A10 OLinuXino LIME
BUILD_DEVICES:=sun4i-a10-olinuxino-lime
endef
define U-Boot/A13-OLinuXino
BUILD_SUBTARGET:=cortexa8
NAME:=A13 OlinuXino
BUILD_DEVICES:=sun5i-a13-olinuxino
endef
define U-Boot/A20-OLinuXino-Lime
BUILD_SUBTARGET:=cortexa7
NAME:=A20 OLinuXino LIME
BUILD_DEVICES:=sun7i-a20-olinuxino-lime
endef
define U-Boot/A20-OLinuXino-Lime2
BUILD_SUBTARGET:=cortexa7
NAME:=A20 OLinuXino LIME2
BUILD_DEVICES:=sun7i-a20-olinuxino-lime2
endef
define U-Boot/A20-OLinuXino-Lime2-eMMC
BUILD_SUBTARGET:=cortexa7
NAME:=A20 OLinuXino LIME2 eMMC
BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc
endef
define U-Boot/A20-OLinuXino_MICRO
BUILD_SUBTARGET:=cortexa7
NAME:=A20 OLinuXino MICRO
BUILD_DEVICES:=sun7i-a20-olinuxino-micro
endef
define U-Boot/Bananapi
BUILD_SUBTARGET:=cortexa7
NAME:=Bananapi
BUILD_DEVICES:=sun7i-a20-bananapi
endef
define U-Boot/Bananapro
BUILD_SUBTARGET:=cortexa7
NAME:=Bananapro
BUILD_DEVICES:=sun7i-a20-bananapro
endef
define U-Boot/Cubieboard
BUILD_SUBTARGET:=cortexa8
NAME:=Cubieboard
BUILD_DEVICES:=sun4i-a10-cubieboard
endef
define U-Boot/Cubieboard2
BUILD_SUBTARGET:=cortexa7
NAME:=Cubieboard2
BUILD_DEVICES:=sun7i-a20-cubieboard2
endef
define U-Boot/Cubietruck
BUILD_SUBTARGET:=cortexa7
NAME:=Cubietruck
BUILD_DEVICES:=sun7i-a20-cubietruck
endef
define U-Boot/Hummingbird_A31
BUILD_SUBTARGET:=cortexa7
NAME:=Hummingbird A31 board
endef
define U-Boot/Marsboard_A10
BUILD_SUBTARGET:=cortexa8
NAME:=Marsboard
BUILD_DEVICES:=sun4i-a10-marsboard
endef
define U-Boot/Mele_M9
BUILD_SUBTARGET:=cortexa7
NAME:=Mele M9 (A31)
BUILD_DEVICES:=sun6i-a31-m9
endef
define U-Boot/OLIMEX_A13_SOM
BUILD_SUBTARGET:=cortexa8
NAME:=Olimex A13 SOM
BUILD_DEVICES:=sun5i-a13-olimex-som
endef
define U-Boot/Linksprite_pcDuino
BUILD_SUBTARGET:=cortexa8
NAME:=Linksprite pcDuino
BUILD_DEVICES:=sun4i-a10-pcduino
endef
define U-Boot/Linksprite_pcDuino3
BUILD_SUBTARGET:=cortexa7
NAME:=Linksprite pcDuino3
BUILD_DEVICES:=sun7i-a20-pcduino3
endef
define U-Boot/Lamobo_R1
BUILD_SUBTARGET:=cortexa7
NAME:=Lamobo R1
BUILD_DEVICES:=sun7i-a20-lamobo-r1
endef
define U-Boot/nanopi_m1_plus
BUILD_SUBTARGET:=cortexa7
NAME:=NanoPi M1 Plus (H3)
BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus
endef
define U-Boot/nanopi_neo
BUILD_SUBTARGET:=cortexa7
NAME:=U-Boot for NanoPi NEO (H3)
BUILD_DEVICES:=sun8i-h3-nanopi-neo
endef
define U-Boot/orangepi_r1
BUILD_SUBTARGET:=cortexa7
NAME:=Orange Pi R1 (H2+)
BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1
endef
define U-Boot/orangepi_plus
BUILD_SUBTARGET:=cortexa7
NAME:=Orange Pi Plus (H3)
BUILD_DEVICES:=sun8i-h3-orangepi-plus
endef
define U-Boot/orangepi_2
BUILD_SUBTARGET:=cortexa7
NAME:=Orange Pi 2 (H3)
BUILD_DEVICES:=sun8i-h3-orangepi-2
endef
define U-Boot/pangolin
BUILD_SUBTARGET:=cortexa7
NAME:=Theobroma A31-yQ7 devboard
UENV:=pangolin
endef
define U-Boot/pine64_plus
BUILD_SUBTARGET:=cortexa53
NAME:=Pine64 Plus A64
BUILD_DEVICES:=sun50i-a64-pine64-plus
DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi
UENV:=a64
endef
UBOOT_TARGETS := \
A10-OLinuXino-Lime \
A13-OLinuXino \
A20-OLinuXino-Lime \
A20-OLinuXino-Lime2 \
A20-OLinuXino-Lime2-eMMC \
A20-OLinuXino_MICRO \
Bananapi \
Bananapro \
@ -120,19 +189,32 @@ UBOOT_TARGETS := \
Cubieboard2 \
Cubietruck \
Hummingbird_A31 \
Marsboard_A10 \
Mele_M9 \
OLIMEX_A13_SOM \
Linksprite_pcDuino \
Linksprite_pcDuino3 \
Lamobo_R1 \
nanopi_m1_plus \
nanopi_neo \
orangepi_r1 \
orangepi_plus \
pangolin
orangepi_2 \
pangolin \
pine64_plus
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
UBOOT_MAKE_FLAGS += \
BL31=$(STAGING_DIR_IMAGE)/bl31.bin
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
ifeq ($(SUBTARGET),cortexa53)
cat $(PKG_BUILD_DIR)/spl/sunxi-spl.bin $(PKG_BUILD_DIR)/u-boot.itb > $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin
else
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin
endif
mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \
$(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr
endef

View File

@ -1,8 +1,7 @@
--- /dev/null
+++ b/configs/OLIMEX_A13_SOM_defconfig
@@ -0,0 +1,18 @@
@@ -0,0 +1,17 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2"
+CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino"
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y

View File

@ -1,16 +1,16 @@
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
sun6i-a31-m9.dtb \
sun6i-a31-mele-a1000g-quad.dtb \
sun6i-a31-mixtile-loftq.dtb \
+ sun6i-a31-pangolin.dtb \
sun6i-a31s-colorfly-e708-q1.dtb \
sun6i-a31s-cs908.dtb \
sun6i-a31s-primo81.dtb \
sun6i-a31s-sinovoip-bpi-m2.dtb
sun6i-a31s-inet-q972.dtb \
--- a/arch/arm/dts/sun6i-a31.dtsi
+++ b/arch/arm/dts/sun6i-a31.dtsi
@@ -643,6 +643,13 @@
@@ -679,6 +679,13 @@
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
@ -358,17 +358,9 @@
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SUNXI_SPI=y
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I
separate ahb reset control registers, custom pmic bus, new style
watchdog, etc.
-
choice
prompt "Sunxi SoC Variant"
optional
@@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL
Set the SCL pin for the LCD i2c interface. This takes a string in the
format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.

View File

@ -1,38 +0,0 @@
From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 16 Mar 2016 20:44:51 +0100
Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i
The clock_sun6i.c implementation was not deasserting the reset for
the regular i2c controllers, this commit fixes this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state)
return 0;
}
- /* set the apb clock gate for twi */
- if (state)
+ /* set the apb clock gate and reset for twi */
+ if (state) {
setbits_le32(&ccm->apb2_gate,
CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port));
- else
+ setbits_le32(&ccm->apb2_reset_cfg,
+ 1 << (APB2_RESET_TWI_SHIFT + port));
+ } else {
+ clrbits_le32(&ccm->apb2_reset_cfg,
+ 1 << (APB2_RESET_TWI_SHIFT + port));
clrbits_le32(&ccm->apb2_gate,
CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port));
+ }
return 0;
}

View File

@ -1,24 +0,0 @@
From 1eae8f66ff749409eb96e2f3f3387c56232d0b8a Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 16 Mar 2016 13:46:22 +0100
Subject: [PATCH] sunxi: Enable realtek phy support
Enable building of drivers/net/phy/realtek.c so that realtek phys
get properly initialized.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
include/configs/sunxi-common.h | 1 +
1 file changed, 1 insertion(+)
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -314,6 +314,7 @@ extern int soft_i2c_gpio_scl;
#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */
#define CONFIG_PHY_ADDR 1
#define CONFIG_MII /* MII PHY management */
+#define CONFIG_PHY_REALTEK
#endif
#ifdef CONFIG_USB_EHCI_HCD

View File

@ -1,127 +0,0 @@
From fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 17 Mar 2016 13:53:03 +0100
Subject: [PATCH] sunxi: Fix gmac not working due to cpu_eth_init no longer
being called
cpu_eth_init is no longer called for dm enabled eth drivers, this
was causing the sunxi gmac eth controller to no longer work in u-boot.
This commit fixes this by calling the clock, reset and pinmux setup
function from s_init() and enabling the phy power pin (if any) from
board_init().
The enabling of phy power cannot be done from s_init because it uses dm
and dm is not ready yet at this point.
Note that the mdelay is dropped as the phy gets enabled much earlier
now, so it is no longer needed.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Tested-by: Karsten Merker <merker@debian.org>
Tested-by: Michael Haas <haas@computerlinguist.org>
---
arch/arm/cpu/armv7/sunxi/board.c | 28 +---------------------------
arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 +++++-
board/sunxi/board.c | 5 +++++
board/sunxi/gmac.c | 14 +-------------
4 files changed, 12 insertions(+), 41 deletions(-)
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -136,6 +136,7 @@ void s_init(void)
timer_init();
gpio_init();
i2c_init_board();
+ eth_init_board();
}
#ifdef CONFIG_SPL_BUILD
@@ -243,30 +244,3 @@ void enable_caches(void)
dcache_enable();
}
#endif
-
-#ifdef CONFIG_CMD_NET
-/*
- * Initializes on-chip ethernet controllers.
- * to override, implement board_eth_init()
- */
-int cpu_eth_init(bd_t *bis)
-{
- __maybe_unused int rc;
-
-#ifdef CONFIG_MACPWR
- gpio_request(CONFIG_MACPWR, "macpwr");
- gpio_direction_output(CONFIG_MACPWR, 1);
- mdelay(200);
-#endif
-
-#ifdef CONFIG_SUNXI_GMAC
- rc = sunxi_gmac_initialize(bis);
- if (rc < 0) {
- printf("sunxi: failed to initialize gmac\n");
- return rc;
- }
-#endif
-
- return 0;
-}
-#endif
--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
@@ -24,6 +24,10 @@ void sdelay(unsigned long);
void return_to_fel(uint32_t lr, uint32_t sp);
/* Board / SoC level designware gmac init */
-int sunxi_gmac_initialize(bd_t *bis);
+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
+void eth_init_board(void);
+#else
+static inline void eth_init_board(void) {}
+#endif
#endif
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -90,6 +90,11 @@ int board_init(void)
if (ret)
return ret;
+#ifdef CONFIG_MACPWR
+ gpio_request(CONFIG_MACPWR, "macpwr");
+ gpio_direction_output(CONFIG_MACPWR, 1);
+#endif
+
/* Uses dm gpio code so do this here and not in i2c_init_board() */
return soft_i2c_board_init();
}
--- a/board/sunxi/gmac.c
+++ b/board/sunxi/gmac.c
@@ -6,7 +6,7 @@
#include <asm/arch/clock.h>
#include <asm/arch/gpio.h>
-int sunxi_gmac_initialize(bd_t *bis)
+void eth_init_board(void)
{
int pin;
struct sunxi_ccm_reg *const ccm =
@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis)
for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++)
sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC);
#endif
-
-#ifdef CONFIG_DM_ETH
- return 0;
-#else
-# ifdef CONFIG_RGMII
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
-# elif defined CONFIG_GMII
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII);
-# else
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);
-# endif
-#endif
}

View File

@ -1,78 +0,0 @@
From 948603d4d637a0e04a3214253b911cfc4ed11220 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 21 Mar 2016 14:44:35 +0100
Subject: [PATCH] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer
working
The 2nd usb controller on sun4i/sun7i has its base address 0x8000
bytes from the 1st one, rather then 0x1000. Also the ahb clk gates
are interleaved with the ohci clk-gates introducing a hole between
the clks for usb1 and usb2.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
drivers/usb/host/ehci-sunxi.c | 13 +++++++++++--
drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++---
2 files changed, 23 insertions(+), 5 deletions(-)
--- a/drivers/usb/host/ehci-sunxi.c
+++ b/drivers/usb/host/ehci-sunxi.c
@@ -17,6 +17,14 @@
#include <dm.h>
#include "ehci.h"
+#ifdef CONFIG_SUNXI_GEN_SUN4I
+#define BASE_DIST 0x8000
+#define AHB_CLK_DIST 2
+#else
+#define BASE_DIST 0x1000
+#define AHB_CLK_DIST 1
+#endif
+
struct ehci_sunxi_priv {
struct ehci_ctrl ehci;
int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice
#ifdef CONFIG_MACH_SUN8I_H3
priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0;
#endif
- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1;
- priv->ahb_gate_mask <<= priv->phy_index - 1;
+ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST;
+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
+ priv->phy_index++; /* Non otg phys start at 1 */
setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);
#ifdef CONFIG_SUNXI_GEN_SUN6I
--- a/drivers/usb/host/ohci-sunxi.c
+++ b/drivers/usb/host/ohci-sunxi.c
@@ -17,6 +17,14 @@
#include <usb.h>
#include "ohci.h"
+#ifdef CONFIG_SUNXI_GEN_SUN4I
+#define BASE_DIST 0x8000
+#define AHB_CLK_DIST 2
+#else
+#define BASE_DIST 0x1000
+#define AHB_CLK_DIST 1
+#endif
+
struct ohci_sunxi_priv {
ohci_t ohci;
int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */
@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice
priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0;
#endif
priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1;
- priv->ahb_gate_mask <<= priv->phy_index - 1;
- priv->usb_gate_mask <<= priv->phy_index - 1;
+ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
+ priv->usb_gate_mask <<= priv->phy_index;
+ priv->phy_index++; /* Non otg phys start at 1 */
setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask);
setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask);

View File

@ -1,31 +0,0 @@
From 8f10b5c65611e6c15a113bf63289b6696452f90d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 20 Mar 2016 14:17:10 +0100
Subject: [PATCH] spl: Print from which mmc slot spl is trying to boot
On some sunxi boards (and presumably also non sunxi boards) u-boot can
be either loaded from a sdcard in a micro-sd slot, or from eMMC.
Print which MMC spl tries to boot from, to help debugging.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
common/spl/spl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -210,9 +210,9 @@ struct boot_device_name boot_name_table[
{ BOOT_DEVICE_RAM, "RAM" },
#endif
#ifdef CONFIG_SPL_MMC_SUPPORT
- { BOOT_DEVICE_MMC1, "MMC" },
- { BOOT_DEVICE_MMC2, "MMC" },
- { BOOT_DEVICE_MMC2_2, "MMC" },
+ { BOOT_DEVICE_MMC1, "MMC1" },
+ { BOOT_DEVICE_MMC2, "MMC2" },
+ { BOOT_DEVICE_MMC2_2, "MMC2_2" },
#endif
#ifdef CONFIG_SPL_NAND_SUPPORT
{ BOOT_DEVICE_NAND, "NAND" },

View File

@ -1,39 +0,0 @@
From 60fa63012fcdc3c4ec1497bf5e358f0a90b40949 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 18 Mar 2016 08:42:01 +0100
Subject: [PATCH] sunxi: Add support for USB vbus pin for USB3
The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 +
board/sunxi/Kconfig | 6 ++++++
2 files changed, 7 insertions(+)
--- a/arch/arm/cpu/armv7/sunxi/usb_phy.c
+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c
@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index)
case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN);
case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN);
case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN);
+ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN);
}
return -EINVAL;
}
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -341,6 +341,12 @@ config USB2_VBUS_PIN
---help---
See USB1_VBUS_PIN help text.
+config USB3_VBUS_PIN
+ string "Vbus enable pin for usb3 (ehci2)"
+ default ""
+ ---help---
+ See USB1_VBUS_PIN help text.
+
config I2C0_ENABLE
bool "Enable I2C/TWI controller 0"
default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I

View File

@ -1,31 +0,0 @@
From ce0d0926758f631fdd655d438acd32d5935d43a4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 18 Mar 2016 08:45:21 +0100
Subject: [PATCH] sunxi: Specify USB vbus pins for orangepi boards
This fixes the USB ports not working on the orangepi_plus and stops us
from messing with gpio-s which we should not touch on the orangepi_pc.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
---
configs/orangepi_pc_defconfig | 3 +++
configs/orangepi_plus_defconfig | 1 +
2 files changed, 4 insertions(+)
--- a/configs/orangepi_pc_defconfig
+++ b/configs/orangepi_pc_defconfig
@@ -14,3 +14,6 @@ CONFIG_SPL=y
CONFIG_CMD_GPIO=y
CONFIG_SY8106A_POWER=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB1_VBUS_PIN=""
+CONFIG_USB2_VBUS_PIN=""
+CONFIG_USB3_VBUS_PIN=""
--- a/configs/orangepi_plus_defconfig
+++ b/configs/orangepi_plus_defconfig
@@ -14,3 +14,4 @@ CONFIG_SPL=y
CONFIG_CMD_GPIO=y
CONFIG_SY8106A_POWER=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB1_VBUS_PIN="PG13"

View File

@ -1,33 +0,0 @@
From 70fe24ed93fa90eb407d18a5fc9d9ad85ac9184c Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <wens@csie.org>
Date: Wed, 27 Jan 2016 16:34:43 +0800
Subject: [PATCH] sunxi: Support SID e-fuses on A83T and H3
On the A83T and H3, the SID block is at a different address.
Furthurmore, the e-fuses are at an offset of 0x200 within the
hardware's address space.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 7 +++++++
1 file changed, 7 insertions(+)
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
@@ -82,7 +82,14 @@
#define SUNXI_AD_DA_BASE 0x01c22c00
#define SUNXI_KEYPAD_BASE 0x01c23000
#define SUNXI_TZPC_BASE 0x01c23400
+
+#if defined(CONFIG_MACH_SUN8I_A83T) || defined(CONFIG_MACH_SUN8I_H3)
+/* SID address space starts at 0x01c1400, but e-fuse is at offset 0x200 */
+#define SUNXI_SID_BASE 0x01c14200
+#else
#define SUNXI_SID_BASE 0x01c23800
+#endif
+
#define SUNXI_SJTAG_BASE 0x01c23c00
#define SUNXI_TP_BASE 0x01c25000

View File

@ -1,23 +0,0 @@
From 2af25b747340c6c8f6a6b9e27632db577bf4da52 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Mon, 22 Feb 2016 22:55:46 -0700
Subject: [PATCH] sunxi: Display the board model on start-up
It is useful to know which sunxi board you are booting. Display this on
start-up to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
include/configs/sunxi-common.h | 1 +
1 file changed, 1 insertion(+)
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -174,6 +174,7 @@
#define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */
#define CONFIG_IDENT_STRING " Allwinner Technology"
+#define CONFIG_DISPLAY_BOARDINFO
#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */

View File

@ -0,0 +1,76 @@
From 335d30050b0d02444c9297f7a9b0cbf75dce847f Mon Sep 17 00:00:00 2001
From: Olliver Schinagl <oliver@schinagl.nl>
Date: Fri, 12 May 2017 11:38:54 +0200
Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC
This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash
storage.
https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/
It is a assembly variant of the regular Lime2 but featuring eMMC for
storage.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
---
board/sunxi/MAINTAINERS | 5 +++++
configs/A20-OLinuXino-Lime2-eMMC_defconfig | 36 ++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
create mode 100644 configs/A20-OLinuXino-Lime2-eMMC_defconfig
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -88,6 +88,11 @@ M: Iain Paton <ipaton0@gmail.com>
S: Maintained
F: configs/A20-OLinuXino-Lime2_defconfig
+A20-OLINUXINO-LIME2-EMMC BOARD
+M: Olliver Schinagl <oliver@schinagl.nl>
+S: Maintained
+F: configs/A20-OLinuXino-Lime2-eMMC_defconfig
+
A33-OLINUXINO BOARD
M: Stefan Mavrodiev <stefan.mavrodiev@gmail.com>
S: Maintained
--- /dev/null
+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig
@@ -0,0 +1,37 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN7I=y
+CONFIG_DRAM_CLK=384
+CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_USB0_VBUS_PIN="PC17"
+CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_I2C1_ENABLE=y
+CONFIG_SATAPWR="PC3"
+CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc"
+CONFIG_AHCI=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+CONFIG_SPL_I2C_SUPPORT=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_FPGA is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_PARTITION_UUIDS is not set
+CONFIG_DFU_RAM=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_RGMII=y
+CONFIG_SUN7I_GMAC=y
+CONFIG_GMAC_TX_DELAY=1
+CONFIG_AXP_ALDO3_VOLT=2800
+CONFIG_AXP_ALDO4_VOLT=2800
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
+CONFIG_G_DNL_VENDOR_NUM=0x1f3a
+CONFIG_G_DNL_PRODUCT_NUM=0x1010

View File

@ -0,0 +1,31 @@
From fb7fe04da2187b9853d713cb643d01bd56813e3d Mon Sep 17 00:00:00 2001
From: Emmanuel Vadot <manu@bidouilliste.com>
Date: Fri, 12 May 2017 11:38:53 +0200
Subject: ARM: dts: sunxi: Change node name for pwrseq pin on
Olinuxino-lime2-emmc
The node name for the power seq pin is mmc2@0 like the mmc2_pins_a one.
This makes the original node (mmc2_pins_a) scrapped out of the dtb and
result in a unusable eMMC if U-Boot didn't configured the pins to the
correct functions.
Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
---
arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts
+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts
@@ -56,7 +56,7 @@
};
&pio {
- mmc2_pins_nrst: mmc2@0 {
+ mmc2_pins_nrst: mmc2-rst-pin {
allwinner,pins = "PC16";
allwinner,function = "gpio_out";
allwinner,drive = <SUN4I_PINCTRL_10_MA>;

View File

@ -0,0 +1,12 @@
GNU nano 2.7.4 File: 062-A20-improve-gmac-upload.patch
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -24,6 +24,7 @@ CONFIG_DFU_RAM=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_RGMII=y
CONFIG_SUN7I_GMAC=y
+CONFIG_GMAC_TX_DELAY=1
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_USB_EHCI_HCD=y

View File

@ -12,9 +12,9 @@ More specifically, the following settings are now used:
* up to 1152MHz: mul=3, div=2 (unchanged)
* above 1152MHz: mul=4, div=2 (was: mul=2, div=1)
--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
@@ -122,11 +122,12 @@ void clock_set_pll1(unsigned int clk)
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -107,11 +107,12 @@ void clock_set_pll1(unsigned int clk)
struct sunxi_ccm_reg * const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
const int p = 0;

View File

@ -16,9 +16,9 @@ order of magnitude as Boot1.
Furthermore, a bit of documentation is added to clarify that the
required setting for the PLL LDO is 1.37v as per the A31 manual.
--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
@@ -24,14 +24,27 @@ void clock_init_safe(void)
--- a/arch/arm/mach-sunxi/clock_sun6i.c
+++ b/arch/arm/mach-sunxi/clock_sun6i.c
@@ -26,13 +26,26 @@ void clock_init_safe(void)
struct sunxi_prcm_reg * const prcm =
(struct sunxi_prcm_reg *)SUNXI_PRCM_BASE;
@ -34,9 +34,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual.
clrsetbits_le32(&prcm->pll_ctrl1, ~PRCM_PLL_CTRL_LDO_KEY_MASK,
PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN |
- PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140));
+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370) );
+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370));
clrbits_le32(&prcm->pll_ctrl1, PRCM_PLL_CTRL_LDO_KEY_MASK);
+
+ /* Give the PLL LDO voltage setting some time to take hold.
+ * Notes:
+ * 1) We need to use sdelay() as the timers aren't set up yet.
@ -44,10 +44,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual.
+ * iterations through a loop.
+ */
+ sdelay(100000);
+
clock_set_pll1(408000000);
#endif
writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg);
#if defined(CONFIG_MACH_SUN8I_R40) || defined(CONFIG_MACH_SUN50I)
--- a/arch/arm/include/asm/arch-sunxi/prcm.h
+++ b/arch/arm/include/asm/arch-sunxi/prcm.h
@@ -111,13 +111,13 @@

View File

@ -6,11 +6,11 @@ Subject: sun6i: define alternate-function for UART2 on GPG
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -180,6 +180,7 @@ enum sunxi_gpio_number {
@@ -186,6 +186,7 @@ enum sunxi_gpio_number {
#define SUN6I_GPG_SDC1 2
#define SUN8I_GPG_SDC1 2
#define SUN6I_GPG_TWI3 2
+#define SUN6I_GPG_UART2 2
#define SUN5I_GPG_UART1 4
#define SUN4I_GPH_SDC1 5
#define SUN6I_GPH_PWM 2

View File

@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:53:11 +0200
Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7)
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -88,6 +88,10 @@ static int gpio_init(void)
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -126,6 +126,10 @@ static int gpio_init(void)
sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1);
sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1);
sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP);
@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7)
sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2);
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -260,6 +260,8 @@ extern int soft_i2c_gpio_scl;
@@ -259,6 +259,8 @@ extern int soft_i2c_gpio_scl;
#endif
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I)
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200"

View File

@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:59:38 +0200
Subject: ARM: sunxi: Make CONS_INDEX configurable
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -229,6 +229,14 @@ config SYS_BOARD
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -412,6 +412,14 @@ config SYS_BOARD
config SYS_SOC
default "sunxi"

View File

@ -0,0 +1,35 @@
From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 19 Jul 2017 22:23:15 +0200
Subject: [PATCH] mkimage: check environment for dtc binary location
Currently mkimage assumes the dtc binary is in the path and fails
otherwise. This patch makes it check the DTC environment variable first
for the dtc binary and then fall back to the default path. This makes
it possible to call the u-boot build with make DTC=... and build a fit
image with the dtc binary not being the the default path.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Simon Glass <sjg@chromium.org>
---
tools/fit_image.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_
}
*cmd = '\0';
} else if (params->datafile) {
+ const char* dtc = getenv("DTC");
+
+ if (!dtc)
+ dtc = MKIMAGE_DTC;
+
/* dtc -I dts -O dtb -p 500 datafile > tmpfile */
snprintf(cmd, sizeof(cmd), "%s %s %s > %s",
- MKIMAGE_DTC, params->dtc, params->datafile, tmpfile);
+ dtc, params->dtc, params->datafile, tmpfile);
debug("Trying to execute \"%s\"\n", cmd);
} else {
snprintf(cmd, sizeof(cmd), "cp %s %s",

View File

@ -0,0 +1,89 @@
From eed65e5c25cbc4b6e893f140e9d7898f4624c114 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 19 Jul 2017 23:12:38 +0200
Subject: [PATCH 210/213] Revert "fdt: Makefile: Build python libfdt library if
needed"
This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5.
---
Makefile | 17 ++---------------
scripts/Makefile.spl | 17 ++++-------------
2 files changed, 6 insertions(+), 28 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
- $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE
+ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
$(call if_changed,binman)
OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
@@ -1125,8 +1125,7 @@ u-boot-x86-16bit.bin: u-boot FORCE
endif
ifneq ($(CONFIG_ARCH_SUNXI),)
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \
- checkbinman FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
$(call if_changed,binman)
endif
@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea
$(timestamp_h): $(srctree)/Makefile FORCE
$(call filechk,timestamp.h)
-checkbinman: tools
- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \
- echo >&2; \
- echo >&2 '*** binman needs the Python libfdt library.'; \
- echo >&2 '*** Either install it on your system, or try:'; \
- echo >&2 '***'; \
- echo >&2 '*** sudo apt-get install swig libpython-dev'; \
- echo >&2 '***'; \
- echo >&2 '*** to have U-Boot build its own version.'; \
- false; \
- fi
-
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds = LDS $@
cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -257,12 +257,14 @@ PHONY += dts_dir
dts_dir:
$(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts)
-include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc
+include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc
$(call if_changed,dtoch)
-$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc
+$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc
$(call if_changed,dtocc)
+dtoc: #$(objtree)/tools/_libfdt.so
+
ifdef CONFIG_SAMSUNG
ifdef CONFIG_VAR_SIZE_SPL
VAR_SIZE_PARAM = --vs
@@ -355,17 +357,6 @@ ifneq ($(cmd_files),)
include $(cmd_files)
endif
-checkdtoc: tools
- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \
- echo '*** dtoc needs the Python libfdt library. Either '; \
- echo '*** install it on your system, or try:'; \
- echo '***'; \
- echo '*** sudo apt-get install swig libpython-dev'; \
- echo '***'; \
- echo '*** to have U-Boot build its own version.'; \
- false; \
- fi
-
PHONY += FORCE
FORCE:

View File

@ -0,0 +1,26 @@
From cdee74ad13e933631caf7f544c319d8e981c6063 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 20 Jul 2017 19:49:25 +0200
Subject: [PATCH 211/213] Revert "scripts/Makefile.lib: Always have
...-u-boot.dtsi be able to override"
This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88.
---
scripts/Makefile.lib | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
quiet_cmd_dtc = DTC $@
# Modified for U-Boot
-# Bring in any U-Boot-specific include at the end of the file
+# Bring in any U-Boot-specific include after the '/dts-v1/;' header
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
cat $< $(if $(u_boot_dtsi),\
- | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \
+ | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
$(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \

View File

@ -0,0 +1,21 @@
From 53d123333fa0ddc64b2c55d48366f4582ac6922d Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 20 Jul 2017 19:50:52 +0200
Subject: [PATCH 212/213] Revert "Avoid non-portable sed construct"
This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9.
---
scripts/Makefile.lib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC $@
# Bring in any U-Boot-specific include after the '/dts-v1/;' header
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
cat $< $(if $(u_boot_dtsi),\
- | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \
+ | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
$(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \

View File

@ -0,0 +1,58 @@
From cf1defd80b7594f6f2721ab2dacffe48522abfca Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 20 Jul 2017 19:51:01 +0200
Subject: [PATCH 213/213] Revert "sunxi: Use binman for sunxi boards"
This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c.
---
Makefile | 6 ++++--
arch/arm/dts/sunxi-u-boot.dtsi | 14 --------------
scripts/Makefile.lib | 4 ++--
3 files changed, 6 insertions(+), 18 deletions(-)
delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi
--- a/Makefile
+++ b/Makefile
@@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE
endif
ifneq ($(CONFIG_ARCH_SUNXI),)
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
- $(call if_changed,binman)
+OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
+ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
+ $(call if_changed,pad_cat)
endif
ifneq ($(CONFIG_TEGRA),)
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <config.h>
-
-/ {
- binman {
- filename = "u-boot-sunxi-with-spl.bin";
- pad-byte = <0xff>;
- blob {
- filename = "spl/sunxi-spl.bin";
- };
- u-boot-img {
- pos = <CONFIG_SPL_PAD_TO>;
- };
- };
-};
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC $@
# Modified for U-Boot
# Bring in any U-Boot-specific include after the '/dts-v1/;' header
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
- cat $< $(if $(u_boot_dtsi),\
- | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \
+ cat $< $(if $(u-boot-dtsi),\
+ | sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%') | \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
$(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \

View File

@ -0,0 +1,182 @@
From 1f92596cc520f760589289059a5aa739366dd19c Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Tue, 26 Sep 2017 22:16:59 +0200
Subject: sunxi: add device tree for Orange Pi R1 board
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 157 +++++++++++++++++++++++++++++
2 files changed, 158 insertions(+)
create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
sun8i-a83t-cubietruck-plus.dtb \
sun8i-a83t-sinovoip-bpi-m3.dtb
dtb-$(CONFIG_MACH_SUN8I_H3) += \
+ sun8i-h2-plus-orangepi-r1.dtb \
sun8i-h2-plus-orangepi-zero.dtb \
sun8i-h3-bananapi-m2-plus.dtb \
sun8i-h3-orangepi-2.dtb \
--- /dev/null
+++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2017 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Based on sun8i-h2-plus-orangepi-zero.dts, which is:
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun8i-h3-orangepi-one.dts, which is:
+ * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-h3.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+ model = "Xunlong Orange Pi R1";
+ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus";
+
+ aliases {
+ serial0 = &uart0;
+ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+ ethernet1 = &xr819;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ pwr_led {
+ label = "orangepi:green:pwr";
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+ default-state = "on";
+ };
+
+ status_led {
+ label = "orangepi:red:status";
+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ reg_vcc_wifi: reg_vcc_wifi {
+ compatible = "regulator-fixed";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-wifi";
+ enable-active-high;
+ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+ };
+
+ wifi_pwrseq: wifi_pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
+ };
+};
+
+&ehci1 {
+ status = "okay";
+};
+
+&emac {
+ phy = <&phy1>;
+ phy-mode = "mii";
+ allwinner,use-internal-phy;
+ allwinner,leds-active-low;
+ status = "okay";
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+};
+
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_a>;
+ vmmc-supply = <&reg_vcc3v3>;
+ bus-width = <4>;
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+ cd-inverted;
+ status = "okay";
+};
+
+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins_a>;
+ vmmc-supply = <&reg_vcc_wifi>;
+ mmc-pwrseq = <&wifi_pwrseq>;
+ bus-width = <4>;
+ non-removable;
+ status = "okay";
+
+ /*
+ * Explicitly define the sdio device, so that we can add an ethernet
+ * alias for it (which e.g. makes u-boot set a mac-address).
+ */
+ xr819: sdio_wifi@1 {
+ reg = <1>;
+ };
+};
+
+&ohci1 {
+ status = "okay";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
+ status = "okay";
+};
+
+&usbphy {
+ /* USB VBUS is always on */
+ status = "okay";
+};

Some files were not shown because too many files have changed in this diff Show More