Merge branch 'master' of github.com:lede-project/source

This commit is contained in:
coolsnowwolf 2018-04-23 18:50:49 +08:00
parent 4e26d13bff
commit 8fe0636b8a
2178 changed files with 111806 additions and 159810 deletions

5378
4m.config

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ menu "Global build settings"
default n
config BUILD_PATENTED
default y
default n
bool "Compile with support for patented functionality"
help
When this option is disabled, software which provides patented functionality

View File

@ -90,13 +90,14 @@ menuconfig DEVEL
In this instance, the --reference option of git clone will
be used thus creating a quick local clone of your repo.
config KERNEL_GIT_BRANCH
string "Enter git branch to clone" if DEVEL
config KERNEL_GIT_REF
string "Enter git ref at which to checkout" if DEVEL
depends on (KERNEL_GIT_CLONE_URI != "")
default ""
help
Enter the branch name to checkout after cloning the git repository.
In this instance, the --branch option of git clone will be used.
Enter the git ref at which to checkout the git repository
after it is cloned, and before making it a tar-ball.
It can be a git hash or a branch name.
If unused, the clone's repository HEAD will be checked-out.
config BUILD_LOG

View File

@ -18,7 +18,6 @@ menu "Target Images"
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_LZMA if TARGET_ipq40xx
default TARGET_INITRAMFS_COMPRESSION_NONE
depends on TARGET_ROOTFS_INITRAMFS
help
@ -53,6 +52,13 @@ menu "Target Images"
help
Kernel uses specified external cpio as INITRAMFS_SOURCE.
config TARGET_INITRAMFS_FORCE
bool "Force"
depends on TARGET_ROOTFS_INITRAMFS
default n
help
Ignore the initramfs passed by the bootloader.
comment "Root filesystem archives"
config TARGET_ROOTFS_CPIOGZ
@ -63,7 +69,7 @@ menu "Target Images"
config TARGET_ROOTFS_TARGZ
bool "tar.gz"
default n
default n if USES_TARGZ
help
Build a compressed tar archive of the root filesystem.
@ -71,7 +77,7 @@ menu "Target Images"
menuconfig TARGET_ROOTFS_EXT4FS
bool "ext4"
default n
default n if USES_EXT4
help
Build an ext4 root filesystem.
@ -116,7 +122,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.
@ -143,7 +149,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"
@ -186,30 +192,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
@ -220,14 +218,14 @@ 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
depends on GRUB_IMAGES
default "0"
help
If you don't know, 5 seconds is a reasonable default.
@ -235,29 +233,22 @@ menu "Target Images"
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
default y
depends on GRUB_IMAGES || EFI_IMAGES
select GRUB_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-e1000
config VHD_IMAGES
bool "Build Hyper-V image files (VHD)"
depends on TARGET_x86 || TARGET_x86_64
default n
depends on GRUB_IMAGES || EFI_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-tulip
default y
config TARGET_IMAGES_PAD
bool "Pad images to filesystem size (for JFFS2)"
depends on GRUB_IMAGES || EFI_IMAGES
depends on GRUB_IMAGES
default y
config TARGET_IMAGES_GZIP
bool "GZip images"
@ -270,19 +261,19 @@ menu "Target Images"
config TARGET_KERNEL_PARTSIZE
int "Kernel partition size (in MB)"
depends on GRUB_IMAGES || EFI_IMAGES
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
depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml
default 90
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

@ -42,15 +42,20 @@ config KERNEL_DEBUG_FS
write to these files. Many common debugging facilities, such as
ftrace, require the existence of debugfs.
config KERNEL_MIPS_FPU_EMULATOR
bool "Compile the kernel with MIPS FPU Emulator"
default y if TARGET_pistachio
depends on (mips || mipsel || mips64 || mips64el)
config KERNEL_ARM_PMU
bool
default n
depends on (arm || arm64)
depends on (arm || aarch64)
config KERNEL_PERF_EVENTS
bool "Compile the kernel with performance events and counters"
default n
select KERNEL_ARM_PMU if (arm || arm64)
select KERNEL_ARM_PMU if (arm || aarch64)
config KERNEL_PROFILING
bool "Compile the kernel with profiling enabled"

View File

@ -1,9 +1,9 @@
src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
#src-git telephony https://git.openwrt.org/feed/telephony.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git management https://github.com/openwrt-management/packages.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
#src-link custom /usr/src/openwrt/custom-feed

View File

@ -23,8 +23,6 @@ ifneq ($(CONFIG_PER_FEED_REPO),)
endif
endif
PACKAGE_DIR_ALL := $(TOPDIR)/staging_dir/packages/$(BOARD)
opkg_package_files = $(wildcard \
$(foreach dir,$(PACKAGE_SUBDIRS), \
$(foreach pkg,$(1), $(dir)/$(pkg)_*.ipk)))

View File

@ -0,0 +1,2 @@
*self_spec:
+ %{no-pie|static|r|shared:;:-pie}

View File

@ -6,6 +6,7 @@
#
PKG_CHECK_FORMAT_SECURITY ?= 1
PKG_ASLR_PIE ?= 1
PKG_SSP ?= 1
PKG_FORTIFY_SOURCE ?= 1
PKG_RELRO ?= 1
@ -15,6 +16,12 @@ ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY
TARGET_CFLAGS += -Wformat -Werror=format-security
endif
endif
ifdef CONFIG_PKG_ASLR_PIE
ifeq ($(strip $(PKG_ASLR_PIE)),1)
TARGET_CFLAGS += -fPIC
TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs
endif
endif
ifdef CONFIG_PKG_CC_STACKPROTECTOR_REGULAR
ifeq ($(strip $(PKG_SSP)),1)
TARGET_CFLAGS += -fstack-protector

View File

@ -52,6 +52,7 @@ endef
HOST_CONFIGURE_VARS = \
CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS)" \
CXX="$(HOSTCXX)" \
CPPFLAGS="$(HOST_CPPFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
CONFIG_SHELL="$(SHELL)"

View File

@ -7,7 +7,7 @@ define Build/uImage
mkimage -A $(LINUX_KARCH) \
-O linux -T kernel \
-C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION))' -d $@ $@.new
-n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' -d $@ $@.new
mv $@.new $@
endef
@ -60,7 +60,7 @@ endef
define Build/netgear-dni
$(STAGING_DIR_HOST)/bin/mkdniimg \
-B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \
-B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(REVISION) \
$(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \
-r "$(1)" \
-i $@ -o $@.new
@ -77,16 +77,17 @@ define Build/append-squashfs-fakeroot-be
cat $@.fakesquashfs >> $@
endef
# append a fake/empty rootfs uImage header, to fool the bootloaders
# rootfs integrity check
define Build/append-uImage-fakeroot-hdr
rm -f $@.fakeroot
# append a fake/empty uImage header, to fool bootloaders rootfs integrity check
# for example
define Build/append-uImage-fakehdr
touch $@.fakehdr
$(STAGING_DIR_HOST)/bin/mkimage \
-A $(LINUX_KARCH) -O linux -T filesystem -C none \
-n '$(call toupper,$(LINUX_KARCH)) OpenWrt fakeroot' \
-A $(LINUX_KARCH) -O linux -T $(1) -C none \
-n '$(VERSION_DIST) fake $(1)' \
-d $@.fakehdr \
-s \
$@.fakeroot
cat $@.fakeroot >> $@
$@.fakehdr
cat $@.fakehdr >> $@
endef
define Build/tplink-safeloader
@ -113,16 +114,12 @@ 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 $@ \
$(if $(word 2,$(1)),-d $(word 2,$(1))) -C $(word 1,$(1)) \
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv $@.new $@
@ -138,7 +135,7 @@ define Build/lzma-no-dict
endef
define Build/gzip
gzip -9n -c $@ $(1) > $@.new
gzip --force -9n -c $@ $(1) > $@.new
@mv $@.new $@
endef

View File

@ -18,10 +18,8 @@ ifndef IB
endif
include $(INCLUDE_DIR)/image-legacy.mk
ifdef TARGET_PER_DEVICE_ROOTFS
include $(INCLUDE_DIR)/rootfs.mk
endif
include $(INCLUDE_DIR)/feeds.mk
include $(INCLUDE_DIR)/rootfs.mk
override MAKE:=$(_SINGLE)$(SUBMAKE)
override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
@ -136,12 +134,13 @@ endef
define Image/BuildKernel/MkuImage
mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
-n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5)
-n '$(call toupper,$(ARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' -d $(4) $(5)
endef
define Image/BuildKernel/MkFIT
$(TOPDIR)/scripts/mkits.sh \
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
endef
@ -261,10 +260,7 @@ define Image/mkfs/ext4
endef
define Image/Manifest
$(STAGING_DIR_HOST)/bin/opkg \
--offline-root $(TARGET_DIR) \
--add-arch all:100 \
--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 list-installed > \
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
endef
@ -305,7 +301,7 @@ target-dir-%: FORCE
$(call opkg_package_files,$(mkfs_packages_add)))
-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
$(call prepare_rootfs,$(mkfs_cur_target_dir))
$(call prepare_rootfs,$(mkfs_cur_target_dir),$(TOPDIR)/files)
$(KDIR)/root.%: kernel_prepare
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
@ -352,6 +348,7 @@ define Device/Init
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
DEVICE_DTS :=
DEVICE_DTS_CONFIG :=
DEVICE_DTS_DIR :=
BOARD_NAME :=
@ -364,8 +361,8 @@ endef
DEFAULT_DEVICE_VARS := \
DEVICE_NAME KERNEL KERNEL_INITRAMFS KERNEL_SIZE KERNEL_INITRAMFS_IMAGE \
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
UBOOTENV_IN_UBI KERNEL_IN_UBI \
KERNEL_LOADADDR DEVICE_DTS DEVICE_DTS_CONFIG DEVICE_DTS_DIR BOARD_NAME \
CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI \
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
SUPPORTED_DEVICES IMAGE_METADATA

View File

@ -50,14 +50,10 @@ ifneq ($(strip $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)),"")
KERNEL_GIT_OPTS+=--reference $(CONFIG_KERNEL_GIT_LOCAL_REPOSITORY)
endif
ifneq ($(strip $(CONFIG_KERNEL_GIT_BRANCH)),"")
KERNEL_GIT_OPTS+=--branch $(CONFIG_KERNEL_GIT_BRANCH)
endif
define Download/git-kernel
URL:=$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI))
PROTO:=git
VERSION:=$(CONFIG_KERNEL_GIT_BRANCH)
VERSION:=$(CONFIG_KERNEL_GIT_REF)
FILE:=$(LINUX_SOURCE)
SUBDIR:=linux-$(LINUX_VERSION)
OPTS:=$(KERNEL_GIT_OPTS)

View File

@ -63,7 +63,6 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Kernel/SetInitramfs/PreConfigure)
echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config
echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config
echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config

View File

@ -3,18 +3,29 @@
LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .112
LINUX_VERSION-4.9 = .77
LINUX_VERSION-4.14 = .32
LINUX_VERSION-4.4 = .121
LINUX_VERSION-4.9 = .91
LINUX_VERSION-4.14 = .34
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
LINUX_KERNEL_HASH-4.9.77 = 7c29bc3fb96f1e23d98f664e786dddd53a1599f56431b9b7fdfba402a4b3705c
LINUX_KERNEL_HASH-4.14.32 = cb0979bec663089a43b10cfbeae0cf9673544b0ff5968c33ede614ec0f43b680
LINUX_KERNEL_HASH-4.4.121 = 44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
LINUX_KERNEL_HASH-4.9.91 = 60caa752ec9fa1c426f6a2f37db3f268d0961b67a723b6443949112167b39832
LINUX_KERNEL_HASH-4.14.34 = 782b6c4c85275c382c820e1934d3e6003ef468f43cfc5e7c22bc07c331a12bb9
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
ifneq ($(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
LINUX_VERSION:=$(call sanitize_uri,$(call remove_uri_prefix,$(CONFIG_KERNEL_GIT_CLONE_URI)))
ifeq ($(call qstrip,$(CONFIG_KERNEL_GIT_REF)),)
CONFIG_KERNEL_GIT_REF:=HEAD
endif
LINUX_VERSION:=$(LINUX_VERSION)-$(call sanitize_uri,$(CONFIG_KERNEL_GIT_REF))
else
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
endif
endif
split_version=$(subst ., ,$(1))
merge_version=$(subst $(space),.,$(1))

View File

@ -225,8 +225,7 @@ $(call KernelPackage/$(1)/config)
$(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)),)
define Package/kmod-$(1)/install
define Package/kmod-$(1)/install
@for mod in $$(call version_filter,$$(FILES)); do \
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
echo "NOTICE: module '$$$$$$$$mod' is built-in."; \
@ -240,8 +239,7 @@ $(call KernelPackage/$(1)/config)
done;
$(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
endef
$(if $(CONFIG_PACKAGE_kmod-$(1)),
else
compile: $(1)-disabled

View File

@ -94,12 +94,14 @@ $(eval $(call nf_add,IPT_CONNTRACK_LABEL,CONFIG_NETFILTER_XT_MATCH_CONNLABEL, $(
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_ADDRTYPE, $(if $(NF_KMOD),$(P_XT)xt_addrtype,$(P_XT)ipt_addrtype)))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_OWNER, $(P_XT)xt_owner))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_PKTTYPE, $(P_XT)xt_pkttype))
$(eval $(call nf_add,IPT_EXTRA,CONFIG_NETFILTER_XT_MATCH_QUOTA, $(P_XT)xt_quota))
#$(eval $(call nf_add,IPT_EXTRA,CONFIG_IP_NF_TARGET_ROUTE, $(P_V4)ipt_ROUTE))
# physdev
$(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_physdev))
# filter
@ -371,6 +373,7 @@ IPT_BUILTIN += $(NF_CONNTRACK6-y)
IPT_BUILTIN += $(IPT_CONNTRACK-y)
IPT_BUILTIN += $(IPT_CONNTRACK_EXTRA-y)
IPT_BUILTIN += $(IPT_EXTRA-y)
IPT_BUILTIN += $(IPT_PHYSDEV-y)
IPT_BUILTIN += $(IPT_FILTER-y)
IPT_BUILTIN += $(IPT_FLOW-y) $(IPT_FLOW-m)
IPT_BUILTIN += $(IPT_IPOPT-y)

View File

