update to R7.5.4

This commit is contained in:
coolsnowwolf 2018-01-15 18:26:41 +08:00
parent a242142c39
commit 20f7e75789
703 changed files with 27268 additions and 23733 deletions

View File

@ -62,7 +62,7 @@ config KERNEL_PROFILING
config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information"
default n
default y if !SMALL_FLASH
help
This will give you more information in stack traces from kernel oopses.
@ -607,6 +607,17 @@ config KERNEL_SECCOMP
help
Build kernel with support for seccomp.
#
# IPv4 configuration
#
config KERNEL_IP_MROUTE
bool "Enable IPv4 multicast routing"
default y
help
Multicast routing requires a multicast routing daemon in
addition to kernel support.
#
# IPv6 configuration
#
@ -623,7 +634,11 @@ if KERNEL_IPV6
def_bool y
config KERNEL_IPV6_MROUTE
def_bool y
bool "Enable IPv6 multicast routing"
default y
help
Multicast routing requires a multicast routing daemon in
addition to kernel support.
config KERNEL_IPV6_PIMSM_V2
def_bool n

View File

@ -1,5 +1,5 @@
src-git packages https://git.lede-project.org/feed/packages.git
src-git luci https://git.lede-project.org/project/luci.git;lede-17.01
src-git luci https://git.lede-project.org/project/luci.git
src-git routing https://git.lede-project.org/feed/routing.git
src-git telephony https://git.lede-project.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git

View File

@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),)
endif
ifneq ($(filter libtool,$(PKG_FIXUP)),)
PKG_BUILD_DEPENDS += libtool libintl libiconv
PKG_BUILD_DEPENDS += libtool gettext libiconv
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
Hooks/Configure/Pre += autoreconf_target
endif
endif
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
PKG_BUILD_DEPENDS += libtool libintl libiconv
PKG_BUILD_DEPENDS += libtool gettext libiconv
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)
Hooks/Configure/Pre += autoreconf_target
endif

View File

@ -6,8 +6,10 @@
# See /LICENSE for more information.
#
OPENWRT_GIT = http://git.openwrt.org
LEDE_GIT = https://git.lede-project.org
PROJECT_GIT = https://git.openwrt.org
OPENWRT_GIT = $(PROJECT_GIT)
LEDE_GIT = $(PROJECT_GIT)
ifdef PKG_SOURCE_VERSION
PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION))

View File

@ -229,6 +229,19 @@ define Build/combined-image
@mv $@.new $@
endef
define Build/openmesh-image
$(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
"$@-fwupgrade.cfg" \
"$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \
"$(call param_get_default,rootfs,$(1),$@)"
$(TOPDIR)/scripts/combined-ext-image.sh \
"$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \
"$@-fwupgrade.cfg" "fwupgrade.cfg" \
"$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \
"$(call param_get_default,rootfs,$(1),$@)" "rootfs"
endef
define Build/sysupgrade-tar
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \

View File

@ -303,9 +303,9 @@ target-dir-%: FORCE
$(opkg_target) update && \
$(opkg_target) install \
$(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))
-mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg
rm -f $(mkfs_cur_target_dir).conf
$(KDIR)/root.%: kernel_prepare
$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))

View File

@ -63,6 +63,8 @@ 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
echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config
@ -78,6 +80,7 @@ define Kernel/SetNoInitramfs
mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set
echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set
endef
define Kernel/Configure/Default

View File

@ -23,7 +23,7 @@ else
endif
PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl
PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include

View File

@ -7,23 +7,17 @@
ifneq ($(DUMP),)
dumpinfo: FORCE
define Config/template
Preconfig: $(1)
Preconfig-Type: $(2)
Preconfig-Default: $(3)
Preconfig-Label: $(4)
define SOURCE_INFO
$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
)
endef
define Config
Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4))
preconfig_$$(1) += $(1)
endef
define Dumpinfo/Package
$(info Package: $(1)
$(info $(SOURCE_INFO)Package: $(1)
$(if $(MENU),Menu: $(MENU)
)$(if $(SUBMENU),Submenu: $(SUBMENU)
)$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP)
@ -36,10 +30,7 @@ Menu-Depends: $(MDEPENDS)
Provides: $(PROVIDES)
$(if $(VARIANT),Build-Variant: $(VARIANT)
$(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT)
))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS)
)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS)
)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES)
)Section: $(SECTION)
))Section: $(SECTION)
Category: $(CATEGORY)
$(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base)
)Title: $(TITLE)
@ -59,33 +50,11 @@ $(if $(URL),$(URL)
$(if $(Package/$(1)/config),Config:
$(Package/$(1)/config)
@@
)$(foreach pc,$(preconfig_$(1)),
$(Preconfig/$(pc))))
))
SOURCE_INFO :=
endef
define Feature/Default
TARGET_NAME:=
TARGET_TITLE:=
PRIORITY:=
NAME:=
endef
define Feature
$(eval $(Feature/Default))
$(eval $(Feature/$(1)))
$(if $(DUMP),$(call Dumpinfo/Feature,$(1)))
endef
define Dumpinfo/Feature
$(info Feature: $(TARGET_NAME)_$(1)
Target-Name: $(TARGET_NAME)
Target-Title: $(TARGET_TITLE)
Feature-Name: $(NAME)
$(if $(PRIORITY),Feature-Priority: $(PRIORITY)
)Feature-Description:
$(Feature/$(1)/description)
@@
)
endef
dumpinfo: FORCE
$(if $(SOURCE_INFO),$(info $(SOURCE_INFO)))
endif

View File

@ -10,8 +10,8 @@ curdir:=package
include $(INCLUDE_DIR)/rootfs.mk
-include $(TMP_DIR)/.packagedeps
$(curdir)/autoremove:=1
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
$(curdir)/builddirs-install:=.
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
ifdef CHECK_ALL
@ -56,10 +56,14 @@ $(curdir)/merge:
$(curdir)/merge-index: $(curdir)/merge
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
ifndef SDK
$(curdir)/compile: $(curdir)/system/opkg/host/compile
endif
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
mkdir -p $(TARGET_DIR)/tmp
$(call opkg,$(TARGET_DIR)) install \
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
@for file in $(PACKAGE_INSTALL_FILES); do \
@ -68,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir
$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
done; \
done || true
@-$(MAKE) package/preconfig
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
@ -92,8 +95,6 @@ ifdef CONFIG_SIGNED_PACKAGES
); done
endif
$(curdir)/preconfig:
$(curdir)/flags-install:= -j1
$(eval $(call stampfile,$(curdir),package,prereq,.config))

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=181
PKG_RELEASE:=183
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View File