@ -65,7 +65,7 @@ Build/Patch:=$(Build/Patch/Default)
ifneq ($(strip $(PKG_UNPACK)),)
define Build/Prepare/Default
$(PKG_UNPACK)
[ ! -d ./src/ ] || $(CP) ./src/* $(PKG_BUILD_DIR)
[ ! -d ./src/ ] || $(CP) ./src/. $(PKG_BUILD_DIR)
$(Build/Patch)
endef
endif

View File

@ -28,13 +28,15 @@ $(eval $(call TestHostCommand,proper-umask, \
$(eval $(call SetupHostCommand,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]?)', \
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc48 --version | grep gcc, \
gcc49 --version | grep gcc, \
gcc5 --version | grep gcc, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
gcc9 --version | grep gcc, \
gcc --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-gcc, \
@ -45,13 +47,15 @@ $(eval $(call TestHostCommand,working-gcc, \
$(eval $(call SetupHostCommand,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]?)', \
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++48 --version | grep g++, \
g++49 --version | grep g++, \
g++5 --version | grep g++, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
g++9 --version | grep g++, \
g++ --version | grep Apple.LLVM ))
$(eval $(call TestHostCommand,working-g++, \

View File

@ -90,7 +90,8 @@ define SetupHostCommand
for cmd in $(call QuoteHostCommand,$(3)) $(call QuoteHostCommand,$(4)) \
$(call QuoteHostCommand,$(5)) $(call QuoteHostCommand,$(6)) \
$(call QuoteHostCommand,$(7)) $(call QuoteHostCommand,$(8)) \
$(call QuoteHostCommand,$(9)); do \
$(call QuoteHostCommand,$(9)) $(call QuoteHostCommand,$(10)) \
$(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \
if [ -n "$$$$$$$$cmd" ]; then \
bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \
which "$$$$$$$${cmd%% *}")"; \

View File

@ -1,5 +1,3 @@
include $(INCLUDE_DIR)/feeds.mk
ifdef CONFIG_USE_MKLIBS
define mklibs
rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
@ -49,17 +47,25 @@ TARGET_DIR_ORIG := $(TARGET_ROOTFS_DIR)/root.orig-$(BOARD)
ifdef CONFIG_CLEAN_IPKG
define clean_ipkg
-find $(1)/usr/lib/opkg -type f -and -not -name '*.control' | $(XARGS) rm -rf
-find $(1)/usr/lib/opkg/info -type f -and -not -name '*.control' | $(XARGS) rm -rf
-sed -i -ne '/^Require-User: /p' $(1)/usr/lib/opkg/info/*.control
awk ' \
BEGIN { conffiles = 0; print "Conffiles:" } \
/^Conffiles:/ { conffiles = 1; next } \
!/^ / { conffiles = 0; next } \
conffiles == 1 { print } \
' $(1)/usr/lib/opkg/status >$(1)/usr/lib/opkg/status.new
mv $(1)/usr/lib/opkg/status.new $(1)/usr/lib/opkg/status
-find $(1)/usr/lib/opkg -empty | $(XARGS) rm -rf
endef
endif
define prepare_rootfs
@if [ -d $(TOPDIR)/files ]; then \
$(call file_copy,$(TOPDIR)/files/.,$(1)); \
fi
$(if $(2),@if [ -d '$(2)' ]; then \
$(call file_copy,$(2)/.,$(1)); \
fi)
@mkdir -p $(1)/etc/rc.d
@mkdir -p $(1)/var/lock
@( \
cd $(1); \
for script in ./usr/lib/opkg/info/*.postinst; do \
@ -83,7 +89,7 @@ define prepare_rootfs
rm -rf $(1)/tmp/*
rm -f $(1)/usr/lib/opkg/lists/*
rm -f $(1)/usr/lib/opkg/info/*.postinst*
rm -f $(1)/usr/lib/opkg/info/*.prerm*
rm -f $(1)/var/lock/*.lock
$(call clean_ipkg,$(1))
$(call mklibs,$(1))
endef

View File

@ -13,7 +13,7 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \
default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \
@ -76,6 +76,8 @@ define Profile
$(eval $(call ProfileDefault))
$(eval $(call Profile/$(1)))
dumpinfo : $(call shexport,Profile/$(1)/Description)
DEFAULT_PACKAGES := $(filter-out $(patsubst -%,%,$(filter -%,$(PACKAGES))),$(DEFAULT_PACKAGES))
PACKAGES := $(filter-out -%,$(PACKAGES))
DUMPINFO += \
echo "Target-Profile: $(1)"; \
$(if $(PRIORITY), echo "Target-Profile-Priority: $(PRIORITY)"; ) \
@ -196,6 +198,7 @@ ifeq ($(DUMP),1)
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
CPU_CFLAGS_cortex-a72 = -mcpu=cortex-a72
CPU_CFLAGS_fa526 = -mcpu=fa526
CPU_CFLAGS_mpcore = -mcpu=mpcore
CPU_CFLAGS_xscale = -mcpu=xscale
@ -277,9 +280,7 @@ ifeq ($(DUMP),1)
FEATURES += virtio
endif
ifneq ($(CONFIG_CPU_MIPS32_R2),)
ifneq ($(CPU_SUBTYPE),nomips16)
FEATURES += mips16
endif
FEATURES += mips16
endif
FEATURES += $(foreach v,6 7,$(if $(CONFIG_CPU_V$(v)),arm_v$(v)))

View File

@ -42,8 +42,8 @@ TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
UBOOT_MAKE_FLAGS = \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \
HOSTLDFLAGS=""
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
HOSTLDFLAGS="$(HOST_LDFLAGS)"
define Build/U-Boot/Target
$(eval $(call U-Boot/Init,$(1)))

View File

@ -22,40 +22,37 @@ PKG_CONFIG_DEPENDS += \
CONFIG_VERSION_SUPPORT_URL \
CONFIG_VERSION_HWREV \
qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
#'
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots)
VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))
VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER))
VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL))
VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL))
VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://lede-project.org/)
VERSION_BUG_URL:=$(call qstrip_escape,$(CONFIG_VERSION_BUG_URL))
VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL))
VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.lede-project.org/)
VERSION_SUPPORT_URL:=$(call qstrip_escape,$(CONFIG_VERSION_SUPPORT_URL))
VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://forum.lede-project.org/)
VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
VERSION_PRODUCT:=$(call qstrip,$(CONFIG_VERSION_PRODUCT))
VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
VERSION_HWREV:=$(call qstrip,$(CONFIG_VERSION_HWREV))
VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
define taint2sym
@ -82,23 +79,28 @@ VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \
-e 's,%V,$(VERSION_NUMBER),g' \
-e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \
-e 's,%C,$(VERSION_CODE),g' \
-e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \
-e 's,%D,$(VERSION_DIST),g' \
-e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \
-e 's,%R,$(REVISION),g' \
-e 's,%T,$(BOARD),g' \
-e 's,%S,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic),g' \
-e 's,%A,$(ARCH_PACKAGES),g' \
-e 's,%t,$(VERSION_TAINTS),g' \
-e 's,%M,$(VERSION_MANUFACTURER),g' \
-e 's,%m,$(VERSION_MANUFACTURER_URL),g' \
-e 's,%b,$(VERSION_BUG_URL),g' \
-e 's,%s,$(VERSION_SUPPORT_URL),g' \
-e 's,%P,$(VERSION_PRODUCT),g' \
-e 's,%h,$(VERSION_HWREV),g'
# escape commas, backslashes, squotes, and ampersands for sed
define sed_escape
$(subst &,\&,$(subst $(comma),\$(comma),$(subst ','\'',$(subst \,\\,$(1)))))
endef
#'
VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \
-e 's,%V,$(call sed_escape,$(VERSION_NUMBER)),g' \
-e 's,%v,\L$(call sed_escape,$(subst $(space),_,$(VERSION_NUMBER))),g' \
-e 's,%C,$(call sed_escape,$(VERSION_CODE)),g' \
-e 's,%c,\L$(call sed_escape,$(subst $(space),_,$(VERSION_CODE))),g' \
-e 's,%D,$(call sed_escape,$(VERSION_DIST)),g' \
-e 's,%d,\L$(call sed_escape,$(subst $(space),_,$(VERSION_DIST))),g' \
-e 's,%R,$(call sed_escape,$(REVISION)),g' \
-e 's,%T,$(call sed_escape,$(BOARD)),g' \
-e 's,%S,$(call sed_escape,$(BOARD)/$(if $(SUBTARGET),$(SUBTARGET),generic)),g' \
-e 's,%A,$(call sed_escape,$(ARCH_PACKAGES)),g' \
-e 's,%t,$(call sed_escape,$(VERSION_TAINTS)),g' \
-e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \
-e 's,%m,$(call sed_escape,$(VERSION_MANUFACTURER_URL)),g' \
-e 's,%b,$(call sed_escape,$(VERSION_BUG_URL)),g' \
-e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \
-e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \
-e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g'
VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED))

View File

@ -7,6 +7,7 @@
curdir:=package
include $(INCLUDE_DIR)/feeds.mk
include $(INCLUDE_DIR)/rootfs.mk
-include $(TMP_DIR)/.packagedeps
@ -75,7 +76,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
$(call prepare_rootfs,$(TARGET_DIR))
$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
$(curdir)/index: FORCE
@echo Generating package index...

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=183
PKG_RELEASE:=190
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
@ -65,8 +65,6 @@ define Package/base-files/conffiles
/etc/shadow
/etc/shells
/etc/sysctl.conf
/etc/sysctl.d/
/etc/sysctl.d/local.conf
/etc/sysupgrade.conf
$(call $(TARGET)/conffiles)
endef
@ -137,7 +135,7 @@ define Package/base-files/install
fi; \
)
$(VERSION_SED) \
$(VERSION_SED_SCRIPT) \
$(1)/etc/banner \
$(1)/etc/openwrt_version \
$(1)/usr/lib/os-release
@ -171,7 +169,7 @@ define Package/base-files/install
mkdir -p $(1)/root
$(LN) /proc/mounts $(1)/etc/mtab
rm -f $(1)/var
$(LN) /tmp $(1)/var
$(LN) tmp $(1)/var
mkdir -p $(1)/etc
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
@ -194,7 +192,7 @@ define Package/base-files/install
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
$(VERSION_SED) $(1)/etc/opkg/distfeeds.conf)
$(VERSION_SED_SCRIPT) $(1)/etc/opkg/distfeeds.conf)
endef
ifneq ($(DUMP),1)

View File

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$ACTION" = add ]; then
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
[ ! -f "$CONF" ] && continue;
sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
sysctl -e -p - | logger -t sysctl

View File

@ -23,8 +23,15 @@ load_gpio_switch()
# we need to wait a bit until the GPIO appears
[ -d "$gpio_path" ] || sleep 1
}
# set the pin to output with high or low pin value
{ [ "$value" = "0" ] && echo "high" || echo "low"; } >"$gpio_path/direction"
# direction attribute only exists if the kernel supports changing the
# direction of a GPIO
if [ -e "${gpio_path}/direction" ]; then
# set the pin to output with high or low pin value
{ [ "$value" = "0" ] && echo "low" || echo "high"; } >"$gpio_path/direction"
else
{ [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
fi
}
service_triggers()

View File

@ -3,23 +3,42 @@
START=11
set_vm_min_free() {
mem="$(grep MemTotal /proc/meminfo | awk '{print $2}')"
apply_defaults() {
local mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
local min_free frag_low_thresh frag_high_thresh
if [ "$mem" -gt 65536 ]; then # 128M
val=16384
min_free=16384
elif [ "$mem" -gt 32768 ]; then # 64M
val=8192
elif [ "$mem" -gt 16384 ]; then # 32M
val=1024
min_free=8192
else
return
min_free=1024
frag_low_thresh=393216
frag_high_thresh=524288
fi
sysctl -qw vm.min_free_kbytes="$min_free"
[ "$frag_low_thresh" ] && sysctl -qw \
net.ipv4.ipfrag_low_thresh="$frag_low_thresh" \
net.ipv4.ipfrag_high_thresh="$frag_high_thresh" \
net.ipv6.ip6frag_low_thresh="$frag_low_thresh" \
net.ipv6.ip6frag_high_thresh="$frag_high_thresh" \
net.netfilter.nf_conntrack_frag6_low_thresh="$frag_low_thresh" \
net.netfilter.nf_conntrack_frag6_high_thresh="$frag_high_thresh"
# first set default, then all interfaces to avoid races with appearing interfaces
if [ -d /proc/sys/net/ipv6/conf ]; then
echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra
for iface in /proc/sys/net/ipv6/conf/*/accept_ra; do
echo 0 > "$iface"
done
fi
sysctl -qw vm.min_free_kbytes="$val"
}
start() {
set_vm_min_free
for CONF in /etc/sysctl.conf /etc/sysctl.d/*.conf; do
apply_defaults
for CONF in /etc/sysctl.d/*.conf /etc/sysctl.conf; do
[ -f "$CONF" ] && sysctl -p "$CONF" -e >&-
done
}

View File

@ -20,7 +20,7 @@ released)
echo "REBOOT" > /dev/console
sync
reboot
elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ]
elif [ "$SEEN" -ge 5 -a -n "$OVERLAY" ]
then
echo "FACTORY RESET" > /dev/console
jffs2reset -y && reboot &

View File

@ -1,31 +1 @@
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
net.ipv4.ip_forward=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.igmp_max_memberships=100
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_dsack=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
net.netfilter.nf_conntrack_acct=1
net.netfilter.nf_conntrack_checksum=0
net.netfilter.nf_conntrack_max=16384
net.netfilter.nf_conntrack_tcp_timeout_established=7440
net.netfilter.nf_conntrack_udp_timeout=60
net.netfilter.nf_conntrack_udp_timeout_stream=180
# disable bridge firewalling by default
net.bridge.bridge-nf-call-arptables=0
net.bridge.bridge-nf-call-ip6tables=0
net.bridge.bridge-nf-call-iptables=0
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file

View File

@ -0,0 +1,24 @@
# Do not edit, changes to this file will be lost on upgrades
# /etc/sysctl.conf can be used to customize sysctl settings
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
net.ipv4.ip_forward=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.igmp_max_memberships=100
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_dsack=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
net.netfilter.nf_conntrack_helper = 1

View File

@ -1 +0,0 @@
# local sysctl settings can be stored in this directory

View File

@ -1,16 +0,0 @@
#!/bin/sh
if [ ! -f "/rom/etc/sysctl.conf" ] || cmp -s "/rom/etc/sysctl.conf" "/etc/sysctl.conf"; then
exit 0
fi
fingerprint="$(md5sum /etc/sysctl.conf)"
fingerprint="${fingerprint%% *}"
if [ "$fingerprint" = "1b05ebb41f72cb84e5510573cd4aca26" ] || \
[ "$fingerprint" = "62deb895be1a7f496040187b7c930e4e" ]; then
logger -t migrate-sysctl "Updating sysctl.conf to use current defaults"
cp "/rom/etc/sysctl.conf" "/etc/sysctl.conf"
fi
exit 0

View File

@ -153,16 +153,6 @@ config_list_foreach() {
done
}
insert_modules() {
for m in $*; do
if [ -f /etc/modules.d/$m ]; then
sed 's/^[^#]/insmod &/' /etc/modules.d/$m | ash 2>&- || :
else
modprobe $m
fi
done
}
default_prerm() {
local root="${IPKG_INSTROOT}"
local name

View File

@ -8,7 +8,9 @@ get_dt_led() {
local nodepath="$basepath/aliases/led-$1"
[ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
[ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label")
[ -n "$ledpath" ] && \
label=$(cat "$basepath$ledpath/label" 2>/dev/null) || \
label=$(cat "$basepath$ledpath/chan-name" 2>/dev/null)
echo "$label"
}

View File

@ -1,5 +1,17 @@
# Copyright (C) 2006-2013 OpenWrt.org
get_mac_binary() {
local path="$1"
local offset="$2"
if [ -z "$path" ]; then
echo "get_mac_binary: file $path not found!" >&2
return
fi
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' $path 2>/dev/null
}
find_mtd_chardev() {
local INDEX=$(find_mtd_index "$1")
local PREFIX=/dev/mtd
@ -33,12 +45,7 @@ mtd_get_mac_binary() {
local part
part=$(find_mtd_part "$mtdname")
if [ -z "$part" ]; then
echo "mtd_get_mac_binary: partition $mtdname not found!" >&2
return
fi
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' $part 2>/dev/null
get_mac_binary "$part" "$offset"
}
mtd_get_mac_binary_ubi() {

View File

@ -101,7 +101,7 @@ get_magic_long() {
}
export_bootdevice() {
local cmdline uuid disk uevent
local cmdline uuid disk uevent line
local MAJOR MINOR DEVNAME DEVTYPE
if read cmdline < /proc/cmdline; then
@ -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*51225612816)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \
for(i=1;i<9;i=i2) first=substr($0,i,1) substr($0,i1,1) first; \
for(i=9;i<13;i=i2) second=substr($0,i,1) substr($0,i1,1) second; \
for(i=13;i<16;i=i2) third=substr($0,i,1) substr($0,i1,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}"
@ -152,8 +134,9 @@ export_bootdevice() {
esac
if [ -e "$uevent" ]; then
. "$uevent"
while read line; do
export -n "$line"
done < "$uevent"
export BOOTDEV_MAJOR=$MAJOR
export BOOTDEV_MINOR=$MINOR
return 0
@ -165,10 +148,12 @@ export_bootdevice() {
export_partdevice() {
local var="$1" offset="$2"
local uevent MAJOR MINOR DEVNAME DEVTYPE
local uevent line MAJOR MINOR DEVNAME DEVTYPE
for uevent in /sys/class/block/*/uevent; do
. "$uevent"
while read line; do
export -n "$line"
done < "$uevent"
if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then
export "$var=$DEVNAME"
return 0

View File

@ -96,12 +96,31 @@ EOF
# prevent messages from clobbering the tarball when using stdout
[ "$CONF_BACKUP" = "-" ] && export VERBOSE=0
list_conffiles() {
awk '
BEGIN { conffiles = 0 }
/^Conffiles:/ { conffiles = 1; next }
!/^ / { conffiles = 0; next }
conffiles == 1 { print }
' /usr/lib/opkg/status
}
list_changed_conffiles() {
# Cannot handle spaces in filenames - but opkg cannot either...
list_conffiles | while read file csum; do
[ -r "$file" ] || continue
echo "${csum} ${file}" | sha256sum -sc - || echo "$file"
done
}
add_uci_conffiles() {
local file="$1"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
-type f -o -type l 2>/dev/null;
opkg list-changed-conffiles ) | sort -u > "$file"
list_changed_conffiles ) | sort -u > "$file"
return 0
}

View File

@ -12,9 +12,9 @@ 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_SOURCE_DATE:=2018-02-04
PKG_SOURCE_VERSION:=ae78724247a01560164d607ed66db111c74d8df0
PKG_MIRROR_HASH:=e4ddc3294f86c1e163d683a2322427bbdd5b63762ead4b1792b34df75d7bda28
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=license.md
@ -38,12 +38,11 @@ MAKE_VARS = \
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
$(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin
endef
define Package/arm-trusted-firmware-sunxi/install

View File

@ -26,7 +26,7 @@ TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
AT91BOOTSTRAP_MAKE_FLAGS = \
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
HOSTLDFLAGS=""
define Build/AT91Bootstrap/Target

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 += \
@ -37,7 +60,8 @@ CONFIGURE_ARGS += \
--disable-nls \
--disable-device-mapper \
--disable-libzfs \
--disable-grub-mkfont
--disable-grub-mkfont \
--with-platform=none
HOST_CONFIGURE_VARS += \
grub_build_mkfont_excuse="don't want fonts"
@ -59,3 +83,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

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.14
PKG_VERSION:=2.0.16
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6
PKG_HASH:=5b103351ad752c9badd1d65b00eb6de4bce579f944f4df4e3ef3a755ba567010
PKG_FIXUP:=autoreconf

View File

@ -43,8 +43,10 @@ run_kdump() {
timestamp=$(date "+%Y%m%dT%H%M%S")
if [ "$save_vmcore" -eq 1 ]; then
echo -n "Saving vmcore (this may take a while)..."
# would like 'sparse' but busybox doesn't support it
dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M
echo " done"
fi
if [ "$save_dmesg" -eq 1 ]; then

View File

@ -1,20 +0,0 @@
--- a/kexec/arch/i386/kexec-elf-x86.c
+++ b/kexec/arch/i386/kexec-elf-x86.c
@@ -296,6 +296,6 @@ out:
free(command_line);
free(modified_cmdline);
if (error_msg)
- die(error_msg);
+ die("%s", error_msg);
return result;
}
--- a/kexec/arch/x86_64/kexec-elf-x86_64.c
+++ b/kexec/arch/x86_64/kexec-elf-x86_64.c
@@ -276,6 +276,6 @@ out:
free(command_line);
free(modified_cmdline);
if (error_msg)
- die(error_msg);
+ die("%s", error_msg);
return result;
}

View File

@ -1,11 +0,0 @@
--- a/vmcore-dmesg/vmcore-dmesg.c
+++ b/vmcore-dmesg/vmcore-dmesg.c
@@ -1,6 +1,8 @@
#define _XOPEN_SOURCE 600
#define _LARGEFILE_SOURCE 1
#define _FILE_OFFSET_BITS 64
+#define _GNU_SOURCE
+
#include <endian.h>
#include <byteswap.h>
#include <stdio.h>

View File

@ -1,33 +0,0 @@
commit 263e45ccf27b21e9862cc538ed28978533d04e4b
Author: Baoquan He <bhe@redhat.com>
Date: Fri Mar 3 11:52:15 2017 +0800
Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
Kernel symbol page_offset_base could be unavailable when mm KASLR code is
not compiled in kernel. It's inappropriate to print out error message
when failed to search for page_offset_base from /proc/kallsyms. Seems now
there is not a way to find out if mm KASLR is compiled in or not. An
alternative approach is only printing out debug message in get_kernel_sym
if failed to search a expected kernel symbol.
Do it in this patch, a simple fix.
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Pratyush Anand <panand@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 88aeee3..c4cf201 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
}
- fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
+ dbgprintf("Cannot get kernel %s symbol address\n", symbol);
return 0;
}

View File

@ -1,178 +0,0 @@
commit f14881e87b1426d2c439e2fad9a1e03a3b35e196
Author: Philip Prindeville <philipp@redfish-solutions.com>
Date: Fri Mar 10 19:57:11 2017 -0700
Don't use %L width specifier with integer values
MUSL doesn't support %L except for floating-point arguments; therefore,
%ll must be used instead with integer arguments.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
diff --git a/kexec/arch/arm/kexec-arm.c b/kexec/arch/arm/kexec-arm.c
index 2194b7c..49f35b1 100644
--- a/kexec/arch/arm/kexec-arm.c
+++ b/kexec/arch/arm/kexec-arm.c
@@ -47,7 +47,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index c4cf201..285dea9 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -119,7 +119,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
while(fgets(line, sizeof(line), fp) != NULL) {
- if (sscanf(line, "%Lx %c %s", &vaddr, &type, sym) != 3)
+ if (sscanf(line, "%llx %c %s", &vaddr, &type, sym) != 3)
continue;
if (strcmp(sym, symbol) == 0) {
dbgprintf("kernel symbol %s vaddr = %16llx\n", symbol, vaddr);
@@ -296,12 +296,12 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges,
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
- dbgprintf("%016Lx-%016Lx : %s",
+ dbgprintf("%016llx-%016llx : %s",
start, end, str);
/* Only Dumping memory of type System RAM. */
if (memcmp(str, "System RAM\n", 11) == 0) {
@@ -778,7 +778,7 @@ static int get_crash_notes(int cpu, uint64_t *addr, uint64_t *len)
*addr = x86__pa(vaddr + (cpu * MAX_NOTE_BYTES));
*len = MAX_NOTE_BYTES;
- dbgprintf("crash_notes addr = %Lx\n",
+ dbgprintf("crash_notes addr = %llx\n",
(unsigned long long)*addr);
fclose(fp);
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index 3e97239..be03618 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -81,7 +81,7 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *ranges
int count;
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/ia64/kexec-elf-rel-ia64.c b/kexec/arch/ia64/kexec-elf-rel-ia64.c
index 7f7c08c..500f247 100644
--- a/kexec/arch/ia64/kexec-elf-rel-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-rel-ia64.c
@@ -155,6 +155,6 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr,
}
return;
overflow:
- die("overflow in relocation type %lu val %Lx\n",
+ die("overflow in relocation type %lu val %llx\n",
r_type, value);
}
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index 9c33599..6308ec8 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -173,7 +173,7 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
int type, consumed, count;
if (memory_ranges >= CRASH_MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n",
+ count = sscanf(line, "%llx-%llx : %n",
&start, &end, &consumed);
if (count != 2)
continue;
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index ee3cd3a..2e5b700 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -48,7 +48,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
while (fgets(line, sizeof(line), fp) != 0) {
if (memory_ranges >= MAX_MEMORY_RANGES)
break;
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;
diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
index f863483..33ba6b9 100644
--- a/kexec/arch/s390/kexec-s390.c
+++ b/kexec/arch/s390/kexec-s390.c
@@ -170,7 +170,7 @@ int get_memory_ranges_s390(struct memory_range memory_range[], int *ranges,
if (current_range == MAX_MEMORY_RANGES)
break;
- sscanf(line,"%Lx-%Lx : %n", &start, &end, &cons);
+ sscanf(line,"%llx-%llx : %n", &start, &end, &cons);
str = line+cons;
if ((memcmp(str, sys_ram, strlen(sys_ram)) == 0) ||
((memcmp(str, crash_kernel, strlen(crash_kernel)) == 0) &&
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 15c1105..0b363c5 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -98,7 +98,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
}
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
- count = sscanf(line, "%Lx", &temp);
+ count = sscanf(line, "%llx", &temp);
if (count != 1)
die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
*addr = (uint64_t) temp;
@@ -112,7 +112,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
- count = sscanf(line, "%Lu", &temp);
+ count = sscanf(line, "%llu", &temp);
if (count != 1)
die("Cannot parse %s: %s\n",
crash_notes_size, strerror(errno));
@@ -120,7 +120,7 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
fclose(fp);
}
- dbgprintf("%s: crash_notes addr = %Lx, size = %Lu\n", __FUNCTION__,
+ dbgprintf("%s: crash_notes addr = %llx, size = %llu\n", __FUNCTION__,
(unsigned long long)*addr, (unsigned long long)*len);
return 0;
@@ -141,7 +141,7 @@ static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
if (!fgets(line, sizeof(line), fp))
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
- count = sscanf(line, "%Lx %Lx", &temp, &temp2);
+ count = sscanf(line, "%llx %llx", &temp, &temp2);
if (count != 2)
die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
index 485a2e8..7ec3853 100644
--- a/kexec/kexec-iomem.c
+++ b/kexec/kexec-iomem.c
@@ -44,7 +44,7 @@ int kexec_iomem_for_each_line(char *match,
die("Cannot open %s\n", iomem);
while(fgets(line, sizeof(line), fp) != 0) {
- count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
+ count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
if (count != 2)
continue;
str = line + consumed;

View File

@ -1,9 +0,0 @@
config UBOOT_ENVTOOLS_UBI
bool "Support environment in UBI volume"
depends on PACKAGE_uboot-envtools
default TARGET_oxnas
help
Add support for reading and writing U-Boot environment
stored in UBI volume(s).
Increases binary size by about 8 kB

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-envtools
PKG_DISTNAME:=u-boot
PKG_VERSION:=2015.10
PKG_VERSION:=2018.03
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
@ -17,7 +17,7 @@ PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=\
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd
PKG_BUILD_DEPENDS:=fstools
@ -42,13 +42,10 @@ define Package/uboot-envtools/description
This package includes tools to read and modify U-Boot bootloader environment.
endef
define Package/uboot-envtools/config
source "$(SOURCE)/Config.in"
endef
define Build/Configure
touch $(PKG_BUILD_DIR)/include/config.mk
touch $(PKG_BUILD_DIR)/include/config.h
mkdir -p $(PKG_BUILD_DIR)/include/config
touch $(PKG_BUILD_DIR)/include/config/auto.conf
mkdir -p $(PKG_BUILD_DIR)/include/generated
touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
endef
@ -59,10 +56,9 @@ define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE="$(TARGET_CROSS)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
dot-config=0 \
HOSTLDFLAGS= \
env
no-dot-config-targets=envtools \
envtools
endef
define Package/uboot-envtools/conffiles
@ -76,50 +72,11 @@ define Package/uboot-envtools/install
$(LN) fw_printenv $(1)/usr/sbin/fw_setenv
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
ifneq ($(CONFIG_TARGET_ar71xx),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_cns3xxx),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_imx6),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_ipq806x),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/ipq $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_kirkwood),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_lantiq),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_mvebu),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_mxs),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_oxnas),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_pistachio),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/pistachio $(1)/etc/uci-defaults/30_uboot-envtools
endif
ifneq ($(CONFIG_TARGET_ramips),)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
endif
$(if $(wildcard ./files/$(BOARD)), \
$(INSTALL_DATA) ./files/$(BOARD) \
$(1)/etc/uci-defaults/30_uboot-envtools \
)
endef
$(eval $(call BuildPackage,uboot-envtools))

View File

@ -28,6 +28,9 @@ cpe830|\
cpe870|\
cr3000|\
cr5000|\
e1700ac-v2|\
e600g-v2|\
e600gac-v2|\
eap300v2|\
ens202ext|\
gl-ar300m|\
@ -48,8 +51,11 @@ om5p-ac|\
om5p-acv2|\
om5p-an|\
r36a|\
rme-eg200|\
sr3200|\
t830|\
tube2h|\
wam250|\
wndr3700|\
xd3200)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"

View File

@ -0,0 +1,42 @@
#!/bin/sh
#
# Copyright (C) 2016 LEDE
#
[ -e /etc/config/ubootenv ] && exit 0
touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(board_name)
ubootenv_mtdinfo () {
UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
if [ -n "$nor_flash" ]; then
ubootenv_size=$mtd_size
else
# size is fixed to 0x40000 in u-boot
ubootenv_size=0x40000
fi
sectors=$(( $ubootenv_size / $mtd_erase ))
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}
case "$board" in
openmesh,a42)
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
;;
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
exit 0

View File

@ -34,9 +34,6 @@ case "$board" in
linksys,ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
;;
openmesh,a42)
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
;;
qcom,ipq8064-ap148 |\
qcom,ipq8064-db149)
ubootenv_add_uci_config $(ubootenv_mtdinfo)

View File

@ -22,6 +22,9 @@ armada-385-linksys-shelby)
armada-385-linksys-rango)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
armada-385-turris-omnia)
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
;;
armada-xp-linksys-mamba)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;

View File

@ -13,6 +13,10 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
alfa-network,ac1200rm|\
alfa-network,awusfree1)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
;;
all0239-3g|\
all0256n-4M|\
all0256n-8M|\
@ -27,7 +31,6 @@ wsr-600|\
zbt-wg2626)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
xiaomi,miwifi-r3|\
mir3g)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;;

View File

@ -2,7 +2,7 @@
+++ b/tools/env/Makefile
@@ -10,6 +10,10 @@
# with "CC" here for the maximum code reuse of scripts/Makefile.host.
HOSTCC = $(CC)
override HOSTCC = $(CC)
+ifneq ($(TARGET_CFLAGS),)
+HOSTCFLAGS = $(TARGET_CFLAGS)

View File