@ -24,8 +24,8 @@ generate_static_network() {
json_select dsl
if json_is_a atmbridge object; then
json_select atmbridge
local vpi vci encaps payload
json_get_vars vpi vci encaps payload
local vpi vci encaps payload nameprefix
json_get_vars vpi vci encaps payload nameprefix
uci -q batch <<-EOF
delete network.atm
set network.atm='atm-bridge'
@ -33,6 +33,7 @@ generate_static_network() {
set network.atm.vci='$vci'
set network.atm.encaps='$encaps'
set network.atm.payload='$payload'
set network.atm.nameprefix='$nameprefix'
EOF
json_select ..
fi

View File

@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2015 OpenWrt.org
START=98
START=94
STOP=10
USE_PROCD=1
@ -22,10 +22,9 @@ load_gpio_switch()
echo "$gpio_pin" >/sys/class/gpio/export
# we need to wait a bit until the GPIO appears
[ -d "$gpio_path" ] || sleep 1
echo out >"$gpio_path/direction"
}
# write 0 or 1 to the "value" field
{ [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value"
# set the pin to output with high or low pin value
{ [ "$value" = "0" ] && echo "high" || echo "low"; } >"$gpio_path/direction"
}
service_triggers()

View File

@ -319,6 +319,7 @@ ucidef_add_atm_bridge() {
local vci="$2"
local encaps="$3"
local payload="$4"
local nameprefix="$5"
json_select_object dsl
json_select_object atmbridge
@ -326,6 +327,7 @@ ucidef_add_atm_bridge() {
json_add_int vci "$vci"
json_add_string encaps "$encaps"
json_add_string payload "$payload"
json_add_string nameprefix "$nameprefix"
json_select ..
json_select ..
}

View File

@ -55,7 +55,6 @@ Usage: $0 [<upgrade-option>...] <image file or URL>
$0 [-q] [-i] <backup-command> <file>
upgrade-option:
-d <delay> add a delay before rebooting
-f <config> restore configuration from .tar.gz (file or url)
-i interactive mode
-c attempt to preserve all changed files in /etc/

View File

@ -56,7 +56,8 @@ define Package/apex/install
endef
define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR)
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/
endef
$(eval $(call BuildPackage,apex))

View File

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

View File

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

View File

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

View File

@ -9,6 +9,7 @@ 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

View File

@ -1,12 +1,5 @@
menu "Configuration"
depends on PACKAGE_kexec-tools
config KEXEC_TOOLS_kdump
bool
prompt "kdump support"
default n
help
Include the kdump utility.
depends on PACKAGE_kexec
config KEXEC_ZLIB
bool

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.14-rc1
PKG_VERSION:=2.0.14
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b
PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6
PKG_FIXUP:=autoreconf
@ -21,22 +21,49 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
include $(INCLUDE_DIR)/package.mk
define Package/kexec-tools
define Package/kexec-tools/Default
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma
TITLE:=Kernel boots kernel
URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
MENU:=1
endef
define Package/kexec-tools
$(call Package/kexec-tools/Default)
TITLE:=kexec-tools transition meta package
DEPENDS:=+kexec
endef
define Package/kexec-tools/description
kexec is a set of systems call that allows you to load
kexec is a set of system calls that allows you to load
another kernel from the currently executing Linux kernel.
The kexec utility allows to load and boot another kernel.
endef
define Package/kexec-tools/config
define Package/kexec
$(call Package/kexec-tools/Default)
TITLE:=Kernel boots kernel
DEPENDS:=\
@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \
+KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
endef
define Package/kexec/description
The kexec utility allows to load and boot another kernel.
endef
define Package/kdump
$(call Package/kexec-tools/Default)
TITLE:=Kernel crash analysis
DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP
endef
define Package/kdump/description
The kdump package allows to automatically boot into a
special kernel for analyzing kernel crashes using kdump.
endef
define Package/kexec/config
source "$(SOURCE)/Config.in"
endef
@ -65,24 +92,45 @@ CONFIGURE_VARS += \
BUILD_CC="$(HOSTCC)" \
TARGET_CC="$(TARGET_CC)"
kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
endef
define Package/kexec-tools/install
:
endef
define Package/kexec/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) \
$(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
$(kexec-extra-sbin-y)) \
$(kexec-extra-bin-y) \
$(PKG_INSTALL_DIR)/usr/sbin/kexec \
$(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin
# make a link for compatability with other distros
$(INSTALL_DIR) $(1)/sbin
$(LN) ../usr/sbin/kexec $(1)/sbin/kexec
endef
define Package/kdump/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin
$(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump
$(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump
$(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump
endef
define Package/kdump/prerm
#!/bin/sh
case $$(uname -m) in
i?86|x86_64)
if grep -q " crashkernel=" /boot/grub/grub.cfg; then
mount /boot -o remount,rw
sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg
mount /boot -o remount,ro
fi
;;
esac
endef
$(eval $(call BuildPackage,kexec-tools))
$(eval $(call BuildPackage,kexec))
$(eval $(call BuildPackage,kdump))

View File

@ -0,0 +1,7 @@
config kdump
option enabled '1'
option save_dmesg '1'
option save_vmcore '0'
# using an external partition to store vmcore is highly recommended!
# option path '/mnt/crashdump'

View File

@ -0,0 +1,11 @@
#!/bin/sh
case $(uname -m) in
i?86|x86_64)
if ! grep -q crashkernel /boot/grub/grub.cfg; then
mount /boot -o remount,rw
sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg
mount /boot -o remount,ro
fi
;;
esac

View File

@ -0,0 +1,182 @@
#!/bin/sh /etc/rc.common
START=41
STOP=98
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Print crashkernel status"
verify_kdump() {
local cfg="$1"
local enabled
local path
local save_vmcore
local save_dmesg
config_get_bool enabled "$cfg" enabled 1
config_get_bool save_dmesg "$cfg" save_dmesg 1
config_get_bool save_vmcore "$cfg" save_vmcore 0
[ "$enabled" -gt 0 ] || return 2
[ "$save_dmesg" -gt 0 ] || [ "$save_vmcore" -gt 0 ] || return 2
config_get path "$cfg" path "/"
[ -d "$path" ] || mkdir -p "$path" 2>/dev/null || return 1
}
run_kdump() {
local cfg="$1"
local enabled
local path
local save_vmcore
local save_dmesg
config_get_bool enabled "$cfg" enabled 1
[ "$enabled" -gt 0 ] || return
config_get_bool save_dmesg "$cfg" save_dmesg 1
config_get_bool save_vmcore "$cfg" save_vmcore 0
config_get path "$cfg" path "/"
timestamp=$(date "+%Y%m%dT%H%M%S")
if [ "$save_vmcore" -eq 1 ]; then
# would like 'sparse' but busybox doesn't support it
dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M
fi
if [ "$save_dmesg" -eq 1 ]; then
vmcore-dmesg /proc/vmcore > "$path/dmesg-$timestamp"
fi
sync
reboot -f
}
find_kernel() {
. /lib/functions.sh
local kernel
kernel="$BOOT_IMAGE"
if [ -r "$kernel" ]; then
echo $kernel
return 0
fi
kernel="$(find_mtd_part kernel)"
if [ -r "$kernel" ]; then
echo $kernel
return 0
fi
for voldir in /sys/class/ubi/ubi*_*; do
[ ! -e "$voldir" ] && continue
if [ "$(cat "${voldir}/name")" = "kernel" ]; then
kernel="/dev/$(basename "$voldir")"
echo $kernel
return 0
fi
done
return 1
}
load_crashkernel() {
local append_cmdline
local kernel
kernel="$(find_kernel)"
[ $? -gt 0 ] && return 1
case "$(uname -m)" in
i?86|x86_64)
grep -q "crashkernel=" /proc/cmdline || return 1
append_cmdline="1 irqpoll reset_devices maxcpus=1"
;;
arm*)
append_cmdline="1 maxcpus=1 reset_devices"
;;
esac
kexec -p "$kernel" --reuse-cmdline --append="$append_cmdline"
return $?
}
start() {
local retval
if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
return 1
fi
if [ -e /proc/vmcore ]; then
config_load kdump
config_foreach run_kdump kdump
else
config_load kdump
config_foreach verify_kdump kdump
retval=$?
[ $retval = 1 ] && return 1
[ $retval = 0 ] && load_crashkernel
return $?
fi
}
stop() {
[ "$(cat /sys/kernel/kexec_crash_loaded)" = "1" ] || return
if [ -e "$BOOT_IMAGE" ]; then
kexec -p -u "$BOOT_IMAGE"
fi
}
status() {
local retval kernel
if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
echo "crashdump not supported by kernel"
return
fi
if [ $(cat /sys/kernel/kexec_crash_size) -eq 0 ]; then
echo "memory for crashdump kernel not reserved!"
echo "check crashkernel= kernel cmdline parameter"
echo "(a reboot is required after installing kdump)"
return
fi
kernel="$(find_kernel)"
if [ $? -gt 0 ]; then
echo "cannot find kernel image"
return
else
echo "using kernel image $kernel"
fi
echo -n "kdump configuration is "
config_load kdump
retval=$?
if [ $retval = 0 ]; then
if [ "$(config_foreach echo kdump)" ]; then
config_foreach verify_kdump kdump
retval=$?
else
retval=1
fi
fi
if [ $retval = 0 ]; then
echo "valid"
elif [ $retval = 2 ]; then
echo "disabled"
else
echo "BROKEN"
fi
echo -n "kexec crash kernel "
if [ "$(cat /sys/kernel/kexec_crash_loaded)" = "0" ]; then
echo -n "not "
fi
echo "loaded"
}

View File

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

View File

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

View File

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

View File

@ -32,6 +32,7 @@
#define RB_ID_BOOT_PROTOCOL 9
#define RB_ID_SOFT_10 10
#define RB_ID_SOFT_11 11
#define RB_ID_CPU_FREQ 12
#define RB_ID_BOOTER 13
#define RB_UART_SPEED_115200 0
@ -59,6 +60,8 @@
#define RB_BOOT_DEVICE_CFCARD 2
#define RB_BOOT_DEVICE_ETHONCE 3
#define RB_BOOT_DEVICE_NANDONLY 5
#define RB_BOOT_DEVICE_FLASHCFG 7
#define RB_BOOT_DEVICE_FLSHONCE 8
#define RB_BOOT_KEY_ANY 0
#define RB_BOOT_KEY_DEL 1
@ -69,6 +72,13 @@
#define RB_BOOT_PROTOCOL_BOOTP 0
#define RB_BOOT_PROTOCOL_DHCP 1
#define RB_CPU_FREQ_L2 (0 << 3)
#define RB_CPU_FREQ_L1 (1 << 3)
#define RB_CPU_FREQ_N0 (2 << 3)
#define RB_CPU_FREQ_H1 (3 << 3)
#define RB_CPU_FREQ_H2 (4 << 3)
#define RB_CPU_FREQ_H3 (5 << 3)
#define RB_BOOTER_REGULAR 0
#define RB_BOOTER_BACKUP 1

View File

@ -6,90 +6,28 @@
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=u-boot
PKG_VERSION:=2010.03
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_HASH:=902d1b2c15787df55186fae4033685fb0c5a5a12755a08383e97c4a3e255925b
PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_TARGETS:=bin
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
CONFIG:=
IMAGE:=
define U-Boot/Default
BUILD_TARGET:=ar71xx
BUILD_SUBTARGET:=generic
endef
define uboot/nbg460n_550n_550nh
TITLE:=U-boot for the NBG460N/550N/550NH routers
DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default)
define U-Boot/nbg460n_550n_550nh
TITLE:=NBG460N/550N/550NH routers
BUILD_DEVICES:=NBG_460N_550N_550NH
HIDDEN:=y
endef
UBOOTS:=nbg460n_550n_550nh
UBOOT_MAKE_FLAGS :=
define Package/uboot/template
define Package/uboot-ar71xx-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:=$(2)
DEPENDS:=@TARGET_ar71xx_generic
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
endef
endef
UBOOT_TARGETS:=nbg460n_550n_550nh
define BuildUbootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef
ifdef BUILD_VARIANT
$(eval $(call uboot/$(BUILD_VARIANT)))
UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
endif
define Build/Prepare
$(call Build/Prepare/Default)
$(CP) ./files/* $(PKG_BUILD_DIR)
find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
endef
define Build/Configure
$(MAKE) -C $(PKG_BUILD_DIR) \
$(UBOOT_CONFIG)_config
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS)
endef
define Package/uboot/install/template
define Package/uboot-ar71xx-$(1)/install
$(INSTALL_DIR) $$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2)
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUbootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-ar71xx-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

@ -7,96 +7,89 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2016.05
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
define U-Boot/Default
BUILD_TARGET:=at91
HIDDEN:=1
UBOOT_IMAGE:=u-boot.bin boot.bin
endef
define uboot/at91sam9m10g45ek_nandflash
TITLE:=U-Boot for the AT91SAM9M10G45-EK board (NandFlash)
define U-Boot/at91sam9m10g45ek_nandflash
NAME:=AT91SAM9M10G45-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9m10g45ek
endef
define uboot/at91sam9x5ek_nandflash
TITLE:=U-Boot for the AT91SAM9X5-EK board (NandFlash)
define U-Boot/at91sam9x5ek_nandflash
NAME:=AT91SAM9X5-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek
endef
UBOOTS := \
define U-Boot/sama5d3_xplained_nandflash
NAME:=SAMA5D3 Xplained board (NandFlash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define U-Boot/sama5d3_xplained_mmc
NAME:=SAMA5D3 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d3_xplained
endef
define U-Boot/sama5d2_xplained_spiflash
NAME:=SAMA5D2 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define U-Boot/sama5d2_xplained_mmc
NAME:=SAMA5D2 Xplained board (SDcard/EMMC)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d2_xplained
endef
define U-Boot/sama5d4_xplained_spiflash
NAME:=SAMA5D4 Xplained board (SPI Flash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define U-Boot/sama5d4_xplained_mmc
NAME:=SAMA5D4 Xplained board (SDcard)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
define U-Boot/sama5d4_xplained_nandflash
NAME:=SAMA5D4 Xplained board (NandFlash)
BUILD_SUBTARGET:=sama5
BUILD_DEVICES:=at91-sama5d4_xplained
endef
UBOOT_TARGETS := \
at91sam9m10g45ek_nandflash \
at91sam9x5ek_nandflash
define Package/uboot/template
define Package/uboot-at91-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_at91
TITLE:=$(2)
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
MAINTAINER:=Ben Whitten <ben.whitten@gmail.com>
endef
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef
ifdef BUILD_VARIANT
$(eval $(call uboot/$(BUILD_VARIANT)))
UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),lede-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
endif
define Build/Configure
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(UBOOT_CONFIG)_config
endef
at91sam9x5ek_nandflash \
sama5d3_xplained_nandflash \
sama5d3_xplained_mmc \
sama5d2_xplained_mmc \
sama5d2_xplained_spiflash \
sama5d4_xplained_mmc \
sama5d4_xplained_spiflash \
sama5d4_xplained_nandflash
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) \
KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft"
endef
define Package/uboot/install/default
$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.bin
$(CP) $(PKG_BUILD_DIR)/boot.bin \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin
endef
define Package/uboot/install/template
define Package/uboot-at91-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-at91-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
PKG_BUILD_DEPENDS:=+fstools
PKG_BUILD_DEPENDS:=fstools
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
@ -112,6 +112,10 @@ 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

View File

@ -7,11 +7,10 @@
touch /etc/config/ubootenv
. /lib/ar71xx.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(ar71xx_board_name)
board=$(board_name)
case "$board" in
a40|\
@ -20,6 +19,8 @@ alfa-ap120c|\
all0258n|\
ap121f|\
ap90q|\
ap91-5g|\
arduino-yun|\
cap324|\
cap4200ag|\
carambola2|\
@ -28,7 +29,9 @@ cpe870|\
cr3000|\
cr5000|\
eap300v2|\
ens202ext|\
gl-ar300m|\
gl-ar750|\
hornet-ub|\
hornet-ub-x2|\
jwap230|\
@ -38,11 +41,13 @@ mr600|\
mr600v2|\
mr900|\
mr900v2|\
n5q|\
nbg6716|\
om5p|\
om5p-ac|\
om5p-acv2|\
om5p-an|\
r36a|\
sr3200|\
tube2h|\
wndr3700|\
@ -65,12 +70,20 @@ dap-2695-a1|\
wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
;;
dr342|\
dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
;;
rambutan)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000"
;;
qihoo-c301)
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
;;
wi2a-ac200i)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000"
;;
esac
config_load ubootenv

View File

@ -7,11 +7,10 @@
touch /etc/config/ubootenv
. /lib/cns3xxx.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(cns3xxx_board_name)
board=$(board_name)
case "$board" in
laguna)

View File

@ -7,11 +7,10 @@
touch /etc/config/ubootenv
. /lib/imx6.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(imx6_board_name)
board=$(board_name)
case "$board" in
*gw5*)

View File

@ -7,17 +7,41 @@
touch /etc/config/ubootenv
. /lib/ipq806x.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(ipq806x_board_name)
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
ea8500)
linksys,ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
;;
nbg6817)
openmesh,a42)
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000"
;;
qcom,ipq8064-ap148 |\
qcom,ipq8064-db149)
ubootenv_add_uci_config $(ubootenv_mtdinfo)
;;
zyxel,nbg6817)
ubootenv_add_uci_config "/dev/mtdblock9" "0x0" "0x10000" "0x10000"
;;
esac

View File

@ -7,23 +7,22 @@
touch /etc/config/ubootenv
. /lib/kirkwood.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(kirkwood_board_name)
board=$(board_name)
case "$board" in
dockstar|\
guruplug-server-plus|\
ib62x0|\
linksys-viper|\
pogo_e02|\
sheevaplug|\
sheevaplug-esata)
cloudengines,pogoe02|\
cloudengines,pogoplugv4|\
linksys,viper|\
raidsonic,ib-nas62x0|\
seagate,dockstar|\
zyxel,nsa310b|\
zyxel,nsa325)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
linksys-audi)
linksys,audi)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
;;
esac

View File

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

View File

@ -8,11 +8,10 @@
touch /etc/config/ubootenv
. /lib/mvebu.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(mvebu_board_name)
board=$(board_name)
case "$board" in
armada-385-linksys-caiman|\

View File

@ -7,11 +7,10 @@
touch /etc/config/ubootenv
. /lib/mxs.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(mxs_board_name)
board=$(board_name)
case "$board" in
duckbill)

View File

@ -7,11 +7,10 @@
touch /etc/config/ubootenv
. /lib/oxnas.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(oxnas_board_name)
board=$(board_name)
case "$board" in
akitio|\

View File

@ -0,0 +1,27 @@
#!/bin/sh
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
[ -e /etc/config/ubootenv ] && exit 0
touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(board_name)
case "$board" in
img,pistachio-marduk)
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000"
;;
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
exit 0

View File

@ -7,21 +7,19 @@
touch /etc/config/ubootenv
. /lib/ramips.sh
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(ramips_board_name)
board=$(board_name)
case "$board" in
all0239-3g|\
all0256n|\
all0256n-4M|\
all0256n-8M|\
all5002)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
br-6425|\
linkits7688|\
linkits7688d|\
miwifi-nano|\
sk-wb8|\
wsr-1166|\
@ -29,6 +27,9 @@ wsr-600|\
zbt-wg2626)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
mir3g)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;;
esac
config_load ubootenv

View File

@ -0,0 +1,54 @@
#
# Copyright (C) 2013-2014 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_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6946ebbaf7b12a4a092d763c8f0c87a25984f103
PKG_SOURCE_DATE:=2017-01-29
PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b
PKG_RELEASE:=1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=ipq806x
UBOOT_IMAGE:=uboot-fritz4040.bin
endef
define U-Boot/fritz4040
NAME:=FritzBox 4040
endef
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
UBOOT_MAKE_FLAGS += USE_PRIVATE_LIBGCC=yes
export DTC
define Build/Configure
$(Build/Configure/U-Boot)
$(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
endef
define Build/Compile
$(Build/Compile/U-Boot)
(cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;)
endef
define Package/u-boot/install
$(Package/u-boot/install/default)
$(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/
endef
UBOOT_TARGETS := fritz4040
$(eval $(call BuildPackage/U-Boot))

View File

@ -0,0 +1,41 @@
#!/bin/sh
die() {
echo $1
exit 1
}
FRITZBOX='192.168.178.1'
USER='adam2'
PASSWD='adam2'
FILE='uboot-fritz4040.bin'
ping -q -4 -w 1 -c 1 "$FRITZBOX" &> /dev/null || die "Fritzbox at $FRITZBOX is not reachable. aborting"
cat << EOS
This will take ages (2 minutes)! If you want a
status bar: Attach a serial to the device and look there.
Note: If this fails, you need to use AVM\' recover
utility to get your box back. However this step
should not damage your box....
Also it doesn't terminate.. :/
(Note: Make sure that you connected the router on
the yellow LAN ports and not the blue WAN).
EOS
ftp -n -4 "$FRITZBOX" << END_SCRIPT
quote USER $USER
quote PASS $PASSWD
quote MEDIA FLSH
binary
passive
put $FILE mtd1
quote check mtd1
bye
END_SCRIPT
exit 0

View File

@ -0,0 +1,274 @@
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(ARCH).o
LIBGCC = $(obj)libgcc.o
-ifndef CONFIG_SPL_BUILD
GLSOBJS += _ashldi3.o
GLSOBJS += _ashrdi3.o
GLSOBJS += _divsi3.o
@@ -34,9 +33,11 @@ GLSOBJS += _lshrdi3.o
GLSOBJS += _modsi3.o
GLSOBJS += _udivsi3.o
GLSOBJS += _umodsi3.o
+GLSOBJS += uldivmod.o
GLCOBJS += div0.o
+ifndef CONFIG_SPL_BUILD
COBJS-y += board.o
COBJS-y += bootm.o
COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
--- /dev/null
+++ b/arch/arm/lib/uldivmod.S
@@ -0,0 +1,249 @@
+/*
+ * Copyright 2010, Google Inc.
+ *
+ * Brought in from coreboot uldivmod.S
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+/*
+ * A, Q = r0 + (r1 << 32)
+ * B, R = r2 + (r3 << 32)
+ * A / B = Q ... R
+ */
+
+#define ARM(x...) x
+#define THUMB(x...)
+
+A_0 .req r0
+A_1 .req r1
+B_0 .req r2
+B_1 .req r3
+C_0 .req r4
+C_1 .req r5
+D_0 .req r6
+D_1 .req r7
+
+Q_0 .req r0
+Q_1 .req r1
+R_0 .req r2
+R_1 .req r3
+
+THUMB(
+TMP .req r8
+)
+
+.pushsection .text.__aeabi_uldivmod, "ax"
+ENTRY(__aeabi_uldivmod)
+
+ stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr}
+ @ Test if B == 0
+ orrs ip, B_0, B_1 @ Z set -> B == 0
+ beq L_div_by_0
+ @ Test if B is power of 2: (B & (B - 1)) == 0
+ subs C_0, B_0, #1
+ sbc C_1, B_1, #0
+ tst C_0, B_0
+ tsteq B_1, C_1
+ beq L_pow2
+ @ Test if A_1 == B_1 == 0
+ orrs ip, A_1, B_1
+ beq L_div_32_32
+
+L_div_64_64:
+/* CLZ only exists in ARM architecture version 5 and above. */
+#ifdef HAVE_CLZ
+ mov C_0, #1
+ mov C_1, #0
+ @ D_0 = clz A
+ teq A_1, #0
+ clz D_0, A_1
+ clzeq ip, A_0
+ addeq D_0, D_0, ip
+ @ D_1 = clz B
+ teq B_1, #0
+ clz D_1, B_1
+ clzeq ip, B_0
+ addeq D_1, D_1, ip
+ @ if clz B - clz A > 0
+ subs D_0, D_1, D_0
+ bls L_done_shift
+ @ B <<= (clz B - clz A)
+ subs D_1, D_0, #32
+ rsb ip, D_0, #32
+ movmi B_1, B_1, lsl D_0
+ARM( orrmi B_1, B_1, B_0, lsr ip )
+THUMB( lsrmi TMP, B_0, ip )
+THUMB( orrmi B_1, B_1, TMP )
+ movpl B_1, B_0, lsl D_1
+ mov B_0, B_0, lsl D_0
+ @ C = 1 << (clz B - clz A)
+ movmi C_1, C_1, lsl D_0
+ARM( orrmi C_1, C_1, C_0, lsr ip )
+THUMB( lsrmi TMP, C_0, ip )
+THUMB( orrmi C_1, C_1, TMP )
+ movpl C_1, C_0, lsl D_1
+ mov C_0, C_0, lsl D_0
+L_done_shift:
+ mov D_0, #0
+ mov D_1, #0
+ @ C: current bit; D: result
+#else
+ @ C: current bit; D: result
+ mov C_0, #1
+ mov C_1, #0
+ mov D_0, #0
+ mov D_1, #0
+L_lsl_4:
+ cmp B_1, #0x10000000
+ cmpcc B_1, A_1
+ cmpeq B_0, A_0
+ bcs L_lsl_1
+ @ B <<= 4
+ mov B_1, B_1, lsl #4
+ orr B_1, B_1, B_0, lsr #28
+ mov B_0, B_0, lsl #4
+ @ C <<= 4
+ mov C_1, C_1, lsl #4
+ orr C_1, C_1, C_0, lsr #28
+ mov C_0, C_0, lsl #4
+ b L_lsl_4
+L_lsl_1:
+ cmp B_1, #0x80000000
+ cmpcc B_1, A_1
+ cmpeq B_0, A_0
+ bcs L_subtract
+ @ B <<= 1
+ mov B_1, B_1, lsl #1
+ orr B_1, B_1, B_0, lsr #31
+ mov B_0, B_0, lsl #1
+ @ C <<= 1
+ mov C_1, C_1, lsl #1
+ orr C_1, C_1, C_0, lsr #31
+ mov C_0, C_0, lsl #1
+ b L_lsl_1
+#endif
+L_subtract:
+ @ if A >= B
+ cmp A_1, B_1
+ cmpeq A_0, B_0
+ bcc L_update
+ @ A -= B
+ subs A_0, A_0, B_0
+ sbc A_1, A_1, B_1
+ @ D |= C
+ orr D_0, D_0, C_0
+ orr D_1, D_1, C_1
+L_update:
+ @ if A == 0: break
+ orrs ip, A_1, A_0
+ beq L_exit
+ @ C >>= 1
+ movs C_1, C_1, lsr #1
+ movs C_0, C_0, rrx
+ @ if C == 0: break
+ orrs ip, C_1, C_0
+ beq L_exit
+ @ B >>= 1
+ movs B_1, B_1, lsr #1
+ mov B_0, B_0, rrx
+ b L_subtract
+L_exit:
+ @ Note: A, B & Q, R are aliases
+ mov R_0, A_0
+ mov R_1, A_1
+ mov Q_0, D_0
+ mov Q_1, D_1
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
+
+L_div_32_32:
+ @ Note: A_0 & r0 are aliases
+ @ Q_1 r1
+ mov r1, B_0
+ bl __aeabi_uidivmod
+ mov R_0, r1
+ mov R_1, #0
+ mov Q_1, #0
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
+
+L_pow2:
+#ifdef HAVE_CLZ
+ @ Note: A, B and Q, R are aliases
+ @ R = A & (B - 1)
+ and C_0, A_0, C_0
+ and C_1, A_1, C_1
+ @ Q = A >> log2(B)
+ @ Note: B must not be 0 here!
+ clz D_0, B_0
+ add D_1, D_0, #1
+ rsbs D_0, D_0, #31
+ bpl L_1
+ clz D_0, B_1
+ rsb D_0, D_0, #31
+ mov A_0, A_1, lsr D_0
+ add D_0, D_0, #32
+L_1:
+ movpl A_0, A_0, lsr D_0
+ARM( orrpl A_0, A_0, A_1, lsl D_1 )
+THUMB( lslpl TMP, A_1, D_1 )
+THUMB( orrpl A_0, A_0, TMP )
+ mov A_1, A_1, lsr D_0
+ @ Mov back C to R
+ mov R_0, C_0
+ mov R_1, C_1
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
+#else
+ @ Note: A, B and Q, R are aliases
+ @ R = A & (B - 1)
+ and C_0, A_0, C_0
+ and C_1, A_1, C_1
+ @ Q = A >> log2(B)
+ @ Note: B must not be 0 here!
+ @ Count the leading zeroes in B.
+ mov D_0, #0
+ orrs B_0, B_0, B_0
+ @ If B is greater than 1 << 31, divide A and B by 1 << 32.
+ moveq A_0, A_1
+ moveq A_1, #0
+ moveq B_0, B_1
+ @ Count the remaining leading zeroes in B.
+ movs B_1, B_0, lsl #16
+ addeq D_0, #16
+ moveq B_0, B_0, lsr #16
+ tst B_0, #0xff
+ addeq D_0, #8
+ moveq B_0, B_0, lsr #8
+ tst B_0, #0xf
+ addeq D_0, #4
+ moveq B_0, B_0, lsr #4
+ tst B_0, #0x3
+ addeq D_0, #2
+ moveq B_0, B_0, lsr #2
+ tst B_0, #0x1
+ addeq D_0, #1
+ @ Shift A to the right by the appropriate amount.
+ rsb D_1, D_0, #32
+ mov Q_0, A_0, lsr D_0
+ ARM( orr Q_0, Q_0, A_1, lsl D_1 )
+ THUMB( lsl A_1, D_1 )
+ THUMB( orr Q_0, A_1 )
+ mov Q_1, A_1, lsr D_0
+ @ Move C to R
+ mov R_0, C_0
+ mov R_1, C_1
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
+#endif
+
+L_div_by_0:
+ bl __div0
+ @ As wrong as it could be
+ mov Q_0, #0
+ mov Q_1, #0
+ mov R_0, #0
+ mov R_1, #0
+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc}
+ENDPROC(__aeabi_uldivmod)
+.popsection