@ -1,38 +0,0 @@
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -246,7 +246,7 @@ int fw_printenv (int argc, char *argv[])
int i, n_flag;
int rc = 0;
- if (argc >= 2 && strcmp(argv[1], "-a") == 0) {
+ if (0 && argc >= 2 && strcmp(argv[1], "-a") == 0) {
if (argc < 3) {
fprintf(stderr,
"## Error: '-a' option requires AES key\n");
@@ -325,7 +325,7 @@ int fw_printenv (int argc, char *argv[])
int fw_env_close(void)
{
int ret;
- if (aes_flag) {
+ if (0 && aes_flag) {
ret = env_aes_cbc_crypt(environment.data, 1);
if (ret) {
fprintf(stderr,
@@ -1223,7 +1223,7 @@ int fw_env_open(void)
crc0 = crc32 (0, (uint8_t *) environment.data, ENV_SIZE);
- if (aes_flag) {
+ if (0 && aes_flag) {
ret = env_aes_cbc_crypt(environment.data, 0);
if (ret)
return ret;
@@ -1280,7 +1280,7 @@ int fw_env_open(void)
crc1 = crc32 (0, (uint8_t *) redundant->data, ENV_SIZE);
- if (aes_flag) {
+ if (0 && aes_flag) {
ret = env_aes_cbc_crypt(redundant->data, 0);
if (ret)
return ret;

View File

@ -1,163 +0,0 @@
From 6e2630a0fc872d0db34157972f6dc3941f6d66dd Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 19 May 2014 21:38:01 +0200
Subject: [PATCH] tools/env: add support for env in ubi volume chardev
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
tools/env/Makefile | 5 ++++
tools/env/fw_env.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 71 insertions(+), 10 deletions(-)
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -24,6 +24,13 @@ ifeq ($(MTD_VERSION),old)
HOST_EXTRACFLAGS += -DMTD_OLD
endif
+ifeq ($(UBI),y)
+HOST_EXTRACFLAGS += -DUBI
+HOST_LOADLIBES = "-Wl,--gc-sections,-lubi-utils"
+else
+HOST_LOADLIBES = "-Wl,--gc-sections"
+endif
+
always := fw_printenv
hostprogs-y := fw_printenv
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -31,6 +31,9 @@
# include <mtd/mtd-user.h>
#endif
+#ifdef UBI
+# include <libubi.h>
+#endif
#include "fw_env.h"
#include <aes.h>
@@ -811,6 +814,11 @@ static int flash_write_buf (int dev, int
off_t top_of_range; /* end of the last block we may use */
loff_t blockstart; /* running start of the current block -
MEMGETBADBLOCK needs 64 bits */
+#ifdef UBI
+ libubi_t *libubi = NULL;/* pointer to libubi struct */
+#else
+ void *libubi = NULL;
+#endif
int rc;
/*
@@ -916,7 +924,30 @@ static int flash_write_buf (int dev, int
continue;
}
- if (mtd_type != MTD_ABSENT) {
+#ifdef UBI
+ if (mtd_type == MTD_UBIVOLUME) {
+ struct ubi_vol_info volinfo;
+ libubi = libubi_open();
+ if (libubi)
+ rc = ubi_get_vol_info(libubi,
+ DEVNAME(dev_current), &volinfo);
+ if (libubi && !rc) {
+ erasesize = volinfo.leb_size;
+ int leb = blockstart / erasesize;
+ if (volinfo.type != UBI_STATIC_VOLUME)
+ rc = ubi_leb_change_start(libubi, fd,
+ leb, erasesize);
+ else
+ rc = ubi_update_start(libubi, fd,
+ erasesize);
+ }
+ if (libubi && rc) {
+ libubi_close(libubi);
+ libubi = NULL;
+ }
+ }
+#endif
+ if (!libubi && mtd_type != MTD_ABSENT) {
erase.start = blockstart;
ioctl(fd, MEMUNLOCK, &erase);
/* These do not need an explicit erase cycle */
@@ -933,7 +964,8 @@ static int flash_write_buf (int dev, int
fprintf (stderr,
"Seek error on %s: %s\n",
DEVNAME (dev), strerror (errno));
- return -1;
+ processed = -1;
+ goto out;
}
#ifdef DEBUG
@@ -943,10 +975,11 @@ static int flash_write_buf (int dev, int
if (write (fd, data + processed, erasesize) != erasesize) {
fprintf (stderr, "Write error on %s: %s\n",
DEVNAME (dev), strerror (errno));
- return -1;
+ processed = -1;
+ goto out;
}
- if (mtd_type != MTD_ABSENT)
+ if (!libubi && mtd_type != MTD_ABSENT)
ioctl(fd, MEMLOCK, &erase);
processed += erasesize;
@@ -957,6 +990,11 @@ static int flash_write_buf (int dev, int
if (write_total > count)
free (data);
+out:
+#ifdef UBI
+ if (libubi)
+ libubi_close(libubi);
+#endif
return processed;
}
@@ -1068,12 +1106,8 @@ static int flash_read (int fd)
if (S_ISCHR(st.st_mode)) {
rc = ioctl(fd, MEMGETINFO, &mtdinfo);
- if (rc < 0) {
- fprintf(stderr, "Cannot get MTD information for %s\n",
- DEVNAME(dev_current));
- return -1;
- }
- if (mtdinfo.type != MTD_NORFLASH &&
+ if (!rc &&
+ mtdinfo.type != MTD_NORFLASH &&
mtdinfo.type != MTD_NANDFLASH &&
mtdinfo.type != MTD_DATAFLASH &&
mtdinfo.type != MTD_UBIVOLUME) {
@@ -1081,6 +1115,28 @@ static int flash_read (int fd)
mtdinfo.type, DEVNAME(dev_current));
return -1;
}
+#ifdef UBI
+ if (rc) {
+ libubi_t *libubi;
+ struct ubi_vol_info volinfo;
+ libubi = libubi_open();
+ if (!libubi)
+ return -ENOMEM;
+
+ rc = ubi_get_vol_info(libubi, DEVNAME(dev_current),
+ &volinfo);
+ if (rc) {
+ libubi_close(libubi);
+ return -ENODEV;
+ }
+ memset(&mtdinfo, 0, sizeof(mtdinfo));
+ mtdinfo.type = MTD_UBIVOLUME;
+ mtdinfo.size = volinfo.data_bytes;
+ mtdinfo.erasesize = volinfo.leb_size;
+ mtdinfo.writesize = volinfo.leb_size;
+ libubi_close(libubi);
+ }
+#endif
} else {
memset(&mtdinfo, 0, sizeof(mtdinfo));
mtdinfo.type = MTD_ABSENT;

View File

@ -1,13 +0,0 @@
diff -Naur u-boot-2015.10.orig/tools/env/fw_env.c u-boot-2015.10/tools/env/fw_env.c
--- u-boot-2015.10.orig/tools/env/fw_env.c 2016-06-24 12:42:31.152391850 +0200
+++ u-boot-2015.10/tools/env/fw_env.c 2016-06-24 12:42:59.080391754 +0200
@@ -21,7 +21,8 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <unistd.h>
+#include <unistd.h>
+#include <stdint.h>
#ifdef MTD_OLD
# include <stdint.h>

View File

@ -20,7 +20,7 @@ include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=ipq806x
BUILD_TARGET:=ipq40xx
UBOOT_IMAGE:=uboot-fritz4040.bin
endef
@ -29,7 +29,7 @@ define U-Boot/fritz4040
endef
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
UBOOT_MAKE_FLAGS += USE_PRIVATE_LIBGCC=yes
UBOOT_MAKE_FLAGS = USE_PRIVATE_LIBGCC=yes
export DTC
define Build/Configure
@ -37,6 +37,7 @@ define Build/Configure
$(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz
$(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c
ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz
ln -sf compiler-gcc5.h $(PKG_BUILD_DIR)/include/linux/compiler-gcc7.h
endef
define Build/Compile

View File

@ -0,0 +1,480 @@
From fb8ffd7cfc68b3dc44e182356a207d784cb30b34 Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
Date: Thu, 4 Sep 2014 02:40:58 +0900
Subject: compiler*.h: sync include/linux/compiler*.h with Linux 3.16
Copy them from Linux v3.16 tag.
My main motivation of this commit is to add compiler-clang.h.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Jeroen Hofstee <jeroen@myspectrum.nl>
---
include/linux/compiler-clang.h | 12 ++++++
include/linux/compiler-gcc.h | 57 ++++++++++++++++++--------
include/linux/compiler-gcc3.h | 20 ++++-----
include/linux/compiler-gcc4.h | 59 +++++++++++++++++++--------
include/linux/compiler-intel.h | 40 ++++++++++++++++++
include/linux/compiler.h | 92 +++++++++++++++++++++++++++++++++++++++++-
6 files changed, 236 insertions(+), 44 deletions(-)
create mode 100644 include/linux/compiler-clang.h
create mode 100644 include/linux/compiler-intel.h
--- /dev/null
+++ b/include/linux/compiler-clang.h
@@ -0,0 +1,12 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
+#endif
+
+/* Some compiler specific definitions are overwritten here
+ * for Clang compiler
+ */
+
+#ifdef uninitialized_var
+#undef uninitialized_var
+#define uninitialized_var(x) x = *(&(x))
+#endif
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -5,6 +5,9 @@
/*
* Common definitions for all gcc versions go here.
*/
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
/* Optimization barrier */
@@ -34,9 +37,15 @@
__asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
(typeof(ptr)) (__ptr + (off)); })
+/* Make the optimizer believe the variable can be manipulated arbitrarily. */
+#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
+
+#ifdef __CHECKER__
+#define __must_be_array(arr) 0
+#else
/* &a[0] degrades to a pointer: a different type from an array */
-#define __must_be_array(a) \
- BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
+#endif
/*
* Force always-inline if the user requests it so via the .config,
@@ -44,15 +53,18 @@
*/
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-# define inline inline __attribute__((always_inline))
-# define __inline__ __inline__ __attribute__((always_inline))
-# define __inline __inline __attribute__((always_inline))
+# define inline inline __attribute__((always_inline)) notrace
+# define __inline__ __inline__ __attribute__((always_inline)) notrace
+# define __inline __inline __attribute__((always_inline)) notrace
+#else
+/* A lot of inline functions can cause havoc with function tracing */
+# define inline inline notrace
+# define __inline__ __inline__ notrace
+# define __inline __inline notrace
#endif
#define __deprecated __attribute__((deprecated))
-#ifndef __packed
-# define __packed __attribute__((packed))
-#endif
+#define __packed __attribute__((packed))
#define __weak __attribute__((weak))
/*
@@ -60,8 +72,12 @@
* naked functions because then mcount is called without stack and frame pointer
* being set up and there is no chance to restore the lr register to the value
* before mcount was called.
+ *
+ * The asm() bodies of naked functions often depend on standard calling conventions,
+ * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce
+ * this, so we must do so ourselves. See GCC PR44290.
*/
-#define __naked __attribute__((naked)) notrace
+#define __naked __attribute__((naked)) noinline __noclone notrace
#define __noreturn __attribute__((noreturn))
@@ -75,13 +91,10 @@
* would be.
* [...]
*/
-#ifndef __pure
-# define __pure __attribute__((pure))
-#endif
-#ifndef __aligned
-# define __aligned(x) __attribute__((aligned(x)))
-#endif
-#define __printf(a,b) __attribute__((format(printf,a,b)))
+#define __pure __attribute__((pure))
+#define __aligned(x) __attribute__((aligned(x)))
+#define __printf(a, b) __attribute__((format(printf, a, b)))
+#define __scanf(a, b) __attribute__((format(scanf, a, b)))
#define noinline __attribute__((noinline))
#define __attribute_const__ __attribute__((__const__))
#define __maybe_unused __attribute__((unused))
@@ -91,3 +104,15 @@
#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
#define gcc_header(x) _gcc_header(x)
#include gcc_header(__GNUC__)
+
+#if !defined(__noclone)
+#define __noclone /* not needed */
+#endif
+
+/*
+ * A trick to suppress uninitialized variable warning without generating any
+ * code
+ */
+#define uninitialized_var(x) x = x
+
+#define __always_inline inline __attribute__((always_inline))
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -2,20 +2,22 @@
#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
#endif
-#if __GNUC_MINOR__ >= 3
+#if GCC_VERSION < 30200
+# error Sorry, your compiler is too old - please upgrade it.
+#endif
+
+#if GCC_VERSION >= 30300
# define __used __attribute__((__used__))
#else
# define __used __attribute__((__unused__))
#endif
-#if __GNUC_MINOR__ >= 4
+#if GCC_VERSION >= 30400
#define __must_check __attribute__((warn_unused_result))
#endif
-/*
- * A trick to suppress uninitialized variable warning without generating any
- * code
- */
-#define uninitialized_var(x) x = x
-
-#define __always_inline inline __attribute__((always_inline))
+#ifdef CONFIG_GCOV_KERNEL
+# if GCC_VERSION < 30400
+# error "GCOV profiling support for gcc versions below 3.4 not included"
+# endif /* __GNUC_MINOR__ */
+#endif /* CONFIG_GCOV_KERNEL */
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -4,7 +4,7 @@
/* GCC 4.1.[01] miscompiles __weak */
#ifdef __KERNEL__
-# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
+# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
# error Your version of gcc miscompiles the __weak directive
# endif
#endif
@@ -12,17 +12,12 @@
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
-#ifndef __always_inline
-# define __always_inline inline __attribute__((always_inline))
-#endif
-/*
- * A trick to suppress uninitialized variable warning without generating any
- * code
- */
-#define uninitialized_var(x) x = x
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
+#endif
-#if __GNUC_MINOR__ >= 3
+#if GCC_VERSION >= 40300
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
@@ -38,8 +33,15 @@
the kernel context */
#define __cold __attribute__((__cold__))
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-#if __GNUC_MINOR__ >= 5
+#ifndef __CHECKER__
+# define __compiletime_warning(message) __attribute__((warning(message)))
+# define __compiletime_error(message) __attribute__((error(message)))
+#endif /* __CHECKER__ */
+#endif /* GCC_VERSION >= 40300 */
+
+#if GCC_VERSION >= 40500
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
@@ -50,14 +52,37 @@
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
-#endif
+/* Mark a function definition as prohibited from being cloned. */
+#define __noclone __attribute__((__noclone__))
+
+#endif /* GCC_VERSION >= 40500 */
+
+#if GCC_VERSION >= 40600
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
#endif
-#if __GNUC_MINOR__ > 0
-#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ * Fixed in GCC 4.8.2 and later versions.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#if GCC_VERSION >= 40400
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
#endif
-#if __GNUC_MINOR__ >= 4
-#define __compiletime_warning(message) __attribute__((warning(message)))
-#define __compiletime_error(message) __attribute__((error(message)))
+#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
+#define __HAVE_BUILTIN_BSWAP16__
#endif
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
--- /dev/null
+++ b/include/linux/compiler-intel.h
@@ -0,0 +1,40 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
+#endif
+
+#ifdef __ECC
+
+/* Some compiler specific definitions are overwritten here
+ * for Intel ECC compiler
+ */
+
+#include <asm/intrinsics.h>
+
+/* Intel ECC compiler doesn't support gcc specific asm stmts.
+ * It uses intrinsics to do the equivalent things.
+ */
+#undef RELOC_HIDE
+#undef OPTIMIZER_HIDE_VAR
+
+#define RELOC_HIDE(ptr, off) \
+ ({ unsigned long __ptr; \
+ __ptr = (unsigned long) (ptr); \
+ (typeof(ptr)) (__ptr + (off)); })
+
+/* This should act as an optimization barrier on var.
+ * Given that this compiler does not have inline assembly, a compiler barrier
+ * is the best we can do.
+ */
+#define OPTIMIZER_HIDE_VAR(var) barrier()
+
+/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
+#define __must_be_array(a) 0
+
+#endif
+
+#ifndef __HAVE_BUILTIN_BSWAP16__
+/* icc has this, but it's called _bswap16 */
+#define __HAVE_BUILTIN_BSWAP16__
+#define __builtin_bswap16 _bswap16
+#endif
+
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,16 +5,23 @@
#ifdef __CHECKER__
# define __user __attribute__((noderef, address_space(1)))
-# define __kernel /* default address space */
+# define __kernel __attribute__((address_space(0)))
# define __safe __attribute__((safe))
# define __force __attribute__((force))
# define __nocast __attribute__((nocast))
# define __iomem __attribute__((noderef, address_space(2)))
+# define __must_hold(x) __attribute__((context(x,1,1)))
# define __acquires(x) __attribute__((context(x,0,1)))
# define __releases(x) __attribute__((context(x,1,0)))
# define __acquire(x) __context__(x,1)
# define __release(x) __context__(x,-1)
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
+# define __percpu __attribute__((noderef, address_space(3)))
+#ifdef CONFIG_SPARSE_RCU_POINTER
+# define __rcu __attribute__((noderef, address_space(4)))
+#else
+# define __rcu
+#endif
extern void __chk_user_ptr(const volatile void __user *);
extern void __chk_io_ptr(const volatile void __iomem *);
#else
@@ -27,13 +34,20 @@ extern void __chk_io_ptr(const volatile
# define __chk_user_ptr(x) (void)0
# define __chk_io_ptr(x) (void)0
# define __builtin_warning(x, y...) (1)
+# define __must_hold(x)
# define __acquires(x)
# define __releases(x)
# define __acquire(x) (void)0
# define __release(x) (void)0
# define __cond_lock(x,c) (c)
+# define __percpu
+# define __rcu
#endif
+/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
+#define ___PASTE(a,b) a##b
+#define __PASTE(a,b) ___PASTE(a,b)
+
#ifdef __KERNEL__
#ifdef __GNUC__
@@ -49,6 +63,13 @@ extern void __chk_io_ptr(const volatile
# include <linux/compiler-intel.h>
#endif
+/* Clang compiler defines __GNUC__. So we will overwrite implementations
+ * coming from above header files here
+ */
+#ifdef __clang__
+#include <linux/compiler-clang.h>
+#endif
+
/*
* Generic compiler-dependent macros required for kernel
* build go below this comment. Actual compiler/compiler version
@@ -156,6 +177,15 @@ void ftrace_likely_update(struct ftrace_
(typeof(ptr)) (__ptr + (off)); })
#endif
+#ifndef OPTIMIZER_HIDE_VAR
+#define OPTIMIZER_HIDE_VAR(var) barrier()
+#endif
+
+/* Not-quite-unique ID. */
+#ifndef __UNIQUE_ID
+# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
+#endif
+
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
@@ -228,7 +258,7 @@ void ftrace_likely_update(struct ftrace_
/*
* Rather then using noinline to prevent stack consumption, use
- * noinline_for_stack instead. For documentaiton reasons.
+ * noinline_for_stack instead. For documentation reasons.
*/
#define noinline_for_stack noinline
@@ -270,11 +300,20 @@ void ftrace_likely_update(struct ftrace_
# define __section(S) __attribute__ ((__section__(#S)))
#endif
+#ifndef __visible
+#define __visible
+#endif
+
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
#endif
+/* Is this type a native word size -- useful for atomic operations */
+#ifndef __native_word
+# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
+#endif
+
/* Compile time object size, -1 for unknown */
#ifndef __compiletime_object_size
# define __compiletime_object_size(obj) -1
@@ -284,7 +323,48 @@ void ftrace_likely_update(struct ftrace_
#endif
#ifndef __compiletime_error
# define __compiletime_error(message)
+/*
+ * Sparse complains of variable sized arrays due to the temporary variable in
+ * __compiletime_assert. Unfortunately we can't just expand it out to make
+ * sparse see a constant array size without breaking compiletime_assert on old
+ * versions of GCC (e.g. 4.2.4), so hide the array from sparse altogether.
+ */
+# ifndef __CHECKER__
+# define __compiletime_error_fallback(condition) \
+ do { ((void)sizeof(char[1 - 2 * condition])); } while (0)
+# endif
#endif
+#ifndef __compiletime_error_fallback
+# define __compiletime_error_fallback(condition) do { } while (0)
+#endif
+
+#define __compiletime_assert(condition, msg, prefix, suffix) \
+ do { \
+ bool __cond = !(condition); \
+ extern void prefix ## suffix(void) __compiletime_error(msg); \
+ if (__cond) \
+ prefix ## suffix(); \
+ __compiletime_error_fallback(__cond); \
+ } while (0)
+
+#define _compiletime_assert(condition, msg, prefix, suffix) \
+ __compiletime_assert(condition, msg, prefix, suffix)
+
+/**
+ * compiletime_assert - break build and emit msg if condition is false
+ * @condition: a compile-time constant condition to check
+ * @msg: a message to emit if condition is false
+ *
+ * In tradition of POSIX assert, this macro will break the build if the
+ * supplied condition is *false*, emitting the supplied error message if the
+ * compiler has support to do so.
+ */
+#define compiletime_assert(condition, msg) \
+ _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
+
+#define compiletime_assert_atomic_type(t) \
+ compiletime_assert(__native_word(t), \
+ "Need native word sized stores/loads for atomicity.")
/*
* Prevent the compiler from merging or refetching accesses. The compiler
@@ -300,4 +380,12 @@ void ftrace_likely_update(struct ftrace_
*/
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+/* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */
+#ifdef CONFIG_KPROBES
+# define __kprobes __attribute__((__section__(".kprobes.text")))
+# define nokprobe_inline __always_inline
+#else
+# define __kprobes
+# define nokprobe_inline inline
+#endif
#endif /* __LINUX_COMPILER_H */

View File

@ -0,0 +1,69 @@
From 0a5051ce6ebd5f6fad58fd50d6922493d8447f14 Mon Sep 17 00:00:00 2001
From: Jeroen Hofstee <jeroen@myspectrum.nl>
Date: Thu, 18 Sep 2014 20:10:27 +0200
Subject: compiler_gcc: prevent redefining attributes
The libc headers on FreeBSD and likely related projects as well contain an
header file, cdefs.h which provides similiar functionality as linux/compiler.h.
It provides compiler independent defines like __weak __packed, to allow
compiling with multiple compilers which might have a different syntax for such
extension.
Since that header file is included in multiple standard headers, like stddef.h
and stdarg.h, multiple definitions of those defines will be present if both are
included. When compiling u-boot the compiler will warn about it hundreds of
times since e.g. common.h will include both files indirectly.
commit 7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9 "compiler_gcc: do not redefine
__gnu_attributes" prevented such redefinitions, but this was undone by commit
fb8ffd7cfc68b3dc44e182356a207d784cb30b34 "compiler*.h: sync
include/linux/compiler*.h with Linux 3.16".
Add the checks back where necessary to prevent such warnings.
As the original patch this checkpatch warning is ignored:
"WARNING: Adding new packed members is to be done with care"
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
include/linux/compiler-gcc.h | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -64,8 +64,12 @@
#endif
#define __deprecated __attribute__((deprecated))
+#ifndef __packed
#define __packed __attribute__((packed))
+#endif
+#ifndef __weak
#define __weak __attribute__((weak))
+#endif
/*
* it doesn't make sense on ARM (currently the only user of __naked) to trace
@@ -91,8 +95,12 @@
* would be.
* [...]
*/
+#ifndef __pure
#define __pure __attribute__((pure))
+#endif
+#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
+#endif
#define __printf(a, b) __attribute__((format(printf, a, b)))
#define __scanf(a, b) __attribute__((format(scanf, a, b)))
#define noinline __attribute__((noinline))
@@ -115,4 +123,6 @@
*/
#define uninitialized_var(x) x = x
+#ifndef __always_inline
#define __always_inline inline __attribute__((always_inline))
+#endif

View File

@ -1,10 +1,7 @@
From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 7 Feb 2015 21:52:40 +0000 (+0100)
Date: Sat, 7 Feb 2015 22:52:40 +0100
Subject: Add linux/compiler-gcc5.h to fix builds with gcc5
X-Git-Tag: v2015.04-rc2~31
X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=478b02f1a7043b673565075ea5016376f3293b23
Add linux/compiler-gcc5.h to fix builds with gcc5
Add linux/compiler-gcc5/h from the kernel sources at:
@ -16,6 +13,9 @@ Date: Sat Oct 25 15:09:42 2014 -0700
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 include/linux/compiler-gcc5.h
--- /dev/null
+++ b/include/linux/compiler-gcc5.h

View File

@ -1,7 +1,29 @@
diff --git b/include/linux/compiler-gcc.h a/include/linux/compiler-gcc.h
index e057bd2..22ab246 100644
--- b/include/linux/compiler-gcc.h
+++ a/include/linux/compiler-gcc.h
From 9b2c282b348dfe966bbba967dc7a45ce817cce50 Mon Sep 17 00:00:00 2001
From: Tom Rini <trini@konsulko.com>
Date: Mon, 29 Feb 2016 11:34:15 -0500
Subject: compiler*.h: sync include/linux/compiler*.h with Linux 4.5-rc6
Copy these from Linux v4.5-rc6 tag.
This is needed so that we can keep up with newer gcc versions. Note
that we don't have the uapi/ hierarchy from the kernel so continue to
use <linux/types.h>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
include/linux/compiler-gcc.h | 259 ++++++++++++++++++++++++++++++++---------
include/linux/compiler-gcc3.h | 23 ----
include/linux/compiler-gcc4.h | 88 --------------
include/linux/compiler-gcc5.h | 65 -----------
include/linux/compiler-intel.h | 5 +
include/linux/compiler.h | 178 ++++++++++++++++++++++++++--
6 files changed, 383 insertions(+), 235 deletions(-)
delete mode 100644 include/linux/compiler-gcc3.h
delete mode 100644 include/linux/compiler-gcc4.h
delete mode 100644 include/linux/compiler-gcc5.h
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -5,14 +5,28 @@
/*
* Common definitions for all gcc versions go here.
@ -163,7 +185,9 @@ index e057bd2..22ab246 100644
+
+#if GCC_VERSION >= 30400
+#define __must_check __attribute__((warn_unused_result))
+#endif
#endif
-#ifndef __aligned
-#define __aligned(x) __attribute__((aligned(x)))
+
+#if GCC_VERSION >= 40000
+
@ -180,7 +204,18 @@ index e057bd2..22ab246 100644
+
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
+#endif
#endif
-#define __printf(a, b) __attribute__((format(printf, a, b)))
-#define __scanf(a, b) __attribute__((format(scanf, a, b)))
-#define noinline __attribute__((noinline))
-#define __attribute_const__ __attribute__((__const__))
-#define __maybe_unused __attribute__((unused))
-#define __always_unused __attribute__((unused))
-
-#define __gcc_header(x) #x
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
-#define gcc_header(x) _gcc_header(x)
-#include gcc_header(__GNUC__)
+
+#if GCC_VERSION >= 40300
+/* Mark functions as cold. gcc will assume any path leading to a call
@ -232,9 +267,7 @@ index e057bd2..22ab246 100644
+ * this.
+ */
+#define __visible __attribute__((externally_visible))
#endif
-#ifndef __aligned
-#define __aligned(x) __attribute__((aligned(x)))
+#endif
+
+
+#if GCC_VERSION >= 40900 && !defined(__CHECKER__)
@ -251,18 +284,8 @@ index e057bd2..22ab246 100644
+ * massaged by 'flags = ptr & 3; ptr &= ~3;').
+ */
+#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
#endif
-#define __printf(a, b) __attribute__((format(printf, a, b)))
-#define __scanf(a, b) __attribute__((format(scanf, a, b)))
-#define noinline __attribute__((noinline))
-#define __attribute_const__ __attribute__((__const__))
-#define __maybe_unused __attribute__((unused))
-#define __always_unused __attribute__((unused))
-#define __gcc_header(x) #x
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
-#define gcc_header(x) _gcc_header(x)
-#include gcc_header(__GNUC__)
+#endif
+
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
@ -318,10 +341,7 @@ index e057bd2..22ab246 100644
-#ifndef __always_inline
-#define __always_inline inline __attribute__((always_inline))
-#endif
diff --git b/include/linux/compiler-gcc3.h a/include/linux/compiler-gcc3.h
deleted file mode 100644
index 7d89feb..0000000
--- b/include/linux/compiler-gcc3.h
--- a/include/linux/compiler-gcc3.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __LINUX_COMPILER_H
@ -347,16 +367,20 @@ index 7d89feb..0000000
-# error "GCOV profiling support for gcc versions below 3.4 not included"
-# endif /* __GNUC_MINOR__ */
-#endif /* CONFIG_GCOV_KERNEL */
diff --git b/include/linux/compiler-gcc4.h a/include/linux/compiler-gcc4.h
deleted file mode 100644
index c982a09..0000000
--- b/include/linux/compiler-gcc4.h
--- a/include/linux/compiler-gcc4.h
+++ /dev/null
@@ -1,81 +0,0 @@
@@ -1,88 +0,0 @@
-#ifndef __LINUX_COMPILER_H
-#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
-#endif
-
-/* GCC 4.1.[01] miscompiles __weak */
-#ifdef __KERNEL__
-# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
-# error Your version of gcc miscompiles the __weak directive
-# endif
-#endif
-
-#define __used __attribute__((__used__))
-#define __must_check __attribute__((warn_unused_result))
-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
@ -434,10 +458,76 @@ index c982a09..0000000
-#define __HAVE_BUILTIN_BSWAP16__
-#endif
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
diff --git b/include/linux/compiler-intel.h a/include/linux/compiler-intel.h
index ba147a1..d4c7113 100644
--- b/include/linux/compiler-intel.h
+++ a/include/linux/compiler-intel.h
--- a/include/linux/compiler-gcc5.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef __LINUX_COMPILER_H
-#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
-#endif
-
-#define __used __attribute__((__used__))
-#define __must_check __attribute__((warn_unused_result))
-#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
-
-/* Mark functions as cold. gcc will assume any path leading to a call
- to them will be unlikely. This means a lot of manual unlikely()s
- are unnecessary now for any paths leading to the usual suspects
- like BUG(), printk(), panic() etc. [but let's keep them for now for
- older compilers]
-
- Early snapshots of gcc 4.3 don't support this and we can't detect this
- in the preprocessor, but we can live with this because they're unreleased.
- Maketime probing would be overkill here.
-
- gcc also has a __attribute__((__hot__)) to move hot functions into
- a special section, but I don't see any sense in this right now in
- the kernel context */
-#define __cold __attribute__((__cold__))
-
-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
-
-#ifndef __CHECKER__
-# define __compiletime_warning(message) __attribute__((warning(message)))
-# define __compiletime_error(message) __attribute__((error(message)))
-#endif /* __CHECKER__ */
-
-/*
- * Mark a position in code as unreachable. This can be used to
- * suppress control flow warnings after asm blocks that transfer
- * control elsewhere.
- *
- * Early snapshots of gcc 4.5 don't support this and we can't detect
- * this in the preprocessor, but we can live with this because they're
- * unreleased. Really, we need to have autoconf for the kernel.
- */
-#define unreachable() __builtin_unreachable()
-
-/* Mark a function definition as prohibited from being cloned. */
-#define __noclone __attribute__((__noclone__))
-
-/*
- * Tell the optimizer that something else uses this function or variable.
- */
-#define __visible __attribute__((externally_visible))
-
-/*
- * GCC 'asm goto' miscompiles certain code sequences:
- *
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
- *
- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
- *
- * (asm goto is automatically volatile - the naming reflects this.)
- */
-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
-
-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
-#define __HAVE_BUILTIN_BSWAP32__
-#define __HAVE_BUILTIN_BSWAP64__
-#define __HAVE_BUILTIN_BSWAP16__
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -13,9 +13,14 @@
/* Intel ECC compiler doesn't support gcc specific asm stmts.
* It uses intrinsics to do the equivalent things.
@ -453,10 +543,8 @@ index ba147a1..d4c7113 100644
#define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
__ptr = (unsigned long) (ptr); \
diff --git b/include/linux/compiler.h a/include/linux/compiler.h
index d5ad7b1..020ad16 100644
--- b/include/linux/compiler.h
+++ a/include/linux/compiler.h
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -17,6 +17,7 @@
# define __release(x) __context__(x,-1)
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
@ -465,7 +553,7 @@ index d5ad7b1..020ad16 100644
#ifdef CONFIG_SPARSE_RCU_POINTER
# define __rcu __attribute__((noderef, address_space(4)))
#else
@@ -42,6 +43,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);
@@ -42,6 +43,7 @@ extern void __chk_io_ptr(const volatile
# define __cond_lock(x,c) (c)
# define __percpu
# define __rcu
@ -473,7 +561,7 @@ index d5ad7b1..020ad16 100644
#endif
/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
@@ -54,7 +56,11 @@ extern void __chk_io_ptr(const volatile void __iomem *);
@@ -54,7 +56,11 @@ extern void __chk_io_ptr(const volatile
#include <linux/compiler-gcc.h>
#endif
@ -485,7 +573,7 @@ index d5ad7b1..020ad16 100644
/* Intel compiler defines __GNUC__. So we will overwrite implementations
* coming from above header files here
@@ -138,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -138,7 +144,7 @@ void ftrace_likely_update(struct ftrace_
*/
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
#define __trace_if(cond) \
@ -494,7 +582,7 @@ index d5ad7b1..020ad16 100644
({ \
int ______r; \
static struct ftrace_branch_data \
@@ -165,6 +171,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -165,6 +171,10 @@ void ftrace_likely_update(struct ftrace_
# define barrier() __memory_barrier()
#endif
@ -505,7 +593,7 @@ index d5ad7b1..020ad16 100644
/* Unreachable code */
#ifndef unreachable
# define unreachable() do { } while (1)
@@ -186,6 +196,126 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -186,6 +196,126 @@ void ftrace_likely_update(struct ftrace_
# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
#endif
@ -632,7 +720,7 @@ index d5ad7b1..020ad16 100644
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
@@ -304,6 +434,14 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -304,6 +434,14 @@ void ftrace_likely_update(struct ftrace_
#define __visible
#endif
@ -647,7 +735,7 @@ index d5ad7b1..020ad16 100644
/* Are two types/vars the same type (ignoring qualifiers)? */
#ifndef __same_type
# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
@@ -311,7 +449,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -311,7 +449,7 @@ void ftrace_likely_update(struct ftrace_
/* Is this type a native word size -- useful for atomic operations */
#ifndef __native_word
@ -656,7 +744,7 @@ index d5ad7b1..020ad16 100644
#endif
/* Compile time object size, -1 for unknown */
@@ -373,12 +511,38 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
@@ -373,12 +511,38 @@ void ftrace_likely_update(struct ftrace_
* to make the compiler aware of ordering is to put the two invocations of
* ACCESS_ONCE() in different C statements.
*
@ -676,7 +764,8 @@ index d5ad7b1..020ad16 100644
+ * required ordering.
+ *
+ * If possible use READ_ONCE()/WRITE_ONCE() instead.
+ */
*/
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+#define __ACCESS_ONCE(x) ({ \
+ __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \
+ (volatile typeof(x) *)&(x); })
@ -689,8 +778,7 @@ index d5ad7b1..020ad16 100644
+ * Similar to rcu_dereference(), but for situations where the pointed-to
+ * object's lifetime is managed by something other than RCU. That
+ * "something other" might be reference counting or simple immortality.
*/
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+ */
+#define lockless_dereference(p) \
+({ \
+ typeof(p) _________p1 = READ_ONCE(p); \

View File

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

View File

@ -23,8 +23,6 @@ Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
NOTE: this patch is ready for upstream, LEDE-specific parts are in
another patch
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
@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME
@ -45,9 +43,6 @@ index 9205b1e..819bd3b 100644
source "board/zyxel/nsa310s/Kconfig"
endif
diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig
new file mode 100644
index 0000000..145ade6
--- /dev/null
+++ b/board/zyxel/nsa310/Kconfig
@@ -0,0 +1,12 @@
@ -63,9 +58,6 @@ index 0000000..145ade6
+ default "nsa310"
+
+endif
diff --git a/board/zyxel/nsa310/MAINTAINERS b/board/zyxel/nsa310/MAINTAINERS
new file mode 100644
index 0000000..d09f1ab
--- /dev/null
+++ b/board/zyxel/nsa310/MAINTAINERS
@@ -0,0 +1,6 @@
@ -75,9 +67,6 @@ index 0000000..d09f1ab
+F: board/zyxel/nsa310/
+F: include/configs/nsa310.h
+F: configs/nsa310_defconfig
diff --git a/board/zyxel/nsa310/Makefile b/board/zyxel/nsa310/Makefile
new file mode 100644
index 0000000..dfe93cc
--- /dev/null
+++ b/board/zyxel/nsa310/Makefile
@@ -0,0 +1,12 @@
@ -93,9 +82,6 @@ index 0000000..dfe93cc
+#
+
+obj-y := nsa310.o
diff --git a/board/zyxel/nsa310/kwbimage.cfg b/board/zyxel/nsa310/kwbimage.cfg
new file mode 100644
index 0000000..f60e1d2
--- /dev/null
+++ b/board/zyxel/nsa310/kwbimage.cfg
@@ -0,0 +1,166 @@
@ -265,9 +251,6 @@ index 0000000..f60e1d2
+
+# End of Header extension
+DATA 0x0 0x0
diff --git a/board/zyxel/nsa310/nsa310.c b/board/zyxel/nsa310/nsa310.c
new file mode 100644
index 0000000..eee3f1a
--- /dev/null
+++ b/board/zyxel/nsa310/nsa310.c
@@ -0,0 +1,190 @@
@ -461,9 +444,6 @@ index 0000000..eee3f1a
+ }
+}
+#endif
diff --git a/board/zyxel/nsa310/nsa310.h b/board/zyxel/nsa310/nsa310.h
new file mode 100644
index 0000000..6634a4f
--- /dev/null
+++ b/board/zyxel/nsa310/nsa310.h
@@ -0,0 +1,56 @@
@ -501,19 +481,19 @@ index 0000000..6634a4f
+/* GPIO's */
+#define SYS_GREEN_LED (1 << 28)
+#define SYS_RED_LED (1 << 29)
+#define SATA1_GREEN_LED (1 << 41)
+#define SATA1_RED_LED (1 << 42)
+#define SATA1_GREEN_LED (1ULL << 41)
+#define SATA1_RED_LED (1ULL << 42)
+#define SATA2_GREEN_LED (1 << 12)
+#define SATA2_RED_LED (1 << 13)
+#define USB_GREEN_LED (1 << 15)
+#define USB_RED_LED (1 << 21)
+#define COPY_GREEN_LED (1 << 39)
+#define COPY_RED_LED (1 << 40)
+#define COPY_GREEN_LED (1ULL << 39)
+#define COPY_RED_LED (1ULL << 40)
+
+#define NSA310_OE_LOW (0)
+#define NSA310_VAL_LOW (SYS_GREEN_LED)
+#define NSA310_OE_HIGH ((COPY_GREEN_LED | COPY_RED_LED | \
+ SATA1_GREEN_LED | SATA1_RED_LED))
+#define NSA310_OE_HIGH (((COPY_GREEN_LED | COPY_RED_LED | \
+ SATA1_GREEN_LED | SATA1_RED_LED)) >> 32UL)
+#define NSA310_VAL_HIGH (0)
+
+/* PHY related */
@ -523,14 +503,12 @@ index 0000000..6634a4f
+#define MV88E1318_RGMII_RXTM_CTRL (1 << 5)
+
+#endif /* __NSA310_H */
diff --git a/configs/nsa310_defconfig b/configs/nsa310_defconfig
new file mode 100644
index 0000000..d26ef35
--- /dev/null
+++ b/configs/nsa310_defconfig
@@ -0,0 +1,34 @@
@@ -0,0 +1,37 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_SYS_TEXT_BASE=0x600000
+CONFIG_TARGET_NSA310=y
+CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server"
+CONFIG_BOOTDELAY=3
@ -552,6 +530,7 @@ index 0000000..d26ef35
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)"
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
@ -563,12 +542,10 @@ index 0000000..d26ef35
+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
+CONFIG_SYS_LONGHELP=y
--- /dev/null
+++ b/include/configs/nsa310.h
@@ -0,0 +1,126 @@
@@ -0,0 +1,119 @@
+/* Copyright (C) 2015-2016 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
@ -617,7 +594,6 @@ index 0000000..86ef825
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+
+/*
@ -648,16 +624,10 @@ index 0000000..86ef825
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0x0c0000(uboot)," \
+ "0x80000(uboot_env)," \
+ "0x7ec0000(ubi)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+ "bootargs_root=\0"
+
+/*

View File

@ -1,5 +1,3 @@
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
@@ -62,6 +62,9 @@ config TARGET_NSA310
@ -19,9 +17,6 @@ index 819bd3b..6a2d578 100644
+source "board/zyxel/nsa325/Kconfig"
endif
diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig
new file mode 100644
index 0000000..1fe5ead
--- /dev/null
+++ b/board/zyxel/nsa325/Kconfig
@@ -0,0 +1,12 @@
@ -37,9 +32,6 @@ index 0000000..1fe5ead
+ default "nsa325"
+
+endif
diff --git a/board/zyxel/nsa325/MAINTAINERS b/board/zyxel/nsa325/MAINTAINERS
new file mode 100644
index 0000000..130b4d9
--- /dev/null
+++ b/board/zyxel/nsa325/MAINTAINERS
@@ -0,0 +1,6 @@
@ -49,9 +41,6 @@ index 0000000..130b4d9
+F: board/zyxel/nsa325/
+F: include/configs/nsa325.h
+F: configs/nsa325_defconfig
diff --git a/board/zyxel/nsa325/Makefile b/board/zyxel/nsa325/Makefile
new file mode 100644
index 0000000..4ee953b
--- /dev/null
+++ b/board/zyxel/nsa325/Makefile
@@ -0,0 +1,13 @@
@ -68,9 +57,6 @@ index 0000000..4ee953b
+
+obj-y := nsa325.o
+
diff --git a/board/zyxel/nsa325/kwbimage.cfg b/board/zyxel/nsa325/kwbimage.cfg
new file mode 100644
index 0000000..5a27d38
--- /dev/null
+++ b/board/zyxel/nsa325/kwbimage.cfg
@@ -0,0 +1,78 @@
@ -152,9 +138,6 @@ index 0000000..5a27d38
+# End of Header extension
+DATA 0x0 0x0
+
diff --git a/board/zyxel/nsa325/nsa325.c b/board/zyxel/nsa325/nsa325.c
new file mode 100644
index 0000000..4cd1c0f
--- /dev/null
+++ b/board/zyxel/nsa325/nsa325.c
@@ -0,0 +1,265 @@
@ -423,9 +406,6 @@ index 0000000..4cd1c0f
+
+#endif
+
diff --git a/board/zyxel/nsa325/nsa325.h b/board/zyxel/nsa325/nsa325.h
new file mode 100644
index 0000000..996653e
--- /dev/null
+++ b/board/zyxel/nsa325/nsa325.h
@@ -0,0 +1,77 @@
@ -506,14 +486,12 @@ index 0000000..996653e
+#define BTN_COPY 37
+
+#endif /* __NSA325_H */
diff --git a/configs/nsa325_defconfig b/configs/nsa325_defconfig
new file mode 100644
index 0000000..48e09cc
--- /dev/null
+++ b/configs/nsa325_defconfig
@@ -0,0 +1,34 @@
@@ -0,0 +1,37 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_SYS_TEXT_BASE=0x600000
+CONFIG_TARGET_NSA325=y
+CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server"
+CONFIG_BOOTDELAY=3
@ -536,6 +514,7 @@ index 0000000..48e09cc
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)"
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
@ -546,12 +525,10 @@ index 0000000..48e09cc
+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
+CONFIG_SYS_LONGHELP=y
--- /dev/null
+++ b/include/configs/nsa325.h
@@ -0,0 +1,129 @@
@@ -0,0 +1,122 @@
+/*
+ * (C) Copyright 2016 bodhi <mibodhi@gmail.com>
+ *
@ -603,7 +580,6 @@ index 0000000..e5a8e2a
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+
+/*
@ -634,16 +610,10 @@ index 0000000..e5a8e2a
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0x0c0000(uboot)," \
+ "0x80000(uboot_env)," \
+ "0x7ec0000(ubi)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+ "bootargs_root=\0"
+
+/*

View File

@ -3,13 +3,13 @@
@@ -25,6 +25,9 @@ config TARGET_LSXL
config TARGET_POGO_E02
bool "pogo_e02 Board"
+config TARGET_POGOPLUGV4
+ bool "Pogoplug V4 Board"
+
config TARGET_DNS325
bool "dns325 Board"
@@ -77,6 +80,7 @@ source "board/Marvell/guruplug/Kconfig"
source "board/Marvell/sheevaplug/Kconfig"
source "board/buffalo/lsxl/Kconfig"
@ -18,49 +18,15 @@
source "board/d-link/dns325/Kconfig"
source "board/iomega/iconnect/Kconfig"
source "board/keymile/km_arm/Kconfig"
--- a/arch/arm/mach-kirkwood/include/mach/config.h
+++ b/arch/arm/mach-kirkwood/include/mach/config.h
@@ -77,6 +77,7 @@
* Ethernet Driver configuration
*/
#ifdef CONFIG_CMD_NET
+#define CONFIG_FEATURE_COMMAND_EDITING
#define CONFIG_NETCONSOLE /* include NetConsole support */
#define CONFIG_MII /* expose smi ove miiphy interface */
#define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */
@@ -110,6 +111,7 @@
#define CONFIG_SYS_ATA_STRIDE 4
/* Controller supports 48-bits LBA addressing */
#define CONFIG_LBA48
+#define CONFIG_SYS_64BIT_LBA
/* CONFIG_IDE requires some #defines for ATA registers */
#define CONFIG_SYS_IDE_MAXBUS 2
#define CONFIG_SYS_IDE_MAXDEVICE 2
@@ -134,4 +136,15 @@
#define CONFIG_SYS_TIMER_COUNTER (MVEBU_TIMER_BASE + 0x14)
#define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TCLK
+/*
+ * Boot option
+ */
+#define CONFIG_CMD_BOOTZ
+
+/*
+ * GPIO
+ */
+#define CONFIG_CMD_GPIO
+#define CONFIG_KIRKWOOD_GPIO
+
#endif /* _KW_CONFIG_H */
--- a/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
+++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
@@ -16,6 +16,6 @@
#define KW_REGS_PHY_BASE KW88F6192_REGS_PHYS_BASE
/* TCLK Core Clock defination */
-#define CONFIG_SYS_TCLK 166000000 /* 166MHz */
+#define CONFIG_SYS_TCLK 166666667 /* 166MHz */
#endif /* _CONFIG_KW88F6192_H */
--- a/arch/arm/mach-kirkwood/include/mach/mpp.h
+++ b/arch/arm/mach-kirkwood/include/mach/mpp.h
@ -69,25 +35,14 @@
#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 )
#define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 )
+#define MPP33_SATA1_ACTn MPP( 33, 0x5, 0, 1, 0, 1, 1, 1 )
#define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 )
#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 )
#define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 )
+#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 1, 0, 1, 1, 1 )
#define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 )
#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 )
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -18,6 +18,8 @@
#define SOC_88F6810_ID 0x6810
#define SOC_88F6820_ID 0x6820
#define SOC_88F6828_ID 0x6828
+#define SOC_88F6192_ID 0x6192
+#define SOC_88F6702_ID 0x6702
/* A375 revisions */
#define MV_88F67XX_A0_ID 0x3
--- /dev/null
+++ b/board/cloudengines/pogoplugv4/Kconfig
@@ -0,0 +1,12 @@
@ -577,9 +532,10 @@
+#endif /* __POGOPLUGV4_H */
--- /dev/null
+++ b/configs/pogoplugv4_defconfig
@@ -0,0 +1,35 @@
@@ -0,0 +1,40 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_SYS_TEXT_BASE=0x600000
+CONFIG_TARGET_POGOPLUGV4=y
+CONFIG_SYS_PROMPT="pogoplugv4> "
+CONFIG_IDENT_STRING="\nPogoplug V4"
@ -589,6 +545,7 @@
+CONFIG_SYS_NS16550=y
+CONFIG_CMD_FDT=y
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_BOOTZ=y
+CONFIG_CMD_SETEXPR=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
@ -601,10 +558,12 @@
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x1c0000(uboot),0x40000(uboot_env),0x7e00000(ubi)"
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_GPIO=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_CMD_UBI=y
@ -613,6 +572,7 @@
+CONFIG_USB_STORAGE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
+CONFIG_SYS_LONGHELP=y
--- a/drivers/gpio/kw_gpio.c
+++ b/drivers/gpio/kw_gpio.c
@@ -148,3 +148,36 @@ void kw_gpio_set_blink(unsigned pin, int
@ -659,7 +619,7 @@
obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o
obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o
+obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o
obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o
obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o
--- /dev/null
@ -1149,26 +1109,20 @@
+}
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -130,4 +130,16 @@
@@ -117,4 +117,10 @@
#define CONFIG_MTD_PARTITIONS
#endif
+/*
+ * Kirkwood MMC
+ */
+#if defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC)
+#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE
+#endif /* defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC) */
+
+/*
+ * GPIO command for all Kirkwood boxes
+ */
+#define CONFIG_CMD_GPIO
+
#endif /* _MV_COMMON_H */
--- /dev/null
+++ b/include/configs/pogoplugv4.h
@@ -0,0 +1,132 @@
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2014-2016 bodhi <mibodhi@gmail.com>
+ * Based on
@ -1214,11 +1168,14 @@
+#define CONFIG_KW88F6192 /* SOC Name */
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+
+#define CONFIG_FEATURE_COMMAND_EDITING
+#define CONFIG_SYS_64BIT_LBA
+
+/*
+ * Commands configuration
+ */
+
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_KIRKWOOD_GPIO
+#define CONFIG_PREBOOT
+
+/*
@ -1252,16 +1209,10 @@
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0x1c0000(uboot)," \
+ "0x40000(uboot_env)," \
+ "0x7e00000(ubi)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+ "bootargs_root=\0"
+
+/*

View File

@ -1,14 +1,14 @@
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -19,6 +19,7 @@
@@ -18,6 +18,7 @@
#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */
#define CONFIG_KW88F6281 1 /* SOC Name */
#define CONFIG_MACH_DOCKSTAR /* Machine type */
#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+#define CONFIG_SYS_MVFS
/*
* mv-common.h should be defined after CMD configs since it used them
@@ -37,29 +38,29 @@
@@ -36,27 +37,22 @@
* it has to be rounded to sector size
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
@ -26,30 +26,32 @@
- "ubifsload 0x800000 ${kernel}; " \
- "ubifsload 0x1100000 ${initrd}; " \
- "bootm 0x800000 0x1100000"
-
-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0"
+ "ubi part ubi; " \
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0xe0000@0x0(uboot)," \
+ "0x20000@0xe0000(uboot_env)," \
+ "0x100000@0x100000(second_stage_uboot)," \
+ "-@0x200000(ubi)\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
- "console=console=ttyS0,115200\0" \
- "mtdids=nand0=orion_nand\0" \
- "mtdparts="CONFIG_MTDPARTS \
- "mtdparts="CONFIG_MTDPARTS_DEFAULT \
- "kernel=/boot/uImage\0" \
- "initrd=/boot/uInitrd\0" \
- "bootargs_root=ubi.mtd=1 root=ubi0:root rootfstype=ubifs ro\0"
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+ "bootargs_root=\0"
/*
* Ethernet Driver configuration
--- a/configs/dockstar_defconfig
+++ b/configs/dockstar_defconfig
@@ -16,7 +16,7 @@ CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),-(root)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y

View File

@ -1,6 +1,6 @@
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -44,30 +44,29 @@
@@ -44,24 +44,22 @@
#define CONFIG_ENV_SECT_SIZE 0x20000
#endif
#define CONFIG_ENV_SIZE 0x20000
@ -19,21 +19,10 @@
+ "ubi read 0x800000 kernel; " \
"bootm 0x800000"
#define CONFIG_MTDPARTS \
- "mtdparts=orion_nand:" \
- "0x80000@0x0(uboot)," \
- "0x20000@0x80000(uboot_env)," \
- "-@0xa0000(rootfs)\0"
+ "mtdparts=orion_nand:" \
+ "0xe0000@0x0(uboot)," \
+ "0x20000@0xe0000(uboot_env)," \
+ "0x100000@0x100000(second_stage_uboot)," \
+ "-@0x200000(ubi)\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
"console=console=ttyS0,115200\0" \
"mtdids=nand0=orion_nand\0" \
"mtdparts="CONFIG_MTDPARTS \
"mtdparts="CONFIG_MTDPARTS_DEFAULT \
- "kernel=/boot/uImage\0" \
- "bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
+ "bootargs_root=\0"
@ -42,7 +31,7 @@
* Ethernet driver configuration
--- a/configs/iconnect_defconfig
+++ b/configs/iconnect_defconfig
@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => "
@@ -10,12 +10,13 @@ CONFIG_SYS_PROMPT="iconnect => "
CONFIG_CMD_NAND=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
@ -50,3 +39,10 @@
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0x80000(uboot_env),-@0xa0000(rootfs)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y

View File

@ -1,6 +1,6 @@
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -49,27 +49,22 @@
@@ -49,21 +49,15 @@
*/
#define CONFIG_BOOTCOMMAND \
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
@ -15,18 +15,10 @@
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
#define CONFIG_MTDPARTS \
"mtdparts=orion_nand:" \
"0xe0000@0x0(uboot)," \
"0x20000@0xe0000(uboot_env)," \
- "-@0x100000(root)\0"
+ "0x100000@0x100000(second_stage_uboot)," \
+ "-@0x200000(ubi)\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
"console=console=ttyS0,115200\0" \
"mtdids=nand0=orion_nand\0" \
"mtdparts="CONFIG_MTDPARTS \
"mtdparts="CONFIG_MTDPARTS_DEFAULT \
- "kernel=/boot/zImage\0" \
- "fdt=/boot/ib62x0.dtb\0" \
- "bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
@ -34,3 +26,14 @@
/*
* Ethernet driver configuration
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -19,7 +19,7 @@ CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),-@0x100000(root)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y

View File

@ -1,6 +1,6 @@
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -44,23 +44,30 @@
@@ -44,23 +44,23 @@
#endif
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
@ -14,18 +14,11 @@
- "setenv bootargs $(bootargs_console); " \
- "run bootcmd_usb; " \
- "bootm 0x00800000 0x01100000"
+ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
+ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
+ "ubi part ubi; " \
+ "ubifsmount ubi:rootfs; " \
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0xe0000@0x0(uboot)," \
+ "0x20000@0xe0000(uboot_env)," \
+ "0x100000@0x100000(second_stage_uboot)," \
+ "-@0x200000(ubi)\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
- "mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)," \
@ -36,8 +29,18 @@
- "ext2load usb 0:1 0x01100000 /uInitrd\0"
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+ "bootargs_root=\0"
/*
* Ethernet Driver configuration
--- a/configs/pogo_e02_defconfig
+++ b/configs/pogo_e02_defconfig
@@ -16,6 +16,7 @@ CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y

View File

@ -1,6 +1,6 @@
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -70,20 +70,18 @@
@@ -69,17 +69,15 @@
*/
#define CONFIG_BOOTCOMMAND \
"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
@ -11,17 +11,24 @@
+ "ubi read 0x800000 kernel; " \
"bootm 0x800000"
#define CONFIG_MTDPARTS \
- "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0"
+ "mtdparts=orion_nand:1m(uboot),255m(ubi)\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
"console=console=ttyS0,115200\0" \
"mtdids=nand0=orion_nand\0" \
"mtdparts="CONFIG_MTDPARTS \
"mtdparts="CONFIG_MTDPARTS_DEFAULT \
- "kernel=/boot/uImage\0" \
- "bootargs_root=ubi.mtd=root root=ubi0:root rootfstype=ubifs ro\0"
+ "bootargs_root=\0"
/*
* Ethernet Driver configuration
--- a/configs/goflexhome_defconfig
+++ b/configs/goflexhome_defconfig
@@ -21,7 +21,7 @@ CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),255m(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y

View File

@ -1,6 +1,6 @@
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig"
@@ -94,4 +94,7 @@ source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
source "board/zyxel/nsa325/Kconfig"
@ -10,7 +10,7 @@
endif
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -76,4 +76,6 @@
@@ -68,4 +68,6 @@
#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS
@ -19,7 +19,7 @@
#endif /* _CONFIG_DOCKSTAR_H */
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -94,4 +94,6 @@
@@ -87,4 +87,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
@ -28,7 +28,7 @@
#endif /* _CONFIG_IB62x0_H */
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -83,4 +83,6 @@
@@ -76,4 +76,6 @@
#define CONFIG_MTD_DEVICE
#define CONFIG_MTD_PARTITIONS
@ -71,7 +71,7 @@
+#endif /* __OPENWRT_KIRKWOOD_COMMON_H */
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -83,4 +83,6 @@
@@ -76,4 +76,6 @@
#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
#define CONFIG_MTD_PARTITIONS
@ -80,7 +80,7 @@
#endif /* _CONFIG_POGO_E02_H */
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -105,4 +105,6 @@
@@ -101,4 +101,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
@ -89,7 +89,7 @@
#endif /* _CONFIG_GOFLEXHOME_H */
--- a/include/configs/nsa310.h
+++ b/include/configs/nsa310.h
@@ -123,4 +123,6 @@
@@ -116,4 +116,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
@ -98,7 +98,7 @@
#endif /* _CONFIG_NSA310_H */
--- a/configs/dockstar_defconfig
+++ b/configs/dockstar_defconfig
@@ -25,3 +25,8 @@ CONFIG_USB=y
@@ -26,3 +26,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y
@ -109,7 +109,7 @@
+CONFIG_LZO=y
--- a/configs/goflexhome_defconfig
+++ b/configs/goflexhome_defconfig
@@ -29,3 +29,8 @@ CONFIG_USB=y
@@ -32,3 +32,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y
@ -120,20 +120,19 @@
+CONFIG_LZO=y
--- a/configs/ib62x0_defconfig
+++ b/configs/ib62x0_defconfig
@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y
@@ -29,5 +29,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_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
@@ -25,5 +25,9 @@ CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
@ -146,7 +145,7 @@
+CONFIG_LZO=y
--- a/configs/nsa310_defconfig
+++ b/configs/nsa310_defconfig
@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y
@@ -32,6 +32,9 @@ CONFIG_CMD_UBI=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
@ -155,9 +154,10 @@
+CONFIG_FIT_VERBOSE=y
CONFIG_LZMA=y
CONFIG_LZO=y
CONFIG_SYS_LONGHELP=y
--- a/configs/pogo_e02_defconfig
+++ b/configs/pogo_e02_defconfig
@@ -25,3 +25,8 @@ CONFIG_USB=y
@@ -26,3 +26,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
CONFIG_OF_LIBFDT=y

View File

@ -353,17 +353,17 @@ UBOOT_TARGETS:= \
define CompressVR9Firmware
$(STAGING_DIR_HOST)/bin/lzma e \
$(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
$(FIRMWARE_LANTIQ_SOURCE)/xrx200_phy$(1)_a$(2)$(3).bin \
$(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
endef
define Build/Prepare
$(call Build/Prepare/Default)
mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
$(call CompressVR9Firmware,11g,1)
$(call CompressVR9Firmware,11g,2)
$(call CompressVR9Firmware,22f,1)
$(call CompressVR9Firmware,22f,2)
$(call CompressVR9Firmware,11g,1,4)
$(call CompressVR9Firmware,11g,2,2)
$(call CompressVR9Firmware,22f,1,4)
$(call CompressVR9Firmware,22f,2,2)
endef
UBOOT_MAKE_FLAGS :=

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape-armv8_32b
PKG_SOURCE_DATE:=2017-10-24
PKG_SOURCE_DATE:=2018-01-22
PKG_RELEASE:=1
# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit
@ -17,8 +17,8 @@ PKG_RELEASE:=1
# 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_SOURCE_VERSION:=40a40dfd8136fcc314dd442a3b24a41b1e5652dd
PKG_MIRROR_HASH:=3dde5a33d19c573cbdce74f5d7edb6c5ca2a26a39d503c3efe5d5ad06f01e9f5
PKG_MAINTAINER:=Yangbo Lu <yangbo.lu@nxp.com>

View File

@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=uboot-layerscape
PKG_SOURCE_DATE:=2017-08-24
PKG_SOURCE_DATE:=2017-12-07
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git
PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af
PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d
PKG_SOURCE_VERSION:=9f7df1b406ff11409021cd2112beedd6b57bb600
PKG_MIRROR_HASH:=b3756f814b731af2d03b0582ece90b2de564955b778f341fbfc34fa9bd849819
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk

View File

@ -1,21 +1,21 @@
From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001
From d1b42455f62baefe7fb782d0d7100715b0fdb41f 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
Date: Fri, 19 Jan 2018 10:16:57 +0800
Subject: [PATCH] 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(-)
include/configs/ls1043a_common.h | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 0b3fb4e..5c01111 100644
index c437ce5..48ecff5 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 ;" \
@@ -341,7 +341,19 @@
"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 && " \
@ -33,7 +33,7 @@ index 0b3fb4e..5c01111 100644
#undef CONFIG_BOOTCOMMAND
@@ -351,6 +363,12 @@
@@ -356,6 +368,12 @@
"env exists secureboot && esbc_halt;"
#endif
@ -47,5 +47,5 @@ index 0b3fb4e..5c01111 100644
"earlycon=uart8250,mmio,0x21c0500 " \
MTDPARTS_DEFAULT
--
2.7.4
1.7.1

View File

@ -1,32 +1,32 @@
From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001
From a5293c6d5fdacf84fdd4772d0532aa5478df4d3c 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
Date: Fri, 19 Jan 2018 10:18:47 +0800
Subject: [PATCH] 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(-)
include/configs/ls1046a_common.h | 15 ++++++++++++++-
include/configs/ls1046ardb.h | 6 ++++++
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h
index 4fc2f94..53bd41b 100644
index d163347..d26147b 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 ;" \
@@ -281,7 +281,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/mtdblock9 " \
+ "rootfstype=ext4 noinitrd " \
+ "setenv bootargs ubi.mtd=9 root=ubi0:rootfs rw " \
+ "rootfstype=ubifs 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" \
+ "16M(kernel),32M(ubifs)\0" \
+ "lede_run=sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \
@ -36,10 +36,10 @@ index 4fc2f94..53bd41b 100644
#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
index 4475ac7..15e7858 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -251,6 +251,12 @@
@@ -253,6 +253,12 @@
"env exists secureboot && esbc_halt;"
#endif
@ -53,5 +53,5 @@ index f8c15a6..c3b50b1 100644
"15m(u-boot),48m(kernel.itb);" \
"7e800000.flash:16m(nand_uboot)," \
--
2.7.4
1.7.1

View File

@ -20,12 +20,12 @@ index 5fe3218..242cdf0 100644
+ "bootm $load_addr#$board\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock8 " \
+ "rootfstype=ext4 noinitrd " \
+ "setenv bootargs ubi.mtd=8 root=ubi0:rootfs rw " \
+ "rootfstype=ubifs 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" \
+ "16M(kernel),32M(ubifs)\0" \
+ "lede_run=pfe stop && sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \

View File

@ -20,12 +20,12 @@ index 7bd152d..4cefa40 100644
+ "bootm $load_addr#$BOARD\0" \
+ "lede_setenv=setenv loadaddr 82000000 && " \
+ "setenv fdtaddr 8f000000 && " \
+ "setenv bootargs root=/dev/mtdblock10 " \
+ "rootfstype=ext4 noinitrd " \
+ "setenv bootargs ubi.mtd=10 root=ubi0:rootfs rw " \
+ "rootfstype=ubifs 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" \
+ "16M(kernel),32M(ubifs)\0" \
+ "lede_run=sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \

View File

@ -18,12 +18,12 @@ index a3f8824d27..36dff19bdd 100644
"$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 " \
+ "setenv bootargs ubi.mtd=8 root=ubi0:rootfs rw " \
+ "rootfstype=ubifs 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" \
+ "16M(kernel),32M(ubifs)\0" \
+ "lede_run=pfe stop && sf probe 0:0 && " \
+ "sf read $fdtaddr f00000 100000 && " \
+ "sf read $loadaddr 1000000 1000000 && " \

View File

@ -8,16 +8,14 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2017.03
PKG_VERSION:=2018.03
PKG_RELEASE:=1
PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f
PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
UBOOT_MAKE_FLAGS:=
define U-Boot/Default
BUILD_TARGET:=mvebu
HIDDEN:=1
@ -26,12 +24,21 @@ endef
define U-Boot/clearfog
NAME:=SolidRun ClearFog A1
BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro
BUILD_SUBTARGET:=cortexa9
UBOOT_IMAGE:=u-boot-spl.kwb
endef
UBOOT_TARGETS:= \
clearfog
define Build/Configure
# enable additional options beyond clearfog_defconfig
echo CONFIG_NET_RANDOM_ETHADDR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
echo CONFIG_CMD_SETEXPR=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb

View File

@ -1,28 +0,0 @@
From ee16ee20205ea374613c3ac7f50209451eb29068 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua.mayer97@gmail.com>
Date: Sun, 23 Apr 2017 18:02:40 +0200
Subject: [PATCH 1/4] clearfog: generate random MAC address
The Clearfog does not come with predetermined MACs.
Falling back to random ones ensures ethernet can still operate anyway.
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 1264871e83..41e94e6daf 100644
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -47,6 +47,7 @@ CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_BASE=0xd0012000
CONFIG_DEBUG_UART_CLOCK=250000000
CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_DM_USB=y
--
2.12.2

View File

@ -1,37 +0,0 @@
From 98848106b9558244ae36a85229caabcdb57d0f7b Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Fri, 23 Sep 2016 13:58:14 +0200
Subject: [PATCH 2/4] clearfog: reset usom onboard 1512 phy
Use GPIO19 which is wired to the uSOM phy reset signal in order to reset
the uSOM's 88E81512 gigabit Ethernet phy.
This GPIO is valid on ClearFog rev 2.1 and newer.
Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
[jonas.gorski: adapted to upstream u-boot code]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
board/solidrun/clearfog/clearfog.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c
index 2773f5957e..3a8257cac3 100644
--- a/board/solidrun/clearfog/clearfog.c
+++ b/board/solidrun/clearfog/clearfog.c
@@ -131,8 +131,12 @@ int board_init(void)
/* Toggle GPIO41 to reset onboard switch and phy */
clrbits_le32(MVEBU_GPIO1_BASE + 0x0, BIT(9));
clrbits_le32(MVEBU_GPIO1_BASE + 0x4, BIT(9));
+ /* GPIO 19 on ClearFog rev 2.1 controls the uSOM onboard phy reset */
+ clrbits_le32(MVEBU_GPIO0_BASE + 0x0, BIT(19));
+ clrbits_le32(MVEBU_GPIO0_BASE + 0x4, BIT(19));
mdelay(1);
setbits_le32(MVEBU_GPIO1_BASE + 0x0, BIT(9));
+ setbits_le32(MVEBU_GPIO0_BASE + 0x0, BIT(19));
mdelay(10);
/* Init I2C IO expanders */
--
2.12.2

View File

@ -1,97 +0,0 @@
From 9653921eadd5d5268afbee6c928708158fc4e844 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua.mayer97@gmail.com>
Date: Tue, 22 Nov 2016 16:33:23 +0100
Subject: [PATCH 3/4] clearfog: enable distro boot code
load addresses start at 0x02000000, leaving enough space for fdt,
boot scripts and ramdisk at the end.
Only boot from mmc, the other options are not in working order.
Removed *_high variables in good faith. They can be re-added with sane
values when, and if required.
Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
---
Kconfig | 1 +
include/configs/clearfog.h | 47 +++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/Kconfig b/Kconfig
index 81b4226463..f7aec2255b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -59,6 +59,7 @@ config DISTRO_DEFAULTS
default y if ARCH_LS2080A
default y if ARCH_MESON
default y if ARCH_ROCKCHIP
+ default y if TARGET_CLEARFOG
default n
select CMD_BOOTZ if ARM && !ARM64
select CMD_BOOTI if ARM64
diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
index 0c51d2a288..890dd84b5d 100644
--- a/include/configs/clearfog.h
+++ b/include/configs/clearfog.h
@@ -79,11 +79,6 @@
#define CONFIG_SYS_ALT_MEMTEST
-/* Keep device tree and initrd in lower memory so the kernel can access them */
-#define CONFIG_EXTRA_ENV_SETTINGS \
- "fdt_high=0x10000000\0" \
- "initrd_high=0x10000000\0"
-
/* SPL */
/*
* Select the boot device here
@@ -128,6 +123,48 @@
#endif
#endif
+#ifndef CONFIG_SPL_BUILD
+/*
+ * Add standard bootenv from distro boot code:
+ * Keep device tree and initrd in lower memory so the kernel can access them
+ * Set default load addresses:
+ * - 63MiB space for kernel
+ * - 1MiB space for fdt
+ * - 1MiB space for extlinux file, or boot script
+ * - remainder for ramdisk
+ * Keep device tree and initrd in lower memory so the kernel can access them
+ * Set name of fdt file (default to Clearfog Pro)
+ * specify console device
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "kernel_addr_r=0x02000000\0" \
+ "fdt_addr_r=0x05f00000\0" \
+ "pxefile_addr_r=0x06000000\0" \
+ "scriptaddr=0x06000000\0" \
+ "ramdisk_addr_r=0x06100000\0" \
+ "fdt_high=0x10000000\0" \
+ "initrd_high=0x10000000\0" \
+ "fdtfile=armada-388-clearfog-pro.dtb\0" \
+ "console=ttyS0," __stringify(CONFIG_BAUDRATE) "\0" \
+ BOOTENV
+
+/* include distro boot code defaults */
+#include <config_distro_defaults.h>
+
+/*
+ * specify boot order
+ * sdcard or emmc -> usb -> network
+ */
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+ func(USB, usb, 0) \
+ func(PXE, pxe, na) \
+ func(DHCP, dhcp, na)
+
+/* include the actual distro boot code */
+#include <config_distro_bootcmd.h>
+#endif
+
/*
* mv-common.h should be defined after CMD configs since it used them
* to enable certain macros
--
2.12.2

View File

@ -1,24 +0,0 @@
From 7b53a0f5ddf0b1201a09c368b06cd5750d5fbe3a Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua.mayer97@gmail.com>
Date: Sun, 23 Apr 2017 17:45:11 +0200
Subject: [PATCH 4/4] clearfog: enable setexpr command by default
Turns out this command is pretty useful in advanced boot-scripts.
-> enable
Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
---
configs/clearfog_defconfig | 1 +
1 file changed, 1 insertion(+)
--- a/configs/clearfog_defconfig
+++ b/configs/clearfog_defconfig
@@ -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_CMD_TFTPPUT=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MII=y

View File

@ -1,153 +0,0 @@
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

@ -1,96 +0,0 @@
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

@ -8,10 +8,10 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2016.01
PKG_VERSION:=2017.11
PKG_RELEASE:=1
PKG_HASH:=e5792fba9399d9804aa2ef667f14ff771e2cdece72367d340250265bf095a5d5
PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk

View File

@ -1,20 +1,40 @@
From 4d9a32780ec795b9edc83c7b3a1e947cec49a5a4 Mon Sep 17 00:00:00 2001
From 25de6430219d3f3698d709c10358fbea17b24cf1 Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
Date: Sat, 15 Aug 2015 20:26:18 +0200
Subject: [PATCH] Add support for I2SE Duckbill boards
Date: Fri, 21 Apr 2017 11:08:19 +0200
Subject: [PATCH] arm: mxs: add support for I2SE's Duckbill boards
The Duckbill devices are small, pen-drive sized boards based on
NXP's i.MX28 SoC. While the initial variants (Duckbill series) were
equipped with a micro SD card slot only, the latest generation
(Duckbill 2 series) have an additional internal eMMC onboard.
Both device generations consists of four "family members":
- Duckbill/Duckbill 2: generic board, intended to be used as
baseboard for custom designs and/or as development board
- Duckbill EnOcean/Duckbill 2 EnOcean: come with an EnOcean
daugther board equipped with the popular TCM310 module
- Duckbill 485/Duckbill 2 485: as the name implies, these
devices are intended to be used as Ethernet - RS485 converters
- Duckbill SPI/Duckbill 2 SPI: not sold separately, but used
in I2SE's development kits for Green PHY HomePlug Powerline
communication
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
arch/arm/Kconfig | 6 ++
arch/arm/include/asm/mach-types.h | 13 +++
board/i2se/duckbill/Kconfig | 15 ++++
board/i2se/duckbill/MAINTAINERS | 6 ++
board/i2se/duckbill/Makefile | 12 +++
board/i2se/duckbill/duckbill.c | 112 +++++++++++++++++++++++
board/i2se/duckbill/iomux.c | 125 ++++++++++++++++++++++++++
configs/duckbill_defconfig | 9 ++
include/configs/duckbill.h | 177 +++++++++++++++++++++++++++++++++++++
9 files changed, 475 insertions(+)
arch/arm/Kconfig | 9 +-
board/i2se/duckbill/Kconfig | 15 +++
board/i2se/duckbill/MAINTAINERS | 6 ++
board/i2se/duckbill/Makefile | 12 +++
board/i2se/duckbill/duckbill.c | 181 ++++++++++++++++++++++++++++++++++++
board/i2se/duckbill/iomux.c | 157 +++++++++++++++++++++++++++++++
configs/duckbill_defconfig | 31 +++++++
include/configs/duckbill.h | 199 ++++++++++++++++++++++++++++++++++++++++
8 files changed, 609 insertions(+), 1 deletion(-)
create mode 100644 board/i2se/duckbill/Kconfig
create mode 100644 board/i2se/duckbill/MAINTAINERS
create mode 100644 board/i2se/duckbill/Makefile
@ -25,55 +45,36 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -178,6 +178,11 @@ config TARGET_MX28EVK
select CPU_ARM926EJS
@@ -373,6 +373,12 @@ config TARGET_MX28EVK
select SUPPORT_SPL
select BOARD_EARLY_INIT_F
+config TARGET_DUCKBILL
+ bool "Support I2SE Duckbill"
+ bool "Support duckbill"
+ select CPU_ARM926EJS
+ select SUPPORT_SPL
+ select BOARD_EARLY_INIT_F
+
config TARGET_MX23_OLINUXINO
bool "Support mx23_olinuxino"
select CPU_ARM926EJS
@@ -926,6 +931,7 @@ source "board/genesi/mx51_efikamx/Kconfi
source "board/gumstix/pepper/Kconfig"
@@ -1250,6 +1256,7 @@ source "board/gumstix/pepper/Kconfig"
source "board/h2200/Kconfig"
source "board/hisilicon/hikey/Kconfig"
source "board/hisilicon/poplar/Kconfig"
+source "board/i2se/duckbill/Kconfig"
source "board/imx31_phycore/Kconfig"
source "board/isee/igep0033/Kconfig"
source "board/maxbcm/Kconfig"
--- a/arch/arm/include/asm/mach-types.h
+++ b/arch/arm/include/asm/mach-types.h
@@ -1109,6 +1109,7 @@ extern unsigned int __machine_arch_type;
#define MACH_TYPE_COLIBRI_T30 4493
#define MACH_TYPE_APALIS_T30 4513
#define MACH_TYPE_OMAPL138_LCDK 2495
+#define MACH_TYPE_DUCKBILL 4754
source "board/isee/igep003x/Kconfig"
source "board/olimex/mx23_olinuxino/Kconfig"
@@ -1279,7 +1286,7 @@ source "arch/arm/Kconfig.debug"
endmenu
#ifdef CONFIG_ARCH_EBSA110
# ifdef machine_arch_type
@@ -14262,6 +14263,18 @@ extern unsigned int __machine_arch_type;
# define machine_is_apalis_t30() (0)
#endif
config SPL_LDSCRIPT
- default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
+ default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if TARGET_APX4DEVKIT || TARGET_BG0900 || TARGET_M28EVK || TARGET_MX23_OLINUXINO || TARGET_MX23EVK || TARGET_MX28EVK || TARGET_DUCKBILL || TARGET_SANSA_FUZE_PLUS || TARGET_SC_SPS_1 || TARGET_TS4600 || TARGET_XFI3
default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
+#ifdef CONFIG_MACH_DUCKBILL
+# ifdef machine_arch_type
+# undef machine_arch_type
+# define machine_arch_type __machine_arch_type
+# else
+# define machine_arch_type MACH_TYPE_DUCKBILL
+# endif
+# define machine_is_duckbill() (machine_arch_type == MACH_TYPE_DUCKBILL)
+#else
+# define machine_is_duckbill() (0)
+#endif
+
/*
* These have not yet been registered
*/
--- /dev/null
+++ b/board/i2se/duckbill/Kconfig
@@ -0,0 +1,15 @@
@ -105,7 +106,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+++ b/board/i2se/duckbill/Makefile
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2014-2015
+# (C) Copyright 2014-2017
+# Michael Heimpold, mhei@heimpold.de.
+#
+# SPDX-License-Identifier: GPL-2.0+
@ -118,11 +119,11 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+endif
--- /dev/null
+++ b/board/i2se/duckbill/duckbill.c
@@ -0,0 +1,112 @@
@@ -0,0 +1,181 @@
+/*
+ * I2SE Duckbill board
+ *
+ * (C) Copyright 2014-2015 Michael Heimpold <mhei@heimpold.de>
+ * (C) Copyright 2014-2017 Michael Heimpold <mhei@heimpold.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
@ -134,17 +135,19 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#include <asm/arch/iomux-mx28.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/setup.h>
+#include <fdt_support.h>
+#include <linux/mii.h>
+#include <miiphy.h>
+#include <netdev.h>
+#include <errno.h>
+
+#define GPIO_PHY_RESET MX28_PAD_SSP0_DATA7__GPIO_2_7
+#define GPIO_LED_GREEN MX28_PAD_AUART1_TX__GPIO_3_5
+#define GPIO_LED_RED MX28_PAD_AUART1_RX__GPIO_3_4
+#include <fuse.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static u32 system_rev;
+static u32 serialno;
+
+/*
+ * Functions
+ */
@ -184,14 +187,20 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ unsigned int reset_gpio;
+ int ret;
+
+ ret = cpu_eth_init(bis);
+
+ if (system_rev == 1)
+ reset_gpio = MX28_PAD_SSP0_DATA7__GPIO_2_7;
+ else
+ reset_gpio = MX28_PAD_GPMI_ALE__GPIO_0_26;
+
+ /* Reset PHY */
+ gpio_direction_output(GPIO_PHY_RESET, 0);
+ gpio_direction_output(reset_gpio, 0);
+ udelay(200);
+ gpio_set_value(GPIO_PHY_RESET, 1);
+ gpio_set_value(reset_gpio, 1);
+
+ /* give PHY some time to get out of the reset */
+ udelay(10000);
@ -209,20 +218,81 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+{
+ mac[0] = 0x00;
+ mac[1] = 0x01;
+ mac[2] = 0x87;
+}
+#endif
+
+ if (dev_id == 1) /* Let MAC1 be MAC0 + 1 by default */
+ mac[5] += 1;
+#ifdef CONFIG_OF_BOARD_SETUP
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ uint8_t enetaddr[6];
+ u32 mac = 0;
+
+ enetaddr[0] = 0x00;
+ enetaddr[1] = 0x01;
+ enetaddr[2] = 0x87;
+
+#ifdef CONFIG_MXS_OCOTP
+ /* only Duckbill SPI has a MAC for the QCA7k */
+ fuse_read(0, 1, &mac);
+#endif
+
+ if (mac != 0) {
+ enetaddr[3] = (mac >> 16) & 0xff;
+ enetaddr[4] = (mac >> 8) & 0xff;
+ enetaddr[5] = mac & 0xff;
+
+ fdt_find_and_setprop(blob,
+ "/apb@80000000/apbh@80000000/ssp@80014000/ethernet@0",
+ "local-mac-address", enetaddr, 6, 1);
+ }
+
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+ return system_rev;
+}
+#endif
+
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+ serialnr->low = serialno;
+ serialnr->high = 0;
+}
+#endif
+
+int misc_init_r(void)
+{
+ char *s = getenv("serial#");
+ unsigned int led_red_gpio;
+ char *s;
+
+ /* Board revision detection */
+ gpio_direction_input(MX28_PAD_LCD_D17__GPIO_1_17);
+
+ /* MX28_PAD_LCD_D17__GPIO_1_17: v1 = pull-down, v2 = pull-up */
+ system_rev =
+ gpio_get_value(MX28_PAD_LCD_D17__GPIO_1_17);
+ system_rev += 1;
+
+ /* enable red LED to indicate a running bootloader */
+ gpio_direction_output(GPIO_LED_RED, 1);
+ if (system_rev == 1)
+ led_red_gpio = MX28_PAD_AUART1_RX__GPIO_3_4;
+ else
+ led_red_gpio = MX28_PAD_SAIF0_LRCLK__GPIO_3_21;
+ gpio_direction_output(led_red_gpio, 1);
+
+ puts("Board: I2SE Duckbill\n");
+ if (system_rev == 1)
+ puts("Board: I2SE Duckbill\n");
+ else
+ puts("Board: I2SE Duckbill 2\n");
+
+ serialno = env_get_ulong("serial#", 10, 0);
+ s = env_get("serial#");
+ if (s && s[0]) {
+ puts("Serial: ");
+ puts(s);
@ -233,11 +303,11 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+}
--- /dev/null
+++ b/board/i2se/duckbill/iomux.c
@@ -0,0 +1,125 @@
@@ -0,0 +1,157 @@
+/*
+ * I2SE Duckbill IOMUX setup
+ *
+ * Copyright (C) 2013-2015 Michael Heimpold <mhei@heimpold.de>
+ * Copyright (C) 2013-2017 Michael Heimpold <mhei@heimpold.de>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
@ -245,6 +315,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#include <common.h>
+#include <config.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+#include <asm/arch/iomux-mx28.h>
+#include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
@ -253,12 +324,13 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define MUX_CONFIG_ENET (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
+#define MUX_CONFIG_EMI (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
+
+/* For all revisions */
+const iomux_cfg_t iomux_setup[] = {
+ /* DUART */
+ MX28_PAD_PWM0__DUART_RX,
+ MX28_PAD_PWM1__DUART_TX,
+
+ /* SD card */
+ /* eMMC (v2) or SD card (v1) */
+ MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA1__SSP0_D1 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA2__SSP0_D2 | MUX_CONFIG_SSP0,
@ -280,10 +352,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MUX_CONFIG_ENET,
+ MX28_PAD_ENET_CLK__CLKCTRL_ENET | MUX_CONFIG_ENET,
+
+ /* PHY reset */
+ MX28_PAD_SSP0_DATA7__GPIO_2_7 |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+
+ /* EMI */
+ MX28_PAD_EMI_D00__EMI_DATA0 | MUX_CONFIG_EMI,
+ MX28_PAD_EMI_D01__EMI_DATA1 | MUX_CONFIG_EMI,
@ -336,11 +404,38 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ MX28_PAD_EMI_CE1N__EMI_CE1N | MUX_CONFIG_EMI,
+ MX28_PAD_EMI_CKE__EMI_CKE | MUX_CONFIG_EMI,
+
+ /* Revision pin(s) */
+ MX28_PAD_LCD_D17__GPIO_1_17,
+};
+
+/* For revision 1 only */
+const iomux_cfg_t iomux_setup_v1[] = {
+ /* PHY reset */
+ MX28_PAD_SSP0_DATA7__GPIO_2_7 |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+
+ /* LEDs */
+ MX28_PAD_AUART1_RX__GPIO_3_4,
+ MX28_PAD_AUART1_TX__GPIO_3_5,
+};
+
+/* For revision 2 only */
+const iomux_cfg_t iomux_setup_v2[] = {
+ /* eMMC (v2) */
+ MX28_PAD_SSP0_DATA4__SSP0_D4 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA5__SSP0_D5 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA6__SSP0_D6 | MUX_CONFIG_SSP0,
+ MX28_PAD_SSP0_DATA7__SSP0_D7 | MUX_CONFIG_SSP0,
+
+ /* PHY reset */
+ MX28_PAD_GPMI_ALE__GPIO_0_26 |
+ (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+
+ /* LEDs */
+ MX28_PAD_SAIF0_LRCLK__GPIO_3_21,
+ MX28_PAD_SAIF0_MCLK__GPIO_3_20,
+};
+
+#define HW_DRAM_CTL29 (0x74 >> 2)
+#define CS_MAP 0xf
+#define COLUMN_SIZE 0x2
@ -358,22 +453,51 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+void board_init_ll(const uint32_t arg, const uint32_t *resptr)
+{
+ mxs_common_spl_init(arg, resptr, iomux_setup, ARRAY_SIZE(iomux_setup));
+
+ gpio_direction_input(MX28_PAD_LCD_D17__GPIO_1_17);
+
+ if (gpio_get_value(MX28_PAD_LCD_D17__GPIO_1_17))
+ mxs_iomux_setup_multiple_pads(iomux_setup_v2, ARRAY_SIZE(iomux_setup_v2));
+ else
+ mxs_iomux_setup_multiple_pads(iomux_setup_v1, ARRAY_SIZE(iomux_setup_v1));
+}
--- /dev/null
+++ b/configs/duckbill_defconfig
@@ -0,0 +1,9 @@
@@ -0,0 +1,31 @@
+CONFIG_ARM=y
+CONFIG_TARGET_DUCKBILL=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_BOOTDELAY=1
+# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_VERSION_VARIABLE=y
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_EFI_LOADER is not set
+CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="ENV_IS_IN_MMC"
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_SPI_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_MMC_MXS=y
+CONFIG_OF_LIBFDT=y
--- /dev/null
+++ b/include/configs/duckbill.h
@@ -0,0 +1,177 @@
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2014-2015 Michael Heimpold <mhei@heimpold.de>
+ *
@ -391,22 +515,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define CONFIG_SYS_MXS_VDD5V_ONLY
+
+/* U-Boot Commands */
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DOS_PARTITION
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_FUSE
+#define CONFIG_CMD_GPIO
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_UNZIP
+
+/* Memory configuration */
@ -417,7 +526,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+
+/* Environment is in MMC */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_ENV_IS_IN_MMC 1
+#define CONFIG_ENV_SIZE (128 * 1024)
+#define CONFIG_ENV_OFFSET (128 * 1024)
+#define CONFIG_ENV_OFFSET_REDUND (256 * 1024)
@ -454,29 +562,70 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+#define CONFIG_BOOTFILE "zImage"
+#define CONFIG_LOADADDR 0x42000000
+#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#define CONFIG_REVISION_TAG
+#define CONFIG_SERIAL_TAG
+#define CONFIG_OF_BOARD_SETUP
+#define CONFIG_BOOT_RETRY_TIME 120 /* retry autoboot after 120 seconds */
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_PROMPT "Autobooting in %d seconds, " \
+ "press <c> to stop\n"
+#define CONFIG_AUTOBOOT_DELAY_STR "\x63" /* allows retry after retry time */
+#define CONFIG_AUTOBOOT_STOP_STR " " /* stop autoboot with <Space> */
+#define CONFIG_RESET_TO_RETRY /* reset board to retry booting */
+
+/* Extra Environment */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "update_sd_firmware_filename=openwrt-mxs-root.ext4\0" \
+ "update_sd_firmware=" \
+ "mmc_part2_offset=1000\0" \
+ "mmc_part3_offset=19000\0" \
+ "update_openwrt_firmware_filename=openwrt-mxs-root.ext4\0" \
+ "update_openwrt_firmware=" \
+ "if mmc rescan; then " \
+ "if tftp ${update_sd_firmware_filename}; then " \
+ "setexpr fw_sz ${filesize} / 200; " \
+ "setexpr fw_sz ${fw_sz} + 1; " \
+ "mmc dev ${mmcdev} 3; " \
+ "mmc write ${loadaddr} 0 ${fw_sz}; " \
+ "mmc dev ${mmcdev} 2; " \
+ "mmc write ${loadaddr} 0 ${fw_sz}; " \
+ "mmc dev ${mmcdev}; " \
+ "fi; " \
+ "if tftp ${update_openwrt_firmware_filename}; then " \
+ "setexpr fw_sz ${filesize} + 1ff; " \
+ "setexpr fw_sz ${fw_sz} / 200; " \
+ "mmc write ${loadaddr} ${mmc_part2_offset} ${fw_sz}; " \
+ "mmc write ${loadaddr} ${mmc_part3_offset} ${fw_sz}; " \
+ "fi; " \
+ "fi\0" \
+ "update_fw_filename_prefix=emmc.img.\0" \
+ "update_fw_filename_suffix=.gz\0" \
+ "update_fw_parts=0x6\0" \
+ "update_fw_fsize_uncompressed=4000000\0" \
+ "gzwrite_wbuf=100000\0" \
+ "update_emmc_firmware=" \
+ "setexpr i ${update_fw_parts}; setexpr error 0; " \
+ "while itest ${i} -gt 0; do " \
+ "echo Transfering firmware image part ${i} of ${update_fw_parts}; " \
+ "if itest ${i} -le 9; then " \
+ "setenv j 0${i}; " \
+ "else " \
+ "setenv j ${i}; " \
+ "fi; " \
+ "if tftp ${loadaddr} ${update_fw_basedir}${update_fw_filename_prefix}${j}${update_fw_filename_suffix}; then " \
+ "setexpr k ${i} - 1; " \
+ "setexpr offset ${update_fw_fsize_uncompressed} * ${k}; " \
+ "if gzwrite mmc ${mmcdev} ${loadaddr} ${filesize} ${gzwrite_wbuf} ${offset}; then " \
+ "setexpr i ${i} - 1; " \
+ "else " \
+ "setexpr i 0; " \
+ "setexpr error 1; " \
+ "fi; " \
+ "else " \
+ "setexpr i 0; " \
+ "setexpr error 1; " \
+ "fi; " \
+ "done; setenv i; setenv j; setenv k; setenv fsize; setenv filesize; setenv offset; " \
+ "if test ${error} -eq 1; then " \
+ "echo Firmware Update FAILED; " \
+ "else " \
+ "echo Firmware Update OK; " \
+ "fi; setenv error\0" \
+ "erase_mmc=mmc erase 0 2\0" \
+ "erase_env1=mmc erase 100 100\0" \
+ "erase_env2=mmc erase 200 100\0" \
+ "script=boot.scr\0" \
+ "image=zImage\0" \
+ "console=ttyAMA0\0" \
+ "fdt_file=imx28-duckbill.dtb\0" \
+ "fdt_file=imx28-duckbill-2.dtb\0" \
+ "fdt_addr=0x41000000\0" \
+ "boot_fdt=try\0" \
+ "ip_dyn=yes\0" \
@ -487,10 +636,6 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "mmcargs=setenv bootargs console=${console},${baudrate} " \
+ "root=${mmcroot} " \
+ "rootwait bootsys=${bootsys} panic=1\0" \
+ "loadbootscript=" \
+ "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
+ "bootscript=echo Running bootscript from mmc ...; " \
+ "source\0" \
+ "loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${image}\0" \
+ "loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/${fdt_file}\0" \
+ "mmcboot=echo Booting from mmc ...; " \
@ -509,7 +654,8 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "fi; " \
+ "else " \
+ "bootz; " \
+ "fi;\0" \
+ "fi\0" \
+ "nfsroot=/\0" \
+ "netargs=setenv bootargs console=${console},${baudrate} " \
+ "root=/dev/nfs " \
+ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
@ -521,7 +667,7 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "setenv get_cmd tftp; " \
+ "fi; " \
+ "${get_cmd} ${image}; " \
+ "if test ${boot_fdt} = yes; then " \
+ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+ "bootz ${loadaddr} - ${fdt_addr}; " \
+ "else " \
@ -533,19 +679,19 @@ Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+ "fi; " \
+ "else " \
+ "bootz; " \
+ "fi;\0"
+ "fi\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "mmc dev ${mmcdev}; if mmc rescan; then " \
+ "if run loadbootscript; then " \
+ "run bootscript; " \
+ "mmc dev ${mmcdev}; " \
+ "if mmc rescan; then " \
+ "if run loadimage; then " \
+ "run mmcboot; " \
+ "else " \
+ "if run loadimage; then " \
+ "run mmcboot; " \
+ "else run netboot; " \
+ "fi; " \
+ "run netboot; " \
+ "fi; " \
+ "else run netboot; fi"
+ "else " \
+ "run netboot; " \
+ "fi"
+
+/* The rest of the configuration is shared */
+#include <configs/mxs.h>

View File

@ -0,0 +1,35 @@
From 74e3ace3495b73f6e592e92eca18175cccdb5a24 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 17 Feb 2018 15:34:19 +0100
Subject: [PATCH v2] tools/mxsimage: Support building with LibreSSL
The mxsimage utility fails to compile against LibreSSL because LibreSSL
says it is OpenSSL 2.0, but it does not support the complete OpenSSL 1.1
interface.
LibreSSL defines OPENSSL_VERSION_NUMBER with 0x20000000L and therefor
claims to have an API compatible with OpenSSL 2.0, but it does not
implement OPENSSL_zalloc() and some other functions in its most recent
version. OpenSSL implements this function since version 1.1.0.
This commit will activate the compatibility code meant for
OpenSSL < 1.1.0 also for all versions of LibreSSL, if some version of
LibreSSL will support these functions in the future the version check
should be adapted.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
tools/mxsimage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -26,7 +26,7 @@
* OpenSSL 1.1.0 and newer compatibility functions:
* https://wiki.openssl.org/index.php/1.1_API_Changes
*/
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
static void *OPENSSL_zalloc(size_t num)
{
void *ret = OPENSSL_malloc(num);

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2017.01
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_HASH:=6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2

View File

@ -0,0 +1,309 @@
From 17fa032671f7981628fe16b30399638842a4b1bb Mon Sep 17 00:00:00 2001
From: Heiko Schocher <hs@denx.de>
Date: Wed, 18 Jan 2017 08:05:49 +0100
Subject: [PATCH] serial, ns16550: bugfix: ns16550 fifo not enabled
commit: 65f83802b7a5b "serial: 16550: Add getfcr accessor"
breaks u-boot commandline working with long commands
sending to the board.
Since the above patch, you have to setup the fcr register.
For board/archs which enable OF_PLATDATA, the new field
fcr in struct ns16550_platdata is not filled with a
default value ...
This leads in not setting up the uarts fifo, which ends
in problems, when you send long commands to u-boots
commandline.
Detected this issue with automated tbot tests on am335x
based shc board.
The error does not popup, if you type commands. You need
to copy&paste a long command to u-boots commandshell
(or send a long command with tbot)
Possible boards/plattforms with problems:
./arch/arm/cpu/arm926ejs/lpc32xx/devices.c
./arch/arm/mach-tegra/board.c
./board/overo/overo.c
./board/quipos/cairo/cairo.c
./board/logicpd/omap3som/omap3logic.c
./board/logicpd/zoom1/zoom1.c
./board/timll/devkit8000/devkit8000.c
./board/lg/sniper/sniper.c
./board/ti/beagle/beagle.c
./drivers/serial/serial_rockchip.c
Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Tested-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
arch/arm/cpu/arm926ejs/lpc32xx/devices.c | 12 ++++++++----
arch/arm/mach-omap2/am33xx/board.c | 18 ++++++++++++------
arch/arm/mach-tegra/board.c | 1 +
board/isee/igep00x0/igep00x0.c | 3 ++-
board/lg/sniper/sniper.c | 3 ++-
board/logicpd/omap3som/omap3logic.c | 3 ++-
board/logicpd/zoom1/zoom1.c | 3 ++-
board/overo/overo.c | 3 ++-
board/quipos/cairo/cairo.c | 3 ++-
board/ti/beagle/beagle.c | 3 ++-
board/timll/devkit8000/devkit8000.c | 3 ++-
drivers/serial/ns16550.c | 9 +++------
drivers/serial/serial_rockchip.c | 1 +
include/ns16550.h | 5 +++++
14 files changed, 46 insertions(+), 24 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
index 399b07c5420a..f744398ca7ad 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c
@@ -45,10 +45,14 @@ void lpc32xx_uart_init(unsigned int uart_id)
#if !CONFIG_IS_ENABLED(OF_CONTROL)
static const struct ns16550_platdata lpc32xx_uart[] = {
- { .base = UART3_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = UART4_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = UART5_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = UART6_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+ { .base = UART3_BASE, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = UART4_BASE, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = UART5_BASE, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = UART6_BASE, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
};
#if defined(CONFIG_LPC32XX_HSUART)
diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index 73824df18fa7..190310fd0079 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -40,14 +40,20 @@ DECLARE_GLOBAL_DATA_PTR;
#if !CONFIG_IS_ENABLED(OF_CONTROL)
static const struct ns16550_platdata am33xx_serial[] = {
- { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+ { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
# ifdef CONFIG_SYS_NS16550_COM2
- { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+ { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
# ifdef CONFIG_SYS_NS16550_COM3
- { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
- { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK },
+ { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
+ { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2,
+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, },
# endif
# endif
};
diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c
index 3d1d26d13d13..b3a041b539af 100644
--- a/arch/arm/mach-tegra/board.c
+++ b/arch/arm/mach-tegra/board.c
@@ -219,6 +219,7 @@ static struct ns16550_platdata ns16550_com1_pdata = {
.base = CONFIG_SYS_NS16550_COM1,
.reg_shift = 2,
.clock = CONFIG_SYS_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(ns16550_com1) = {
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index ae7959b1eb6e..5a3498f570a6 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -32,7 +32,8 @@ DECLARE_GLOBAL_DATA_PTR;
static const struct ns16550_platdata igep_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(igep_uart) = {
diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c
index 0662449c3875..b2b8f8861f11 100644
--- a/board/lg/sniper/sniper.c
+++ b/board/lg/sniper/sniper.c
@@ -31,7 +31,8 @@ const omap3_sysinfo sysinfo = {
static const struct ns16550_platdata serial_omap_platdata = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(sniper_serial) = {
diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c
index 21b3fdcf49cf..b2fcc28f8b4b 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -49,7 +49,8 @@ DECLARE_GLOBAL_DATA_PTR;
static const struct ns16550_platdata omap3logic_serial = {
.base = OMAP34XX_UART1,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(omap3logic_uart) = {
diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c
index 2821ee22674f..0fad23af62f6 100644
--- a/board/logicpd/zoom1/zoom1.c
+++ b/board/logicpd/zoom1/zoom1.c
@@ -47,7 +47,8 @@ static const u32 gpmc_lab_enet[] = {
static const struct ns16550_platdata zoom1_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(zoom1_uart) = {
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 40f13e5876cc..5e447262bcfd 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -70,7 +70,8 @@ static struct {
static const struct ns16550_platdata overo_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(overo_uart) = {
diff --git a/board/quipos/cairo/cairo.c b/board/quipos/cairo/cairo.c
index 77e4482906f0..793aa9023150 100644
--- a/board/quipos/cairo/cairo.c
+++ b/board/quipos/cairo/cairo.c
@@ -93,7 +93,8 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
static const struct ns16550_platdata cairo_serial = {
.base = OMAP34XX_UART2,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(cairo_uart) = {
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index cfdab3e34253..23c79333a223 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -75,7 +75,8 @@ static struct {
static const struct ns16550_platdata beagle_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(beagle_uart) = {
diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index f785dbe6d732..b2f060b2ddbf 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -48,7 +48,8 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = {
static const struct ns16550_platdata devkit8000_serial = {
.base = OMAP34XX_UART3,
.reg_shift = 2,
- .clock = V_NS16550_CLK
+ .clock = V_NS16550_CLK,
+ .fcr = UART_FCR_DEFVAL,
};
U_BOOT_DEVICE(devkit8000_uart) = {
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 9b423a591d8a..2df4a1f04fe5 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -20,9 +20,6 @@ DECLARE_GLOBAL_DATA_PTR;
#define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */
#define UART_MCRVAL (UART_MCR_DTR | \
UART_MCR_RTS) /* RTS/DTR */
-#define UART_FCRVAL (UART_FCR_FIFO_EN | \
- UART_FCR_RXSR | \
- UART_FCR_TXSR) /* Clear & enable FIFOs */
#ifndef CONFIG_DM_SERIAL
#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
@@ -138,7 +135,7 @@ static u32 ns16550_getfcr(NS16550_t port)
#else
static u32 ns16550_getfcr(NS16550_t port)
{
- return UART_FCRVAL;
+ return UART_FCR_DEFVAL;
}
#endif
@@ -275,7 +272,7 @@ static inline void _debug_uart_init(void)
CONFIG_BAUDRATE);
serial_dout(&com_port->ier, CONFIG_SYS_NS16550_IER);
serial_dout(&com_port->mcr, UART_MCRVAL);
- serial_dout(&com_port->fcr, UART_FCRVAL);
+ serial_dout(&com_port->fcr, UART_FCR_DEFVAL);
serial_dout(&com_port->lcr, UART_LCR_BKSE | UART_LCRVAL);
serial_dout(&com_port->dll, baud_divisor & 0xff);
@@ -440,7 +437,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
return -EINVAL;
}
- plat->fcr = UART_FCRVAL;
+ plat->fcr = UART_FCR_DEFVAL;
if (port_type == PORT_JZ4780)
plat->fcr |= UART_FCR_UME;
diff --git a/drivers/serial/serial_rockchip.c b/drivers/serial/serial_rockchip.c
index 6bac95a414ce..c06afc58f7ea 100644
--- a/drivers/serial/serial_rockchip.c
+++ b/drivers/serial/serial_rockchip.c
@@ -27,6 +27,7 @@ static int rockchip_serial_probe(struct udevice *dev)
plat->plat.base = plat->dtplat.reg[0];
plat->plat.reg_shift = plat->dtplat.reg_shift;
plat->plat.clock = plat->dtplat.clock_frequency;
+ plat->plat.fcr = UART_FCR_DEFVAL;
dev->platdata = &plat->plat;
return ns16550_serial_probe(dev);
diff --git a/include/ns16550.h b/include/ns16550.h
index 7c9703683109..5fcbcd2e74e3 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -121,6 +121,11 @@ typedef struct NS16550 *NS16550_t;
/* Ingenic JZ47xx specific UART-enable bit. */
#define UART_FCR_UME 0x10
+/* Clear & enable FIFOs */
+#define UART_FCR_DEFVAL (UART_FCR_FIFO_EN | \
+ UART_FCR_RXSR | \
+ UART_FCR_TXSR)
+
/*
* These are the definitions for the Modem Control Register
*/
--
2.17.0

View File

@ -9,9 +9,9 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2017.07
PKG_VERSION:=2017.11
PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff
PKG_HASH:=6a018fd3caf58f3dcfa23ee989a82bd35df03af71872b9dca8c6d758a0d26c05
PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
@ -150,6 +150,12 @@ define U-Boot/orangepi_r1
BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1
endef
define U-Boot/orangepi_pc
BUILD_SUBTARGET:=cortexa7
NAME:=Orange Pi PC (H3)
BUILD_DEVICES:=sun8i-h3-orangepi-pc
endef
define U-Boot/orangepi_plus
BUILD_SUBTARGET:=cortexa7
NAME:=Orange Pi Plus (H3)
@ -168,6 +174,14 @@ define U-Boot/pangolin
UENV:=pangolin
endef
define U-Boot/nanopi_neo_plus2
BUILD_SUBTARGET:=cortexa53
NAME:=NanoPi NEO Plus2 (H5)
BUILD_DEVICES:=sun50i-h5-nanopi-neo-plus2
DEPENDS:=+PACKAGE_u-boot-nanopi_neo_plus2:arm-trusted-firmware-sunxi
UENV:=a64
endef
define U-Boot/pine64_plus
BUILD_SUBTARGET:=cortexa53
NAME:=Pine64 Plus A64
@ -176,6 +190,23 @@ define U-Boot/pine64_plus
UENV:=a64
endef
define U-Boot/sopine_baseboard
BUILD_SUBTARGET:=cortexa53
NAME:=Sopine Baseboard
BUILD_DEVICES:=sun50i-a64-sopine-baseboard
DEPENDS:=+PACKAGE_u-boot-sopine_baseboard:arm-trusted-firmware-sunxi
UENV:=a64
endef
define U-Boot/orangepi_zero_plus
BUILD_SUBTARGET:=cortexa53
NAME:=Xunlong Orange Pi Zero Plus
BUILD_DEVICES:=sun50i-h5-orangepi-zero-plus
DEPENDS:=+PACKAGE_u-boot-orangepi_zero_plus:arm-trusted-firmware-sunxi
UENV:=a64
endef
UBOOT_TARGETS := \
A10-OLinuXino-Lime \
A13-OLinuXino \
@ -197,11 +228,15 @@ UBOOT_TARGETS := \
Lamobo_R1 \
nanopi_m1_plus \
nanopi_neo \
nanopi_neo_plus2 \
orangepi_r1 \
orangepi_pc \
orangepi_plus \
orangepi_2 \
pangolin \
pine64_plus
pine64_plus \
sopine_baseboard \
orangepi_zero_plus
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes

View File

@ -1,6 +1,6 @@
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
@@ -261,6 +261,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \
sun6i-a31-m9.dtb \
sun6i-a31-mele-a1000g-quad.dtb \
sun6i-a31-mixtile-loftq.dtb \
@ -360,7 +360,7 @@
+CONFIG_SUNXI_SPI=y
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL
@@ -752,6 +752,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,76 +0,0 @@
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

@ -1,31 +0,0 @@
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>;

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