View File

@ -0,0 +1,32 @@
Index: u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh
===================================================================
--- u-boot-2017-01-29-6946ebba.orig/fritz/fritzcreator.sh
+++ u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh
@@ -1,4 +1,4 @@
-#!/bin/sh -xe
+#!/bin/bash -xe
# A helpful
#
@@ -11,6 +11,7 @@ UBOOT_FRITZ4040="uboot-fritz4040.bin"
FRITZ_DTS="fritz/fritz4040.dts"
FRITZ_DTB="fritz4040.dtb"
UBOOT_LOADADDR=0x841FFFF8
+DTC="${DTC:-dtc}"
rm -f "$UBOOT_FRITZ4040"
@@ -44,11 +45,11 @@ printf "\x00\x00\x00\xea\xf8\x01\x33\xc4
cat "$UBOOT_BIN" >> "$UBOOT_FRITZ4040"
# Pad file to 1M
-dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1M count=1 conv=sync
+dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1024k count=1 conv=sync
mv "$UBOOT_FRITZ4040.new" "$UBOOT_FRITZ4040"
# Compile DTS
-dtc "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152
+$DTC "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152
# Append the compiled DTBs
cat "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" >> $UBOOT_FRITZ4040

View File

@ -7,68 +7,63 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2014.04
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
CONFIG:=
IMAGE:=
define U-Boot/Default
BUILD_TARGET:=imx6
UBOOT_IMAGE:=u-boot.imx
endef
define uboot/mx6qsabresd
TITLE:=U-Boot for SABRE i.MX6Quad board
define U-Boot/mx6qsabresd
NAME:=SABRE i.MX6Quad board
endef
define uboot/nitrogen6dl
TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
define U-Boot/nitrogen6dl
NAME:=Nitrogen6x i.MX6Dual-Lite 1GB board
endef
define uboot/nitrogen6dl2g
TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
define U-Boot/nitrogen6dl2g
NAME:=Nitrogen6x i.MX6Dual-Lite 2GB board
endef
define uboot/nitrogen6q
TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
define U-Boot/nitrogen6q
NAME:=Nitrogen6x/SABRE Lite (MX6Q/1GB)
endef
define uboot/nitrogen6q2g
TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
define U-Boot/nitrogen6q2g
NAME:=Nitrogen6x i.MX6Quad 2GB board
endef
define uboot/nitrogen6s
TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
define U-Boot/nitrogen6s
NAME:=Nitrogen6x i.MX6Solo 512MB board
endef
define uboot/nitrogen6s1g
TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
define U-Boot/nitrogen6s1g
NAME:=Nitrogen6x i.MX6Solo 1GB board
endef
define uboot/wandboard_dl
TITLE:=U-Boot for the Wandboard Dual Lite
define U-Boot/wandboard_dl
NAME:=Wandboard Dual Lite
BUILD_DEVICES:=wandboard
endef
define uboot/wandboard_quad
TITLE:=U-Boot for the Wandboard Quad
define U-Boot/wandboard_quad
NAME:=Wandboard Quad
BUILD_DEVICES:=wandboard
endef
define uboot/wandboard_solo
TITLE:=U-Boot for the Wandboard Solo
define U-Boot/wandboard_solo
NAME:=Wandboard Solo
BUILD_DEVICES:=wandboard
endef
UBOOTS := \
UBOOT_TARGETS := \
mx6qsabresd \
nitrogen6dl \
nitrogen6dl2g \
@ -80,58 +75,4 @@ UBOOTS := \
wandboard_quad \
wandboard_solo
define Package/uboot/template
define Package/uboot-imx6-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_imx6
TITLE:=$(2)
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
MAINTAINER:=Luka Perkov <luka@openwrt.org>
endef
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef
ifdef BUILD_VARIANT
$(eval $(call uboot/$(BUILD_VARIANT)))
UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
endif
define Build/Configure
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(UBOOT_CONFIG)_config
endef
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS)
endef
define Package/uboot/install/default
$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) \
$(PKG_BUILD_DIR)/u-boot.imx \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
endef
define Package/uboot/install/template
define Package/uboot-imx6-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-imx6-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

@ -7,93 +7,87 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2016.09.01
PKG_VERSION:=2017.09
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=\
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=95728e89dd476d17428f94080752ab48884be477b6a678941582aeef618b70bb
PKG_TARGETS:=bin
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_BUILD_PARALLEL:=1
PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
define U-Boot/Default
BUILD_TARGET:=kirkwood
endef
define uboot/dockstar
TITLE:=U-Boot for Seagate DockStar
define U-Boot/dockstar
NAME:=Seagate DockStar
BUILD_DEVICES:=seagate_dockstar
endef
define uboot/dockstar_second_stage
TITLE:=second stage U-Boot for Seagate DockStar
define U-Boot/dockstar_second_stage
NAME:=Seagate DockStar (second stage)
BUILD_DEVICES:=seagate_dockstar
endef
define uboot/goflexhome
TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet
define U-Boot/goflexhome
NAME:=the Seagate GoFlexHome/GoFlexNet
BUILD_DEVICES:=seagate_goflexhome seagate_goflexnet
endef
define uboot/ib62x0
TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
define U-Boot/ib62x0
NAME:=RaidSonic ICY BOX NAS6210 and NAS6220
BUILD_DEVICES:=raidsonic_ib-nas62x0
endef
define uboot/ib62x0_second_stage
TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
define U-Boot/ib62x0_second_stage
NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage)
BUILD_DEVICES:=raidsonic_ib-nas62x0
endef
define uboot/iconnect
TITLE:=U-Boot for Iomega iConnect Wireless
define U-Boot/iconnect
NAME:=Iomega iConnect Wireless
BUILD_DEVICES:=iom_iconnect-1.1
endef
define uboot/iconnect_second_stage
TITLE:=second stage U-Boot for Iomega iConnect Wireless
define U-Boot/iconnect_second_stage
NAME:=Iomega iConnect Wireless (second stage)
BUILD_DEVICES:=iom_iconnect-1.1
endef
define uboot/pogo_e02
TITLE:=U-Boot for Cloud Engines Pogoplug E02
define U-Boot/nsa310
NAME:=Zyxel NSA310
BUILD_DEVICES:=zyxel_nsa310b
endef
define uboot/pogo_e02_second_stage
TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02
define U-Boot/nsa325
NAME:=Zyxel NSA325v1 and v2
BUILD_DEVICES:=zyxel_nsa325
endef
define uboot/sheevaplug
TITLE:=U-Boot for SheevaPlug
define U-Boot/pogo_e02
NAME:=Cloud Engines Pogoplug E02
BUILD_DEVICES:=cloudengines_pogoe02
endef
UBOOTS:= \
define U-Boot/pogo_e02_second_stage
NAME:=Cloud Engines Pogoplug E02 (second stage)
BUILD_DEVICES:=cloudengines_pogoe02
endef
define U-Boot/pogoplugv4
NAME:=Cloud Engines Pogoplug V4
BUILD_DEVICES:=cloudengines_pogoplugv4
endef
UBOOT_TARGETS := \
dockstar dockstar_second_stage \
goflexhome \
ib62x0 ib62x0_second_stage \
iconnect iconnect_second_stage \
nsa310 \
nsa325 \
pogo_e02 pogo_e02_second_stage \
sheevaplug
define Package/uboot/template
define Package/uboot-kirkwood-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_kirkwood
TITLE:=$(2)
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
endef
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef
pogoplugv4
define Build/Configure
$(if $(findstring _second_stage,$(BUILD_VARIANT)),
@ -112,34 +106,21 @@ define Build/Compile
CROSS_COMPILE=$(TARGET_CROSS)
mkimage -A $(ARCH) -O linux -T kernel -C none \
-a 0x600000 -e 0x600000 \
-n 'OpenWrt Das U-Boot uImage' \
-n 'U-Boot uImage' \
-d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
endef
define Package/uboot/install/default
$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot.bin \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
$(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
$(CP) $(PKG_BUILD_DIR)/u-boot.img \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
$(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
$(CP) $(PKG_BUILD_DIR)/tools/kwboot \
$(BIN_DIR)/u-boot-kwboot/
define Package/u-boot/install
$(CP) \
$(PKG_BUILD_DIR)/u-boot.bin \
$(PKG_BUILD_DIR)/u-boot.kwb \
$(PKG_BUILD_DIR)/u-boot.img \
$(1)/
endef
define Package/uboot/install/template
define Package/uboot-kirkwood-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

@ -1,27 +0,0 @@
From 280b03ba28b4287de677d4c4b097918364395b5e Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Wed, 2 Jul 2014 01:47:23 +0200
Subject: [PATCH 4/9] kirkwood: ib62x0: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
This is patch was sent already in July:
http://lists.denx.de/pipermail/u-boot/2014-July/182900.html
---
include/configs/ib62x0.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/ib62x0.h
+++ b/include/configs/ib62x0.h
@@ -9,6 +9,8 @@
#ifndef _CONFIG_IB62x0_H
#define _CONFIG_IB62x0_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Version number information
*/

View File

@ -1,23 +0,0 @@
From 5f9e6f640098e6963ff9b470cd5d2ab9f6a3579e Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Sun, 30 Nov 2014 02:40:37 +0100
Subject: [PATCH 5/9] kirkwood: dockstar: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
include/configs/dockstar.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -12,6 +12,8 @@
#ifndef _CONFIG_DOCKSTAR_H
#define _CONFIG_DOCKSTAR_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Version number information
*/

View File

@ -1,23 +0,0 @@
From 0d0a6606396f0cc1a4f2966d167ef9e85d533650 Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Sun, 30 Nov 2014 02:40:51 +0100
Subject: [PATCH 6/9] kirkwood: goflexhome: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
include/configs/goflexhome.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/goflexhome.h
+++ b/include/configs/goflexhome.h
@@ -15,6 +15,8 @@
#ifndef _CONFIG_GOFLEXHOME_H
#define _CONFIG_GOFLEXHOME_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Version number information
*/

View File

@ -1,23 +0,0 @@
From 45ba20427135e526cfa528773de0cfe215f4dc40 Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Sun, 30 Nov 2014 02:41:04 +0100
Subject: [PATCH 7/9] kirkwood: iconnect: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
include/configs/iconnect.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/iconnect.h
+++ b/include/configs/iconnect.h
@@ -9,6 +9,8 @@
#ifndef _CONFIG_ICONNECT_H
#define _CONFIG_ICONNECT_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Version number information
*/

View File

@ -1,23 +0,0 @@
From bd862f4e7a559e38763a5280e35bf7ff14b535f1 Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Sun, 30 Nov 2014 02:41:19 +0100
Subject: [PATCH 8/9] kirkwood: pogo_e02: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
include/configs/pogo_e02.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/pogo_e02.h
+++ b/include/configs/pogo_e02.h
@@ -13,6 +13,8 @@
#ifndef _CONFIG_POGO_E02_H
#define _CONFIG_POGO_E02_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Machine type definition and ID
*/

View File

@ -1,23 +0,0 @@
From 787e23179708ddad7ecd9dcd6c841546689864b0 Mon Sep 17 00:00:00 2001
From: Luka Perkov <luka@openwrt.org>
Date: Sun, 30 Nov 2014 02:41:49 +0100
Subject: [PATCH 9/9] kirkwood: sheevaplug: add CONFIG_SYS_GENERIC_BOARD define
Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Stefan Roese <sr@denx.de>
---
include/configs/sheevaplug.h | 2 ++
1 file changed, 2 insertions(+)
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -10,6 +10,8 @@
#ifndef _CONFIG_SHEEVAPLUG_H
#define _CONFIG_SHEEVAPLUG_H
+#define CONFIG_SYS_GENERIC_BOARD
+
/*
* Version number information
*/

View File

@ -0,0 +1,697 @@
arm: kirkwood: add ZyXEL NSA310 device
This patch add ZyXEL NSA310 1-Bay Media Server
The ZyXEL NSA310 device is a Kirkwood based NAS:
- SoC: Marvell 88F6702 1200Mhz
- SDRAM memory: 256MB DDR2 400Mhz
- Gigabit ethernet: PHY Realtek
- Flash memory: 128MB
- 1 Power button
- 1 Power LED (blue)
- 5 Status LED (green/red)
- 1 Copy/Sync button
- 1 Reset button
- 2 SATA II port (1 internal and 1 external eSata)
- 2 USB 2.0 ports (1 front and 1 back)
- Smart fan
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
config TARGET_NAS220
bool "BlackArmor NAS220"
+config TARGET_NSA310
+ bool "Zyxel NSA310 Board"
+
config TARGET_NSA310S
bool "Zyxel NSA310S"
@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig"
source "board/Seagate/dockstar/Kconfig"
source "board/Seagate/goflexhome/Kconfig"
source "board/Seagate/nas220/Kconfig"
+source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
endif
diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig
new file mode 100644
index 0000000..145ade6
--- /dev/null
+++ b/board/zyxel/nsa310/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_NSA310
+
+config SYS_BOARD
+ default "nsa310"
+
+config SYS_VENDOR
+ default "zyxel"
+
+config SYS_CONFIG_NAME
+ 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 @@
+NSA310 BOARD
+M: Alberto Bursi <alberto.bursi@outlook.it>
+S: Maintained
+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 @@
+#
+# (C) Copyright 2015 bodhi <mibodhi@gmail.com>
+#
+# Based on
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+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 @@
+#
+# Copyright (C) 2013 Rafal Kazmierowski
+#
+# Based on guruplug.c originally written by
+# Siddarth Gore <gores@marvell.com>
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM nand
+#BOOT_FROM uart
+NAND_ECC_MODE default
+NAND_PAGE_SIZE 0x0800
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Configure RGMII-0 interface pad voltage to 1.8V
+DATA 0xFFD100e0 0x1b1b1b9b
+
+#Dram initalization for SINGLE x16 CL=5 @ 400MHz
+DATA 0xFFD01400 0x43010c30 # DDR Configuration register
+# bit13-0: 0xc30 (3120 DDR2 clks refresh rate)
+# bit23-14: zero
+# bit24: 1= enable exit self refresh mode on DDR access
+# bit25: 1 required
+# bit29-26: zero
+# bit31-30: 01
+
+DATA 0xFFD01404 0x37543000 # DDR Controller Control Low
+# bit 4: 0=addr/cmd in smame cycle
+# bit 5: 0=clk is driven during self refresh, we don't care for APX
+# bit 6: 0=use recommended falling edge of clk for addr/cmd
+# bit14: 0=input buffer always powered up
+# bit18: 1=cpu lock transaction enabled
+# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0
+# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM
+# bit30-28: 3 required
+# bit31: 0=no additional STARTBURST delay
+
+DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1)
+# bit3-0: TRAS lsbs
+# bit7-4: TRCD
+# bit11- 8: TRP
+# bit15-12: TWR
+# bit19-16: TWTR
+# bit20: TRAS msb
+# bit23-21: 0x0
+# bit27-24: TRRD
+# bit31-28: TRTP
+
+DATA 0xFFD0140C 0x00000a33 # DDR Timing (High)
+# bit6-0: TRFC
+# bit8-7: TR2R
+# bit10-9: TR2W
+# bit12-11: TW2W
+# bit31-13: zero required
+
+DATA 0xFFD01410 0x0000000c # DDR Address Control
+# bit1-0: 01, Cs0width=x8
+# bit3-2: 10, Cs0size=1Gb
+# bit5-4: 01, Cs1width=x8
+# bit7-6: 10, Cs1size=1Gb
+# bit9-8: 00, Cs2width=nonexistent
+# bit11-10: 00, Cs2size =nonexistent
+# bit13-12: 00, Cs3width=nonexistent
+# bit15-14: 00, Cs3size =nonexistent
+# bit16: 0, Cs0AddrSel
+# bit17: 0, Cs1AddrSel
+# bit18: 0, Cs2AddrSel
+# bit19: 0, Cs3AddrSel
+# bit31-20: 0 required
+
+DATA 0xFFD01414 0x00000000 # DDR Open Pages Control
+# bit0: 0, OpenPage enabled
+# bit31-1: 0 required
+
+DATA 0xFFD01418 0x00000000 # DDR Operation
+# bit3-0: 0x0, DDR cmd
+# bit31-4: 0 required
+
+DATA 0xFFD0141C 0x00000652 # DDR Mode
+# bit2-0: 2, BurstLen=2 required
+# bit3: 0, BurstType=0 required
+# bit6-4: 4, CL=5
+# bit7: 0, TestMode=0 normal
+# bit8: 0, DLL reset=0 normal
+# bit11-9: 6, auto-precharge write recovery ????????????
+# bit12: 0, PD must be zero
+# bit31-13: 0 required
+
+DATA 0xFFD01420 0x00000004 # DDR Extended Mode
+# bit0: 0, DDR DLL enabled
+# bit1: 0, DDR drive strenght normal
+# bit2: 0, DDR ODT control lsd (disabled)
+# bit5-3: 000, required
+# bit6: 1, DDR ODT control msb, (disabled)
+# bit9-7: 000, required
+# bit10: 0, differential DQS enabled
+# bit11: 0, required
+# bit12: 0, DDR output buffer enabled
+# bit31-13: 0 required
+
+DATA 0xFFD01424 0x0000F17F # DDR Controller Control High
+# bit2-0: 111, required
+# bit3 : 1 , MBUS Burst Chop disabled
+# bit6-4: 111, required
+# bit7 : 0
+# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz
+# bit9 : 0 , no half clock cycle addition to dataout
+# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals
+# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh
+# bit15-12: 1111 required
+# bit31-16: 0 required
+
+DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values)
+DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values)
+
+
+DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size
+#DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0
+# bit0: 1, Window enabled
+# bit1: 0, Write Protect disabled
+# bit3-2: 00, CS0 hit selected
+# bit23-4: ones, required
+# bit31-24: 0x0F, Size (i.e. 256MB)
+
+DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb
+DATA 0xFFD0150C 0x00000000 # CS[2]n Size, window disabled KAZ z 400db
+DATA 0xFFD01514 0x00000000 # CS[3]n Size, window disabled
+
+DATA 0xFFD0151C 0x00000000 # DDR ODT Control (Low)
+DATA 0xFFD01494 0x00120012 # DDR ODT Control (High) KAZ z nowy STATIC_SDRAM_ODT_CTRL_LOW
+# bit1-0: 00, ODT0 controlled by ODT Control (low) register above
+# bit3-2: 01, ODT1 active NEVER!
+# bit31-4: zero, required
+
+DATA 0xFFD01498 0x00000000 # CPU ODT Control KAZ STATIC_SDRAM_ODT_CTRL_HI
+DATA 0xFFD0149C 0x0000E403 # DDR Initialization Control KAZ STATIC_SDRAM_DUNIT_ODT_CTRL
+DATA 0xFFD01480 0x00000001 # DDR Initialization Control
+#bit0=1, enable DDR init upon this register write
+
+# 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 @@
+/*
+ * Copyright (C) 2013 Rafal Kazmierowski
+ *
+ * Based on NSA320.c Peter Schildmann <linux@schildmann.info>
+ * originally written by
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/soc.h>
+#include <asm/arch/mpp.h>
+#include <asm/io.h>
+#include "nsa310.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+ /*
+ * default gpio configuration
+ * There are maximum 64 gpios controlled through 2 sets of registers
+ * the below configuration configures mainly initial LED status
+ */
+ mvebu_config_gpio(NSA310_VAL_LOW, NSA310_VAL_HIGH,
+ NSA310_OE_LOW, NSA310_OE_HIGH);
+
+ /* Multi-Purpose Pins Functionality configuration */
+ /* (all LEDs & power off active high) */
+ static const u32 kwmpp_config[] = {
+ MPP0_NF_IO2,
+ MPP1_NF_IO3,
+ MPP2_NF_IO4,
+ MPP3_NF_IO5,
+ MPP4_NF_IO6,
+ MPP5_NF_IO7,
+ MPP6_SYSRST_OUTn,
+ MPP7_GPO,
+ MPP8_TW_SDA, /* PCF8563 RTC chip */
+ MPP9_TW_SCK, /* connected to TWSI */
+ MPP10_UART0_TXD,
+ MPP11_UART0_RXD,
+ MPP12_GPO, /* SATA2 LED (green) */
+ MPP13_GPIO, /* SATA2 LED (red) */
+ MPP14_GPIO, /* MCU DATA pin (in) */
+ MPP15_GPIO, /* USB LED (green) */
+ MPP16_GPIO, /* MCU CLK pin (out) */
+ MPP17_GPIO, /* MCU ACT pin (out) */
+ MPP18_NF_IO0,
+ MPP19_NF_IO1,
+ MPP20_GPIO,
+ MPP21_GPIO, /* USB LED (red)-Power*/
+ MPP22_GPIO,
+ MPP23_GPIO,
+ MPP24_GPIO,
+ MPP25_GPIO,
+ MPP26_GPIO,
+ MPP27_GPIO,
+ MPP28_GPIO, /* SYS LED (green) */
+ MPP29_GPIO, /* SYS LED (red) */
+ MPP30_GPIO,
+ MPP31_GPIO,
+ MPP32_GPIO,
+ MPP33_GPIO,
+ MPP34_GPIO,
+ MPP35_GPIO,
+ MPP36_GPIO, /* Reset button */
+ MPP37_GPIO, /* Copy button */
+ MPP38_GPIO, /* VID B0 */
+ MPP39_GPIO, /* COPY LED (green) */
+ MPP40_GPIO, /* COPY LED (red) */
+ MPP41_GPIO, /* SATA1 LED (green) */
+ MPP42_GPIO, /* SATA1 LED (red) */
+ MPP43_GPIO, /* HTP pin */
+ MPP44_GPIO, /* Buzzer */
+ MPP45_GPIO, /* VID B1 */
+ MPP46_GPIO, /* Power button */
+ MPP47_GPIO, /* Power resume data */
+ MPP48_GPIO, /* Power off */
+ MPP49_GPIO, /* Power resume clock */
+ 0
+ };
+ kirkwood_mpp_conf(kwmpp_config,NULL);
+ return 0;
+}
+
+int board_init(void)
+{
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
+
+ return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and enable MV88E1318 PHY */
+void reset_phy(void)
+{
+ u16 reg;
+ u16 devadr;
+ char *name = "egiga0";
+
+ if (miiphy_set_current_dev(name))
+ return;
+
+ /* command to read PHY dev address */
+ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+ printf("Err..%s could not read PHY dev address\n",
+ __FUNCTION__);
+ return;
+ }
+
+ /* Set RGMII delay */
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 2);
+ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, &reg);
+ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL);
+ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg);
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0);
+
+ /* reset the phy */
+ miiphy_reset(name, devadr);
+
+ printf("MV88E1318 PHY initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
+
+#ifdef CONFIG_SHOW_BOOT_PROGRESS
+void show_boot_progress(int val)
+{
+ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE;
+ u32 dout0 = readl(&gpio0->dout);
+ u32 blen0 = readl(&gpio0->blink_en);
+
+ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE;
+ u32 dout1 = readl(&gpio1->dout);
+ u32 blen1 = readl(&gpio1->blink_en);
+
+ switch (val) {
+ case BOOTSTAGE_ID_DECOMP_IMAGE:
+ writel(blen0 & ~(SYS_GREEN_LED | SYS_RED_LED), &gpio0->blink_en);
+ writel((dout0 & ~SYS_GREEN_LED) | SYS_RED_LED, &gpio0->dout);
+ break;
+ case BOOTSTAGE_ID_RUN_OS:
+ writel(dout0 & ~SYS_RED_LED, &gpio0->dout);
+ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en);
+ break;
+ case BOOTSTAGE_ID_NET_START:
+ writel(dout1 & ~COPY_RED_LED, &gpio1->dout);
+ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en);
+ break;
+ case BOOTSTAGE_ID_NET_LOADED:
+ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en);
+ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout);
+ break;
+ case -BOOTSTAGE_ID_NET_NETLOOP_OK:
+ case -BOOTSTAGE_ID_NET_LOADED:
+ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout);
+ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en);
+ break;
+ default:
+ if (val < 0) {
+ /* error */
+ printf("Error occured, error code = %d\n", -val);
+ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout);
+ writel(blen0 | SYS_RED_LED, &gpio0->blink_en);
+ }
+ break;
+ }
+}
+#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 @@
+/*
+ * Copyright (C) 2013 Rafal Kazmierowski
+ *
+ * Based on Peter Schildmann <linux@schildmann.info>
+ * and guruplug.h originally written by
+ * Siddarth Gore <gores@marvell.com>
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __NSA310_H
+#define __NSA310_H
+
+/* 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 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 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_VAL_HIGH (0)
+
+/* PHY related */
+#define MV88E1318_MAC_CTRL_REG 21
+#define MV88E1318_PGADR_REG 22
+#define MV88E1318_RGMII_TXTM_CTRL (1 << 4)
+#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 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_TARGET_NSA310=y
+CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server"
+CONFIG_BOOTDELAY=3
+CONFIG_SYS_PROMPT="NSA310> "
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_SYS_NS16550=y
+CONFIG_CMD_FDT=y
+CONFIG_OF_LIBFDT=y
+CONFIG_CMD_SETEXPR=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DATE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_CMD_UBI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h
new file mode 100644
index 0000000..86ef825
--- /dev/null
+++ b/include/configs/nsa310.h
@@ -0,0 +1,126 @@
+/* Copyright (C) 2015-2016 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
+ * Copyright (C) 2012 Peter Schildmann <linux@schildmann.info>
+ *
+ * Based on guruplug.h originally written by
+ * Siddarth Gore <gores@marvell.com>
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_NSA310_H
+#define _CONFIG_NSA310_H
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
+#define CONFIG_KW88F6281 /* SOC Name */
+
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+
+/*
+ * Misc Configuration Options
+ */
+#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */
+
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+/*
+ * Environment variables configurations
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
+#endif
+
+/* max 4k env size is enough, but in case of nand
+ * it has to be rounded to sector size
+ */
+#define CONFIG_ENV_SIZE 0x20000 /* 128k */
+#define CONFIG_ENV_ADDR 0xc0000
+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_BOOTCOMMAND \
+ "ubi part ubi; " \
+ "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 \
+ "bootargs_root=\0"
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NETCONSOLE
+#define CONFIG_NET_MULTI
+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
+#define CONFIG_PHY_BASE_ADR 0x1
+#define CONFIG_RESET_PHY_R
+#endif /* CONFIG_CMD_NET */
+
+/*
+ * SATA Driver configuration
+ */
+#ifdef CONFIG_MVSATA_IDE
+#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
+#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
+#endif /* CONFIG_MVSATA_IDE */
+
+/*
+ * File system
+ */
+#define CONFIG_JFFS2_NAND
+#define CONFIG_JFFS2_LZO
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+
+/*
+ * Date Time
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MV
+#endif /* CONFIG_CMD_DATE */
+
+#endif /* _CONFIG_NSA310_H */

View File

@ -0,0 +1,683 @@
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
config TARGET_NSA310S
bool "Zyxel NSA310S"
+config TARGET_NSA325
+ bool "Zyxel NSA325 board"
+
endchoice
config SYS_SOC
@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig
source "board/Seagate/nas220/Kconfig"
source "board/zyxel/nsa310/Kconfig"
source "board/zyxel/nsa310s/Kconfig"
+source "board/zyxel/nsa325/Kconfig"
endif
diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig
new file mode 100644
index 0000000..1fe5ead
--- /dev/null
+++ b/board/zyxel/nsa325/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_NSA325
+
+config SYS_BOARD
+ default "nsa325"
+
+config SYS_VENDOR
+ default "zyxel"
+
+config SYS_CONFIG_NAME
+ 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 @@
+NSA325 BOARD
+M: Alberto Bursi <alberto.bursi@outlook.it>
+S: Maintained
+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 @@
+#
+# (C) Copyright 2015 bodhi <mibodhi@gmail.com>
+#
+# Based on
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+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 @@
+# Copyright (C) 2015 bodhi <mibodhi@gmail.com>
+#
+# Extracted from Zyxel GPL source for u-boot-1.1.4_NSA325v2
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+#BOOT_FROM uart
+BOOT_FROM nand
+NAND_ECC_MODE default
+NAND_PAGE_SIZE 0x0800
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Configure RGMII-0 interface pad voltage to 1.8V
+DATA 0xFFD100e0 0x1b1b1b9b
+
+#Dram initalization
+DATA 0xFFD01400 0x4301503E # DDR Configuration register
+DATA 0xFFD01404 0xB9843000 # DDR Controller Control Low
+DATA 0xFFD01408 0x33137777 # DDR Timing (Low)
+DATA 0xFFD0140C 0x16000C55 # DDR Timing (High)
+DATA 0xFFD01410 0x04000000 # DDR Address Control
+DATA 0xFFD01414 0x00000000 # DDR Open Pages Control
+DATA 0xFFD01418 0x00000000 # DDR Operation
+DATA 0xFFD0141C 0x00000672 # DDR Mode
+DATA 0xFFD01420 0x00000004 # DDR Extended Mode
+DATA 0xFFD01424 0x0000F14F # DDR Controller Control High
+DATA 0xFFD01428 0x000D6720 # DDR3 ODT Read Timing
+DATA 0xFFD0147C 0x0000B571 # DDR2 ODT Write Timing
+DATA 0xFFD01504 0x1FFFFFF1 # CS[0]n Size
+DATA 0xFFD01508 0x20000000 # CS[1]n Base address to 512Mb
+DATA 0xFFD0150C 0x1FFFFFF4 # CS[1]n Size 512Mb Window enabled for CS1
+DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled
+DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled
+DATA 0xFFD01494 0x00120000 # DDR ODT Control (Low)
+DATA 0xFFD01498 0x00000000 # DDR ODT Control (High)
+DATA 0xFFD0149C 0x0000E803 # CPU ODT Control
+
+DATA 0xFFD015D0 0x00000630
+DATA 0xFFD015D4 0x00000046
+DATA 0xFFD015D8 0x00000008
+DATA 0xFFD015DC 0x00000000
+DATA 0xFFD015E0 0x00000023
+DATA 0xFFD015E4 0x00203C18
+DATA 0xFFD01620 0x00384800
+DATA 0xFFD01480 0x00000001
+DATA 0xFFD20134 0x66666666
+DATA 0xFFD20138 0x00066666
+
+#Disable nsa325 hardware watchdog to allow successful kwbooting
+DATA 0xFFD10100 0x00004000 # set GPIO 14 to high to disable the watchdog
+DATA 0xFFD10104 0xFFFFBFFF # set GPIO 14 to output (to block any other input to it)
+
+# 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 @@
+/*
+ * Copyright (C) 2015 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
+ * Copyright (C) 2014 Jason Plum <jplum@archlinuxarm.org>
+ *
+ * Based on nsa320.c originall written by
+ * Copyright (C) 2012 Peter Schildmann <linux@schildmann.info>
+ *
+ * Based on guruplug.c originally written by
+ * Siddarth Gore <gores@marvell.com>
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <miiphy.h>
+#include <asm/arch/soc.h>
+#include <asm/arch/mpp.h>
+#include <asm/arch/cpu.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
+#include "nsa325.h"
+#include <asm/arch/gpio.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+ /*
+ * default gpio configuration
+ * There are maximum 64 gpios controlled through 2 sets of registers
+ * the below configuration configures mainly initial LED status
+ */
+ mvebu_config_gpio(NSA325_VAL_LOW, NSA325_VAL_HIGH,
+ NSA325_OE_LOW, NSA325_OE_HIGH);
+
+ /* Multi-Purpose Pins Functionality configuration */
+ /* (all LEDs & power off active high) */
+ u32 kwmpp_config[] = {
+ MPP0_NF_IO2,
+ MPP1_NF_IO3,
+ MPP2_NF_IO4,
+ MPP3_NF_IO5,
+ MPP4_NF_IO6,
+ MPP5_NF_IO7,
+ MPP6_SYSRST_OUTn,
+ MPP7_GPO,
+ MPP8_TW_SDA, /* PCF8563 RTC chip */
+ MPP9_TW_SCK, /* connected to TWSI */
+ MPP10_UART0_TXD,
+ MPP11_UART0_RXD,
+ MPP12_GPO, /* HDD2 LED (green) */
+ MPP13_GPIO, /* HDD2 LED (red) */
+ MPP14_GPIO, /* MCU DATA pin (in) */
+ MPP15_GPIO, /* USB LED (green) */
+ MPP16_GPIO, /* MCU CLK pin (out) */
+ MPP17_GPIO, /* MCU ACT pin (out) */
+ MPP18_NF_IO0,
+ MPP19_NF_IO1,
+ MPP20_GPIO,
+ MPP21_GPIO, /* USB power */
+ MPP22_GPIO,
+ MPP23_GPIO,
+ MPP24_GPIO,
+ MPP25_GPIO,
+ MPP26_GPIO,
+ MPP27_GPIO,
+ MPP28_GPIO, /* SYS LED (green) */
+ MPP29_GPIO, /* SYS LED (orange) */
+ MPP30_GPIO,
+ MPP31_GPIO,
+ MPP32_GPIO,
+ MPP33_GPIO,
+ MPP34_GPIO,
+ MPP35_GPIO,
+ MPP36_GPIO, /* reset button */
+ MPP37_GPIO, /* copy button */
+ MPP38_GPIO, /* VID B0 */
+ MPP39_GPIO, /* COPY LED (green) */
+ MPP40_GPIO, /* COPY LED (red) */
+ MPP41_GPIO, /* HDD1 LED (green) */
+ MPP42_GPIO, /* HDD1 LED (red) */
+ MPP43_GPIO, /* HTP pin */
+ MPP44_GPIO, /* buzzer */
+ MPP45_GPIO, /* VID B1 */
+ MPP46_GPIO, /* power button */
+ MPP47_GPIO, /* HDD2 power */
+ MPP48_GPIO, /* power off */
+ 0
+ };
+ kirkwood_mpp_conf(kwmpp_config, NULL);
+ return 0;
+}
+
+int board_init(void)
+{
+
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
+
+ /* This disables the hardware watchdog in the mcu on this board. */
+ kw_gpio_set_valid(14, 1);
+ kw_gpio_direction_output(14, 0);
+ kw_gpio_set_value(14, 1);
+
+ return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and enable MV88E1318 PHY */
+void reset_phy(void)
+{
+ u16 reg;
+ u16 devadr;
+ char *name = "egiga0";
+
+ if (miiphy_set_current_dev(name))
+ return;
+
+ /* command to read PHY dev address */
+ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+ printf("Err..%s could not read PHY dev address\n",
+ __FUNCTION__);
+ return;
+ }
+
+ /* Set RGMII delay */
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_MAC_CTRL_PG);
+ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, &reg);
+ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL);
+ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg);
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0);
+
+ /* reset the phy */
+ miiphy_reset(name, devadr);
+
+ /* The ZyXEL NSA325 uses the 88E1310S Alaska (interface identical to 88E1318) */
+ /* and has an MCU attached to the LED[2] via tristate interrupt */
+ reg = 0;
+
+ /* switch to LED register page */
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_LED_PG);
+ /* read out LED polarity register */
+ miiphy_read(name, devadr, MV88E1318_LED_POL_REG, &reg);
+ /* clear 4, set 5 - LED2 low, tri-state */
+ reg &= ~(MV88E1318_LED2_4);
+ reg |= (MV88E1318_LED2_5);
+ /* write back LED polarity register */
+ miiphy_write(name, devadr, MV88E1318_LED_POL_REG, reg);
+ /* jump back to page 0, per the PHY chip documenation. */
+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0);
+
+ /* Set the phy back to auto-negotiation mode. Onboard mcu sets it as 10Mbits/s on poweroff for WoL function */
+ miiphy_write(name, devadr, 0x4, 0x1e1);
+ miiphy_write(name, devadr, 0x9, 0x300);
+ /* Downshift */
+ miiphy_write(name, devadr, 0x10, 0x3860);
+ miiphy_write(name, devadr, 0x0, 0x9140);
+
+ printf("MV88E1318 PHY initialized on %s\n", name);
+
+}
+#endif /* CONFIG_RESET_PHY_R */
+
+#ifdef CONFIG_SHOW_BOOT_PROGRESS
+void show_boot_progress(int val)
+{
+ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE;
+ u32 dout0 = readl(&gpio0->dout);
+ u32 blen0 = readl(&gpio0->blink_en);
+
+ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE;
+ u32 dout1 = readl(&gpio1->dout);
+ u32 blen1 = readl(&gpio1->blink_en);
+
+ switch (val) {
+ case BOOTSTAGE_ID_DECOMP_IMAGE:
+ writel(blen0 & ~(SYS_GREEN_LED | SYS_ORANGE_LED), &gpio0->blink_en);
+ writel((dout0 & ~SYS_GREEN_LED) | SYS_ORANGE_LED, &gpio0->dout);
+ break;
+ case BOOTSTAGE_ID_RUN_OS:
+ writel(dout0 & ~SYS_ORANGE_LED, &gpio0->dout);
+ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en);
+ break;
+ case BOOTSTAGE_ID_NET_START:
+ writel(dout1 & ~COPY_RED_LED, &gpio1->dout);
+ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en);
+ break;
+ case BOOTSTAGE_ID_NET_LOADED:
+ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en);
+ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout);
+ break;
+ case -BOOTSTAGE_ID_NET_NETLOOP_OK:
+ case -BOOTSTAGE_ID_NET_LOADED:
+ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout);
+ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en);
+ break;
+ default:
+ if (val < 0) {
+ /* error */
+ printf("Error occured, error code = %d\n", -val);
+ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout);
+ writel(blen0 | SYS_ORANGE_LED, &gpio0->blink_en);
+ }
+ break;
+ }
+}
+#endif
+
+#if defined(CONFIG_KIRKWOOD_GPIO)
+/* Return GPIO button status */
+/*
+un-pressed:
+ gpio-36 (Reset Button ) in hi (act lo) - IRQ edge (clear )
+ gpio-37 (Copy Button ) in hi (act lo) - IRQ edge (clear )
+ gpio-46 (Power Button ) in lo (act hi) - IRQ edge (clear )
+pressed
+ gpio-36 (Reset Button ) in lo (act hi) - IRQ edge (clear )
+ gpio-37 (Copy Button ) in lo (act hi) - IRQ edge (clear )
+ gpio-46 (Power Button ) in hi (act lo) - IRQ edge (clear )
+*/
+
+static int
+do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ if (strcmp(argv[1], "power") == 0) {
+ kw_gpio_set_valid(BTN_POWER, GPIO_INPUT_OK);
+ kw_gpio_direction_input(BTN_POWER);
+ return !kw_gpio_get_value(BTN_POWER);
+ }
+ else if (strcmp(argv[1], "reset") == 0)
+ return kw_gpio_get_value(BTN_RESET);
+ else if (strcmp(argv[1], "copy") == 0)
+ return kw_gpio_get_value(BTN_COPY);
+ else
+ return -1;
+}
+
+
+U_BOOT_CMD(button, 2, 0, do_read_button,
+ "Return GPIO button status 0=off 1=on",
+ "- button power|reset|copy: test buttons states\n"
+);
+
+#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 @@
+/*
+ * Copyright (C) 2014 Jason Plum <jplum@archlinuxarm.org>
+ *
+ * Based on nsa320.h originall written by
+ * Copyright (C) 2012 Peter Schildmann <linux@schildmann.info>
+ *
+ * Based on guruplug.h originally written by
+ * Siddarth Gore <gores@marvell.com>
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __NSA325_H
+#define __NSA325_H
+
+/* low GPIO's */
+#define HDD2_GREEN_LED (1 << 12)
+#define HDD2_RED_LED (1 << 13)
+#define USB_GREEN_LED (1 << 15)
+#define USB_POWER (1 << 21)
+#define SYS_GREEN_LED (1 << 28)
+#define SYS_ORANGE_LED (1 << 29)
+
+#define PIN_USB_GREEN_LED 15
+#define PIN_USB_POWER 21
+
+#define NSA325_OE_LOW (~(HDD2_GREEN_LED | HDD2_RED_LED | \
+ USB_GREEN_LED | USB_POWER | \
+ SYS_GREEN_LED | SYS_ORANGE_LED))
+#define NSA325_VAL_LOW (SYS_GREEN_LED | USB_POWER)
+
+/* high GPIO's */
+#define COPY_GREEN_LED (1 << 7)
+#define COPY_RED_LED (1 << 8)
+#define HDD1_GREEN_LED (1 << 9)
+#define HDD1_RED_LED (1 << 10)
+#define HDD2_POWER (1 << 15)
+#define WATCHDOG_SIGNAL (1 << 14)
+
+#define NSA325_OE_HIGH (~(COPY_GREEN_LED | COPY_RED_LED | \
+ HDD1_GREEN_LED | HDD1_RED_LED | HDD2_POWER | WATCHDOG_SIGNAL ))
+#define NSA325_VAL_HIGH (WATCHDOG_SIGNAL | HDD2_POWER)
+
+/* PHY related */
+#define MV88E1318_PGADR_REG 22
+#define MV88E1318_MAC_CTRL_PG 2
+#define MV88E1318_MAC_CTRL_REG 21
+#define MV88E1318_RGMII_TXTM_CTRL (1 << 4)
+#define MV88E1318_RGMII_RXTM_CTRL (1 << 5)
+#define MV88E1318_LED_PG 3
+#define MV88E1318_LED_POL_REG 17
+#define MV88E1318_LED2_4 (1 << 4)
+#define MV88E1318_LED2_5 (1 << 5)
+
+#define BTN_POWER 46
+#define BTN_RESET 36
+#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 @@
+CONFIG_ARM=y
+CONFIG_KIRKWOOD=y
+CONFIG_TARGET_NSA325=y
+CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server"
+CONFIG_BOOTDELAY=3
+CONFIG_SYS_PROMPT="NSA325> "
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_SYS_NS16550=y
+CONFIG_CMD_FDT=y
+CONFIG_OF_LIBFDT=y
+CONFIG_CMD_SETEXPR=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DNS=y
+CONFIG_CMD_SNTP=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_CMD_DATE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_ENV=y
+CONFIG_CMD_NAND=y
+CONFIG_EFI_PARTITION=y
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_CMD_UBI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h
new file mode 100644
index 0000000..e5a8e2a
--- /dev/null
+++ b/include/configs/nsa325.h
@@ -0,0 +1,129 @@
+/*
+ * (C) Copyright 2016 bodhi <mibodhi@gmail.com>
+ *
+ * Based on
+ * Copyright (C) 2014 Jason Plum <jplum@archlinuxarm.org>
+ * Based on
+ * Copyright (C) 2012 Peter Schildmann <linux@schildmann.info>
+ *
+ * Based on guruplug.h originally written by
+ * Siddarth Gore <gores@marvell.com>
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_NSA325_H
+#define _CONFIG_NSA325_H
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */
+#define CONFIG_KW88F6281 1 /* SOC Name */
+
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+
+/*
+ * Misc Configuration Options
+ */
+#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */
+
+/*
+ * Commands configuration
+ */
+#define CONFIG_SYS_LONGHELP
+#define CONFIG_PREBOOT
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+/*
+ * Environment variables configurations
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */
+#endif
+/*
+ * max 4k env size is enough, but in case of nand
+ * it has to be rounded to sector size
+ */
+#define CONFIG_ENV_SIZE 0x20000 /* 128k */
+#define CONFIG_ENV_ADDR 0xc0000
+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_BOOTCOMMAND \
+ "ubi part ubi; " \
+ "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 \
+ "bootargs_root=\0"
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */
+#define CONFIG_PHY_BASE_ADR 0x1
+#define CONFIG_NETCONSOLE
+#endif /* CONFIG_CMD_NET */
+
+/*
+ * SATA Driver configuration
+ */
+#ifdef CONFIG_MVSATA_IDE
+#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET
+#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET
+#endif /* CONFIG_MVSATA_IDE */
+
+/*
+ * File system
+ */
+#define CONFIG_JFFS2_NAND
+#define CONFIG_JFFS2_LZO
+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+
+/*
+ * Date Time
+ */
+#ifdef CONFIG_CMD_DATE
+#define CONFIG_RTC_MV
+#endif /* CONFIG_CMD_DATE */
+
+#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */
+
+#endif /* _CONFIG_NSA325_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
--- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h
@@ -31,6 +31,7 @@
* Commands configuration
*/
#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
@@ -19,6 +19,7 @@
#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
#define CONFIG_CMD_ENV
#define CONFIG_CMD_NAND
/*
@@ -53,29 +54,29 @@
* mv-common.h should be defined after CMD configs since it used them
@@ -37,29 +38,29 @@
* it has to be rounded to sector size
*/
#define CONFIG_ENV_SIZE 0x20000 /* 128k */
@ -26,11 +26,12 @@
- "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:1m(uboot),-(root)\0"
+
+#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \
+ "0xe0000@0x0(uboot)," \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,336 +11,328 @@ PKG_NAME:=u-boot
PKG_VERSION:=2013.10
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55
PKG_TARGETS:=bin
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_BUILD_PARALLEL:=1
FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
SOC:=
define U-Boot/Default
BUILD_TARGET:=lantiq
DDR_SETTINGS:=
IMAGE:=
DEPS:=
endef
define uboot/arv4519pw_ram
TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
SOC:=danube
define U-Boot/arv4519pw_ram
NAME:=Arcadyan arv4519pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4519pw
DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv4519pw_nor
TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv4519pw_nor
NAME:=Arcadyan arv4519pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4519pw
endef
define uboot/arv4519pw_brn
TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv4519pw_brn
NAME:=Arcadyan arv4519pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4519pw
endef
define uboot/arv7506pw11_ram
TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM)
SOC:=danube
define U-Boot/arv7506pw11_ram
NAME:=Arcadyan ARV7506PW11 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7506pw11
DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7506pw11_nor
TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7506pw11_nor
NAME:=Arcadyan ARV7506PW11 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7506pw11
endef
define uboot/arv7506pw11_brn
TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7506pw11_brn
NAME:=Arcadyan ARV7506PW11 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7506pw11
endef
define uboot/arv7510pw_ram
TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
SOC:=danube
define U-Boot/arv7510pw_ram
NAME:=Arcadyan arv7510pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4510pw
DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw_nor
TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7510pw_nor
NAME:=Arcadyan arv7510pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4510pw
endef
define uboot/arv7510pw_brn
TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7510pw_brn
NAME:=Arcadyan arv7510pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv4510pw
endef
define uboot/arv7510pw22_ram
TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
SOC:=danube
define U-Boot/arv7510pw22_ram
NAME:=Arcadyan arv7510pw22 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7510pw22
DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7510pw22_nor
TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7510pw22_nor
NAME:=Arcadyan arv7510pw22 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7510pw22
endef
define uboot/arv7510pw22_brn
TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7510pw22_brn
NAME:=Arcadyan arv7510pw22 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7510pw22
endef
define uboot/arv7518pw_ram
TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
SOC:=danube
define U-Boot/arv7518pw_ram
NAME:=Arcadyan arv7518pw (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7518pw
DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv7518pw_nor
TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7518pw_nor
NAME:=Arcadyan arv7518pw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7518pw
endef
define uboot/arv7518pw_brn
TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv7518pw_brn
NAME:=Arcadyan arv7518pw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv7518pw
endef
define uboot/arv752dpw_ram
TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
SOC:=danube
define U-Boot/arv752dpw_ram
NAME:=Arcadyan arv752dpw (RAM)
BUILD_SUBTARGET:=xway
DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define uboot/arv752dpw_nor
TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv752dpw_nor
NAME:=Arcadyan arv752dpw (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define uboot/arv752dpw_brn
TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv752dpw_brn
NAME:=Arcadyan arv752dpw (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv752dpw
endef
define uboot/arv752dpw22_ram
TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
SOC:=danube
define U-Boot/arv752dpw22_ram
NAME:=Arcadyan arv752dpw22 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv752dpw22
DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv752dpw22_nor
TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv752dpw22_nor
NAME:=Arcadyan arv752dpw22 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv752dpw22
endef
define uboot/arv752dpw22_brn
TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv752dpw22_brn
NAME:=Arcadyan arv752dpw22 (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv752dpw22
endef
define uboot/arv8539pw22_ram
TITLE:=U-Boot for Speedport W 504V Typ A (RAM)
SOC:=danube
define U-Boot/arv8539pw22_ram
NAME:=Speedport W 504V Typ A (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv8539pw22
DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/arv8539pw22_nor
TITLE:=U-Boot for Speedport W 504V Typ A (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv8539pw22_nor
NAME:=Speedport W 504V Typ A (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv8539pw22
endef
define uboot/arv8539pw22_brn
TITLE:=U-Boot for Speedport W 504V Typ A (BRN)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/arv8539pw22_brn
NAME:=Speedport W 504V Typ A (BRN)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=arcadyan_arv8539pw22
endef
define uboot/gigasx76x_ram
TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
SOC:=danube
define U-Boot/gigasx76x_ram
NAME:=Siemens Gigaset sx76x (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=siemens_gigaset-sx76x
DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/gigasx76x_nor
TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/gigasx76x_nor
NAME:=Siemens Gigaset sx76x (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=siemens_gigaset-sx76x
endef
define uboot/acmp252_ram
TITLE:=U-Boot for AudioCodes MP-252 (RAM)
SOC:=danube
define U-Boot/acmp252_ram
NAME:=AudioCodes MP-252 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=audiocodes_mp-252
DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/acmp252_nor
TITLE:=U-Boot for AudioCodes MP-252 (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/acmp252_nor
NAME:=AudioCodes MP-252 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=audiocodes_mp-252
endef
define uboot/bthomehubv5a_ram
TITLE:=U-Boot for BT Home Hub 5A (RAM)
SOC:=vr9
define U-Boot/bthomehubv5a_ram
NAME:=BT Home Hub 5A (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=bt_homehub-v5a
DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/easy50712_ram
TITLE:=U-Boot for Lantiq EASY50712 (RAM)
SOC:=danube
define U-Boot/easy50712_ram
NAME:=Lantiq EASY50712 (RAM)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=lantiq_easy50712
DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef
define uboot/easy50712_nor
TITLE:=U-Boot for Lantiq EASY50712 (NOR)
SOC:=danube
DEPS:=@TARGET_lantiq_xway
define U-Boot/easy50712_nor
NAME:=Lantiq EASY50712 (NOR)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=lantiq_easy50712
endef
define uboot/easy50712_norspl
TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
SOC:=danube
IMAGE:=u-boot.ltq.lzo.norspl
DEPS:=@TARGET_lantiq_xway
define U-Boot/easy50712_norspl
NAME:=Lantiq EASY50712 (NOR SPL)
BUILD_SUBTARGET:=xway
BUILD_DEVICES:=lantiq_easy50712
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
DEPENDS+=@BROKEN
endef
define uboot/easy80920_ram
TITLE:=U-Boot for Lantiq EASY80920 (RAM)
SOC:=vr9
define U-Boot/easy80920_ram
NAME:=Lantiq EASY80920 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/easy80920_nor
TITLE:=U-Boot for Lantiq EASY80920 (NOR)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/easy80920_nor
NAME:=Lantiq EASY80920 (NOR)
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
BUILD_SUBTARGET:=xrx200
endef
define uboot/easy80920_norspl
TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.norspl
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/easy80920_norspl
NAME:=Lantiq EASY80920 (NOR SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl
DEPENDS+=@BROKEN
endef
define uboot/easy80920_sfspl
TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.sfspl
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/easy80920_sfspl
NAME:=Lantiq EASY80920 (SPI SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
DEPENDS+=@BROKEN
endef
define uboot/fb3370_eva
TITLE:=U-Boot for AVM FRITZ3370 (EVA)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/fb3370_eva
NAME:=AVM FRITZ3370 (EVA)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=avm_fritz3370
endef
define uboot/fb3370_ram
TITLE:=U-Boot for AVM FRITZ3370 (RAM)
SOC:=vr9
define U-Boot/fb3370_ram
NAME:=AVM FRITZ3370 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=avm_fritz3370
DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/fb3370_sfspl
TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.sfspl
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/fb3370_sfspl
NAME:=AVM FRITZ3370 (SPI SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=avm_fritz3370
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl
DEPENDS+=@BROKEN
endef
define uboot/p2812hnufx_ram
TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
SOC:=vr9
define U-Boot/p2812hnufx_ram
NAME:=ZyXEL P-2812HNU-Fx (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=zyxel_p-2812hnu-f1
DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/p2812hnufx_nandspl
TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
SOC:=vr9
IMAGE:=u-boot.ltq.lzo.nandspl
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/p2812hnufx_nandspl
NAME:=ZyXEL P-2812HNU-Fx (NAND SPL)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=zyxel_p-2812hnu-f1
UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl
DEPENDS+=@BROKEN
endef
define uboot/vgv7510kw22_brn
TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/vgv7510kw22_brn
NAME:=Arcadyan VGV7510KW22 (BRN)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
endef
define uboot/vgv7510kw22_nor
TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/vgv7510kw22_nor
NAME:=Arcadyan VGV7510KW22 (NOR)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
endef
define uboot/vgv7510kw22_ram
TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
SOC:=vr9
define U-Boot/vgv7510kw22_ram
NAME:=Arcadyan VGV7510KW22 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
define uboot/vgv7519_brn
TITLE:=U-Boot for Arcadyan VGV7519 (BRN)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/vgv7519_brn
NAME:=Arcadyan VGV7519 (BRN)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
endef
define uboot/vgv7519_nor
TITLE:=U-Boot for Arcadyan VGV7519 (NOR)
SOC:=vr9
DEPS:=@TARGET_lantiq_xrx200
define U-Boot/vgv7519_nor
NAME:=Arcadyan VGV7519 (NOR)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
endef
define uboot/vgv7519_ram
TITLE:=U-Boot for Arcadyan VGV7519 (RAM)
SOC:=vr9
define U-Boot/vgv7519_ram
NAME:=Arcadyan VGV7519 (RAM)
BUILD_SUBTARGET:=xrx200
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef
UBOOTS:= \
UBOOT_TARGETS:= \
arv4519pw_ram arv4519pw_nor arv4519pw_brn \
arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \
arv7510pw_ram arv7510pw_nor arv7510pw_brn \
@ -359,25 +351,6 @@ UBOOTS:= \
vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
vgv7519_brn vgv7519_nor vgv7519_ram
define Package/uboot/template
define Package/uboot-lantiq-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=$(3) @!IN_SDK
TITLE:=$(2)
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
MAINTAINER:=Luka Perkov <luka@openwrt.org>
endef
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
DEPS:=$(uboot/$(1)/DEPS)
$(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
endef
define CompressVR9Firmware
$(STAGING_DIR_HOST)/bin/lzma e \
$(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
@ -393,40 +366,25 @@ define Build/Prepare
$(call CompressVR9Firmware,22f,2)
endef
define Build/Configure
$(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
endef
UBOOT_MAKE_FLAGS :=
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
endef
ifeq ($(SUBTARGET),xway)
SOC:=danube
else
SOC:=vr9
endif
define Package/uboot/install/default
$(CP) \
$(PKG_BUILD_DIR)/$(2) \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
endef
define Package/uboot/install/uart
define Package/u-boot/install/uart
awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
-v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
-v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \
> $(PKG_BUILD_DIR)/ddr_settings
perl $(PKG_BUILD_DIR)/tools/gct.pl \
$(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
endef
define Package/uboot/install/template
define Package/uboot-lantiq-$(1)/install
$(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
$(if $(DDR_SETTINGS), \
$(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
)
endef
$(1)/u-boot.asc
endef
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call Package/uboot/install/template,$(u))) \
$(eval $(call BuildPackage,uboot-lantiq-$(u))) \
)
define Package/u-boot/install
$(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default))
endef
$(eval $(call BuildPackage/U-Boot))

View File

@ -1419,7 +1419,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+
+static int spl_uncompress_lzo(struct spl_image *spl, unsigned long loadaddr)
+{
+ size_t len;
+ size_t len = CONFIG_SYS_LOAD_SIZE;
+ int ret;
+
+ spl_puts("SPL: decompressing U-Boot with LZO\n");
@ -3237,7 +3237,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+}
--- /dev/null
+++ b/arch/mips/include/asm/arch-danube/config.h
@@ -0,0 +1,163 @@
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2007-2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -3296,6 +3296,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET 0x4000
+
+/* SRAM */
@ -3475,7 +3476,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#endif /* __DANUBE_SOC_H__ */
--- /dev/null
+++ b/arch/mips/include/asm/arch-vrx200/config.h
@@ -0,0 +1,187 @@
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -3546,6 +3547,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
+
+/* SRAM */
@ -7257,7 +7259,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+static struct phy_driver pef7071_driver = {
+ .name = "Lantiq XWAY PEF7071",
+ .uid = 0xd565a400,
+ .mask = 0xFFFFFFFF,
+ .mask = 0xFFFFFFF8,
+ .features = PHY_GBIT_FEATURES,
+ .config = ltq_phy_config,
+ .startup = ltq_phy_startup,

View File

@ -903,7 +903,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
#define STATUS_LANTIQ (STATUS_MIPS34K | STATUS_MIPS32_64)
--- /dev/null
+++ b/arch/mips/include/asm/arch-arx100/config.h
@@ -0,0 +1,175 @@
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2007-2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -967,6 +967,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
+
+/* SRAM */

View File

@ -21,7 +21,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
struct args {
enum image_types type;
__u32 entry_addr;
+ loff_t uboot_offset;
+ off_t uboot_offset;
+ unsigned int page_size;
const char *uboot_bin;
const char *spl_bin;
@ -121,10 +121,10 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
}
-static int create_sfspl(const struct args *arg)
+static int pad_to_offset(int fd, loff_t offset)
+static int pad_to_offset(int fd, off_t offset)
{
- int out_fd, uboot_fd, spl_fd, ret;
+ loff_t pos;
+ off_t pos;
+ size_t size;
+ ssize_t n;
+ __u8 *buf;

View File

@ -8,7 +8,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
--- /dev/null
+++ b/include/configs/openwrt-lantiq-common.h
@@ -0,0 +1,39 @@
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2013 Luka Perkov <luka@openwrt.org>
+ *
@ -21,6 +21,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+/* Commands */
+#if defined(CONFIG_LTQ_SUPPORT_ETHERNET)
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_TFTPPUT
+#endif
+
+/* Compression */

View File

@ -0,0 +1,18 @@
--- a/include/image.h
+++ b/include/image.h
@@ -17,7 +17,6 @@
#define __IMAGE_H__
#include "compiler.h"
-#include <asm/byteorder.h>
/* Define this to avoid #ifdefs later on */
struct lmb;
@@ -36,6 +35,7 @@ struct lmb;
#include <lmb.h>
#include <asm/u-boot.h>
+#include <asm/byteorder.h>
#include <command.h>
/* Take notice of the 'ignore' property for hashes */

View File

@ -1,98 +0,0 @@
#
# Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
PKG_NAME:=uboot-layerscape-32bit
PKG_VERSION:=v1.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7
PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
CONFIG:=
endef
define uboot/ls1043ardb
TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
CONFIG=ls1043ardb-uboot.bin
endef
define uboot/ls1046ardb
TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board
CONFIG=ls1046ardb-uboot.bin
endef
define uboot/ls1012ardb
TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board
CONFIG=ls1012ardb-uboot.bin.swap
endef
UBOOTS := \
ls1043ardb \
ls1046ardb \
ls1012ardb
define Package/uboot/template
define Package/uboot-layerscape-32b-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:= @TARGET_layerscape_32b
TITLE:=$(2)
URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
VARIANT:=$(1)
MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
endef
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef
ifdef BUILD_VARIANT
$(eval $(call uboot/$(BUILD_VARIANT)))
UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
endif
define Build/Configure
endef
define Build/Compile
endef
define Package/uboot/install/default
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
endef
define Package/uboot/install/template
define Package/uboot-layerscape-32b-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \
)

View File

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

View File

@ -6,100 +6,71 @@
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=uboot-layerscape
PKG_VERSION:=v1.0
PKG_SOURCE_DATE:=2017-08-24
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768
PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git
PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git
PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af
PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
CONFIG:=
IMAGE:=
define U-Boot/Default
BUILD_TARGET:=layerscape
BUILD_SUBTARGET:=armv8_64b
BUILD_DEVICES:=$(1)
UBOOT_IMAGE:=u-boot-dtb.bin
HIDDEN:=y
endef
define uboot/ls1043ardb
TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board
CONFIG=ls1043ardb
define U-Boot/ls1043ardb
NAME:=NXP ls1043ardb 64b Dev Board
endef
define uboot/ls1046ardb
TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board
CONFIG=ls1046ardb_qspi
define U-Boot/ls1046ardb
NAME:=NXP ls1046ardb 64b Dev Board
UBOOT_CONFIG:=ls1046ardb_qspi
endef
define uboot/ls1012ardb
TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board
CONFIG=ls1012ardb_qspi
IMAGE=u-boot-swap.bin
define U-Boot/ls1012ardb
NAME:=NXP ls1012ardb 64b Dev Board
UBOOT_CONFIG:=ls1012ardb_qspi
endef
UBOOTS := \
define U-Boot/ls1088ardb
NAME:=NXP ls1088ardb 64b Dev Board
UBOOT_CONFIG:=ls1088ardb_qspi
endef
define U-Boot/ls2088ardb
NAME:=NXP ls2088ardb 64b Dev Board
UBOOT_CONFIG:=ls2080ardb
endef
define U-Boot/ls1012afrdm
NAME:=NXP ls1012afrdm 64b Dev Board
UBOOT_CONFIG:=ls1012afrdm_qspi
endef
UBOOT_TARGETS := \
ls1043ardb \
ls1046ardb \
ls1012ardb
ls1012ardb \
ls1088ardb \
ls2088ardb \
ls1012afrdm
define Package/uboot/template
define Package/uboot-layerscape-64b-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:= @TARGET_layerscape_64b
TITLE:=$(2)
URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot
VARIANT:=$(1)
MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
define Package/u-boot/install/default
endef
ifdef BUILD_VARIANT
$(eval $(call uboot/$(BUILD_VARIANT)))
UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin)
endif
define Build/Configure
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(UBOOT_CONFIG)_config
endef
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc
endef
define Package/uboot/install/default
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin
endef
define Package/uboot/install/template
define Package/uboot-layerscape-64b-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,90 +8,33 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=u-boot
PKG_VERSION:=2016.03
PKG_VERSION:=2017.03
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=\
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb
PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_BUILD_PARALLEL:=1
PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
define uboot/Default
TITLE:=
UBOOT_MAKE_FLAGS:=
define U-Boot/Default
BUILD_TARGET:=mvebu
HIDDEN:=1
endef
define uboot/clearfog
TITLE:=U-Boot for SolidRun ClearFog A1
DEVICE:=armada-388-clearfog
define U-Boot/clearfog
NAME:=SolidRun ClearFog A1
BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro
UBOOT_IMAGE:=u-boot-spl.kwb
endef
UBOOTS:= \
UBOOT_TARGETS:= \
clearfog
define Package/uboot/template
define Package/uboot-mvebu-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3)||TARGET_mvebu_Default)
DEFAULT:=m
HIDDEN:=1
TITLE:=$(2)
URL:=http://www.denx.de/wiki/U-Boot
VARIANT:=$(1)
MAINTAINER:=Felix Fietkau <nbd@nbd.name>
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb
endef
define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE),$(DEVICE))
endef
define Build/Configure
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(BUILD_VARIANT)_config
endef
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE=$(TARGET_CROSS) \
DTC_DIR=$(LINUX_DIR)/scripts/dtc/
endef
define Package/uboot/install/default
$(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
$(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
$(INSTALL_DIR) $(KERNEL_BUILD_DIR)/
$(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
$(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
$(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
$(CP) $(PKG_BUILD_DIR)/tools/kwboot \
$(BIN_DIR)/u-boot-kwboot/
endef
define Package/uboot/install/template
define Package/uboot-mvebu-$(1)/install
$(call Package/uboot/install/default,$(2))
endef
endef
$(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-mvebu-$(u))) \
)
$(eval $(call BuildPackage/U-Boot))

View File

@ -0,0 +1,28 @@
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,7 +1,7 @@
From 15d52c4067b8d8a1d7a002aec41c5e6c0a8678cd Mon Sep 17 00:00:00 2001
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] clearfog: reset usom onboard 1512 phy
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.
@ -15,6 +15,8 @@ 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)
@ -30,3 +32,6 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
mdelay(10);
/* Init I2C IO expanders */
--
2.12.2

View File

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

@ -0,0 +1,24 @@
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,11 +0,0 @@
--- a/Makefile
+++ b/Makefile
@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
AWK = awk
PERL = perl
PYTHON = python
-DTC = dtc
+DTC = $(DTC_DIR)dtc
CHECK = sparse
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \

View File

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

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