update to R7.5.3 stable to fix firewall freeze

This commit is contained in:
coolsnowwolf 2018-01-10 20:55:06 +08:00
parent 6d210c00b6
commit b0f643aa87
532 changed files with 21439 additions and 17626 deletions

View File

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

View File

@ -13,7 +13,7 @@ __target_inc=1
DEVICE_TYPE?=router DEVICE_TYPE?=router
# Default packages - the really basic set # Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \
default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \ luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \

View File

@ -10,8 +10,8 @@ curdir:=package
include $(INCLUDE_DIR)/rootfs.mk include $(INCLUDE_DIR)/rootfs.mk
-include $(TMP_DIR)/.packagedeps -include $(TMP_DIR)/.packagedeps
$(curdir)/autoremove:=1
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m)) $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
$(curdir)/builddirs-install:=.
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m)) $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m)) $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
ifdef CHECK_ALL ifdef CHECK_ALL
@ -56,14 +56,10 @@ $(curdir)/merge:
$(curdir)/merge-index: $(curdir)/merge $(curdir)/merge-index: $(curdir)/merge
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
ifndef SDK $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
$(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 - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
mkdir -p $(TARGET_DIR)/tmp [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
$(call opkg,$(TARGET_DIR)) install \ $(call opkg,$(TARGET_DIR)) install \
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null)) $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
@for file in $(PACKAGE_INSTALL_FILES); do \ @for file in $(PACKAGE_INSTALL_FILES); do \

View File

@ -9,10 +9,9 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files PKG_NAME:=base-files
PKG_RELEASE:=181 PKG_RELEASE:=173.3
PKG_FLAGS:=nonshared PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
@ -20,14 +19,7 @@ PKG_BUILD_DEPENDS:=usign/host
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
# Extend depends from version.mk # Extend depends from version.mk
PKG_CONFIG_DEPENDS += \ PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE
CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \
CONFIG_NAND_SUPPORT \
CONFIG_CLEAN_IPKG \
CONFIG_PER_FEED_REPO \
CONFIG_PER_FEED_REPO_ADD_DISABLED \
CONFIG_PER_FEED_REPO_ADD_COMMENTED \
$(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed))
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -39,8 +31,8 @@ endif
define Package/base-files define Package/base-files
SECTION:=base SECTION:=base
CATEGORY:=Base system CATEGORY:=Base system
DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool
TITLE:=Base filesystem for OpenWrt TITLE:=Base filesystem for Lede
URL:=http://openwrt.org/ URL:=http://openwrt.org/
VERSION:=$(PKG_RELEASE)-$(REVISION) VERSION:=$(PKG_RELEASE)-$(REVISION)
endef endef
@ -115,16 +107,9 @@ ifdef CONFIG_SIGNED_PACKAGES
endef endef
endif endif
ifeq ($(CONFIG_NAND_SUPPORT),)
define Package/base-files/nand-support
rm -f $(1)/lib/upgrade/nand.sh
endef
endif
define Package/base-files/install define Package/base-files/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(Package/base-files/install-key) $(Package/base-files/install-key)
$(Package/base-files/nand-support)
if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
$(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
fi fi
@ -186,15 +171,6 @@ define Package/base-files/install
echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \ echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
fi \ fi \
done done
$(if $(CONFIG_INCLUDE_CONFIG), \
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \
$(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \
$(VERSION_SED) $(1)/etc/opkg/distfeeds.conf)
endef endef
ifneq ($(DUMP),1) ifneq ($(DUMP),1)

View File

@ -223,7 +223,7 @@ generate_static_system() {
uci -q batch <<-EOF uci -q batch <<-EOF
delete system.@system[0] delete system.@system[0]
add system system add system system
set system.@system[-1].hostname='OpenWrt' set system.@system[-1].hostname='LEDE'
set system.@system[-1].timezone='UTC' set system.@system[-1].timezone='UTC'
set system.@system[-1].ttylogin='0' set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='64' set system.@system[-1].log_size='64'
@ -233,10 +233,10 @@ generate_static_system() {
set system.ntp='timeserver' set system.ntp='timeserver'
set system.ntp.enabled='1' set system.ntp.enabled='1'
set system.ntp.enable_server='0' set system.ntp.enable_server='0'
add_list system.ntp.server='0.openwrt.pool.ntp.org' add_list system.ntp.server='0.lede.pool.ntp.org'
add_list system.ntp.server='1.openwrt.pool.ntp.org' add_list system.ntp.server='1.lede.pool.ntp.org'
add_list system.ntp.server='2.openwrt.pool.ntp.org' add_list system.ntp.server='2.lede.pool.ntp.org'
add_list system.ntp.server='3.openwrt.pool.ntp.org' add_list system.ntp.server='3.lede.pool.ntp.org'
EOF EOF
if json_is_a system object; then if json_is_a system object; then

View File

@ -1,7 +1,6 @@
root:x:0: root:x:0:
daemon:x:1: daemon:x:1:
adm:x:4: adm:x:4:
tty:x:5:
mail:x:8: mail:x:8:
audio:x:29: audio:x:29:
www-data:x:33: www-data:x:33:

View File

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

View File

@ -7,7 +7,7 @@ USE_PROCD=1
validate_system_section() validate_system_section()
{ {
uci_validate_section system system "${1}" \ uci_validate_section system system "${1}" \
'hostname:string:OpenWrt' \ 'hostname:string:lede' \
'conloglevel:uinteger' \ 'conloglevel:uinteger' \
'buffersize:uinteger' \ 'buffersize:uinteger' \
'timezone:string:UTC' \ 'timezone:string:UTC' \

View File

@ -1,7 +1,8 @@
DISTRIB_ID='%D' DISTRIB_ID='%D'
DISTRIB_RELEASE='%V' DISTRIB_RELEASE='%V'
DISTRIB_REVISION='%R' DISTRIB_REVISION='%R'
DISTRIB_CODENAME='%n'
DISTRIB_TARGET='%S' DISTRIB_TARGET='%S'
DISTRIB_ARCH='%A' DISTRIB_ARCH='%A'
DISTRIB_DESCRIPTION='%D %V %C' DISTRIB_DESCRIPTION='%D %N %V %C'
DISTRIB_TAINTS='%t' DISTRIB_TAINTS='%t'

View File

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

View File

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

View File

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

View File

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

View File

@ -160,7 +160,7 @@ _ucidef_finish_switch_roles() {
json_select .. json_select ..
json_select .. json_select ..
if [ ${need_tag:-0} -eq 1 -o ${want_untag:-0} -ne 1 ]; then if [ $n_vlan -gt $n_cpu -o ${need_tag:-0} -eq 1 ]; then
num="${num}t" num="${num}t"
device="${device}.${index}" device="${device}.${index}"
fi fi
@ -358,59 +358,19 @@ ucidef_add_vdsl_modem() {
json_select .. json_select ..
} }
ucidef_set_led_ataport() { ucidef_set_led_netdev() {
_ucidef_set_led_trigger "$1" "$2" "$3" ata"$4"
}
_ucidef_set_led_common() {
local cfg="led_$1" local cfg="led_$1"
local name="$2" local name="$2"
local sysfs="$3" local sysfs="$3"
local dev="$4"
local mode="${5:-link tx rx}"
json_select_object led json_select_object led
json_select_object "$1" json_select_object "$1"
json_add_string name "$name" json_add_string name "$name"
json_add_string sysfs "$sysfs"
}
ucidef_set_led_default() {
local default="$4"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string default "$default"
json_select ..
json_select ..
}
ucidef_set_led_gpio() {
local gpio="$4"
local inverted="$5"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger"
json_add_string type gpio
json_add_int gpio "$gpio"
json_add_boolean inverted "$inverted"
json_select ..
json_select ..
}
ucidef_set_led_ide() {
_ucidef_set_led_trigger "$1" "$2" "$3" ide-disk
}
ucidef_set_led_netdev() {
local dev="$4"
local mode="${5:-link tx rx}"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string type netdev json_add_string type netdev
json_add_string sysfs "$sysfs"
json_add_string device "$dev" json_add_string device "$dev"
json_add_string mode "$mode" json_add_string mode "$mode"
json_select .. json_select ..
@ -418,106 +378,24 @@ ucidef_set_led_netdev() {
json_select .. json_select ..
} }
ucidef_set_led_oneshot() {
_ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5
}
ucidef_set_led_portstate() {
local port_state="$4"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger port_state
json_add_string type portstate
json_add_string port_state "$port_state"
json_select ..
json_select ..
}
ucidef_set_led_rssi() {
local iface="$4"
local minq="$5"
local maxq="$6"
local offset="${7:-0}"
local factor="${8:-1}"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string type rssi
json_add_string name "$name"
json_add_string iface "$iface"
json_add_string minq "$minq"
json_add_string maxq "$maxq"
json_add_string offset "$offset"
json_add_string factor "$factor"
json_select ..
json_select ..
}
ucidef_set_led_switch() {
local trigger_name="$4"
local port_mask="$5"
local speed_mask="$6"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger_name"
json_add_string type switch
json_add_string port_mask "$port_mask"
json_add_string speed_mask "$speed_mask"
json_select ..
json_select ..
}
_ucidef_set_led_timer() {
local trigger_name="$4"
local delayon="$5"
local delayoff="$6"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger_name"
json_add_int delayon "$delayon"
json_add_int delayoff "$delayoff"
json_select ..
json_select ..
}
ucidef_set_led_timer() {
_ucidef_set_led_timer $1 $2 $3 "timer" $4 $5
}
_ucidef_set_led_trigger() {
local trigger_name="$4"
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string trigger "$trigger_name"
json_select ..
json_select ..
}
ucidef_set_led_usbdev() { ucidef_set_led_usbdev() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local dev="$4" local dev="$4"
_ucidef_set_led_common "$1" "$2" "$3" json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string type usb json_add_string type usb
json_add_string sysfs "$sysfs"
json_add_string device "$dev" json_add_string device "$dev"
json_select .. json_select ..
json_select .. json_select ..
} }
ucidef_set_led_usbhost() {
_ucidef_set_led_trigger "$1" "$2" "$3" usb-host
}
ucidef_set_led_usbport() { ucidef_set_led_usbport() {
local obj="$1" local obj="$1"
local name="$2" local name="$2"
@ -526,9 +404,12 @@ ucidef_set_led_usbport() {
shift shift
shift shift
_ucidef_set_led_common "$obj" "$name" "$sysfs" json_select_object led
json_select_object "$obj"
json_add_string name "$name"
json_add_string type usbport json_add_string type usbport
json_add_string sysfs "$sysfs"
json_select_array ports json_select_array ports
for port in "$@"; do for port in "$@"; do
json_add_string port "$port" json_add_string port "$port"
@ -540,7 +421,171 @@ ucidef_set_led_usbport() {
} }
ucidef_set_led_wlan() { ucidef_set_led_wlan() {
_ucidef_set_led_trigger "$1" "$2" "$3" "$4" local cfg="led_$1"
local name="$2"
local sysfs="$3"
local trigger="$4"
json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string type trigger
json_add_string sysfs "$sysfs"
json_add_string trigger "$trigger"
json_select ..
json_select ..
}
ucidef_set_led_switch() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local trigger="$4"
local port_mask="$5"
local speed_mask="$6"
json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string type switch
json_add_string sysfs "$sysfs"
json_add_string trigger "$trigger"
json_add_string port_mask "$port_mask"
json_add_string speed_mask "$speed_mask"
json_select ..
json_select ..
}
ucidef_set_led_portstate() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local port_state="$4"
json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string type portstate
json_add_string sysfs "$sysfs"
json_add_string trigger port_state
json_add_string port_state "$port_state"
json_select ..
json_select ..
}
ucidef_set_led_default() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local default="$4"
json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string sysfs "$sysfs"
json_add_string default "$default"
json_select ..
json_select ..
}
ucidef_set_led_gpio() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local gpio="$4"
local inverted="$5"
json_select_object led
json_select_object "$1"
json_add_string type gpio
json_add_string name "$name"
json_add_string sysfs "$sysfs"
json_add_string trigger "$trigger"
json_add_int gpio "$gpio"
json_add_boolean inverted "$inverted"
json_select ..
json_select ..
}
ucidef_set_led_ide() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
json_select_object led
json_select_object "$1"
json_add_string name "$name"
json_add_string sysfs "$sysfs"
json_add_string trigger ide-disk
json_select ..
json_select ..
}
__ucidef_set_led_timer() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local trigger="$4"
local delayon="$5"
local delayoff="$6"
json_select_object led
json_select_object "$1"
json_add_string type "$trigger"
json_add_string name "$name"
json_add_string sysfs "$sysfs"
json_add_int delayon "$delayon"
json_add_int delayoff "$delayoff"
json_select ..
json_select ..
}
ucidef_set_led_oneshot() {
__ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5
}
ucidef_set_led_timer() {
__ucidef_set_led_timer $1 $2 $3 "timer" $4 $5
}
ucidef_set_led_rssi() {
local cfg="led_$1"
local name="$2"
local sysfs="$3"
local iface="$4"
local minq="$5"
local maxq="$6"
local offset="$7"
local factor="$8"
json_select_object led
json_select_object "$1"
json_add_string type rssi
json_add_string name "$name"
json_add_string iface "$iface"
json_add_string sysfs "$sysfs"
json_add_string minq "$minq"
json_add_string maxq "$maxq"
json_add_string offset "$offset"
json_add_string factor "$factor"
json_select ..
json_select ..
} }
ucidef_set_rssimon() { ucidef_set_rssimon() {
@ -556,6 +601,7 @@ ucidef_set_rssimon() {
json_select .. json_select ..
json_select .. json_select ..
} }
ucidef_add_gpio_switch() { ucidef_add_gpio_switch() {

View File

@ -113,7 +113,7 @@ preinit_ip() {
preinit_config_board preinit_config_board
fi fi
preinit_net_echo "Doing OpenWrt Preinit\n" preinit_net_echo "Doing Lede Preinit\n"
} }
preinit_ip_deconfig() { preinit_ip_deconfig() {

View File

@ -5,12 +5,8 @@
run_failsafe_hook() { run_failsafe_hook() {
[ "$pi_preinit_no_failsafe" = "y" ] && return [ "$pi_preinit_no_failsafe" = "y" ] && return
if [ "$FAILSAFE" = "true" ]; then if [ "$FAILSAFE" = "true" ]; then
lock /tmp/.failsafe
boot_run_hook failsafe boot_run_hook failsafe
while [ ! -e /tmp/sysupgrade ]; do
lock -w /tmp/.failsafe lock -w /tmp/.failsafe
done
exit
fi fi
} }

View File

@ -8,13 +8,10 @@ failsafe_netlogin () {
} }
failsafe_shell() { failsafe_shell() {
local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')" lock /tmp/.failsafe
[ -n "$console" ] || console=console ash --login
[ -c "/dev/$console" ] || return 0 echo "Please reboot system when done with failsafe network logins"
while true; do while true; do sleep 1; done
ash --login <"/dev/$console" >"/dev/$console" 2>"/dev/$console"
sleep 1
done &
} }
boot_hook_add failsafe failsafe_netlogin boot_hook_add failsafe failsafe_netlogin

View File

@ -6,33 +6,143 @@ RAM_ROOT=/tmp/root
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; } libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
install_file() { # <file> [ <file> ... ] install_file() { # <file> [ <file> ... ]
local target dest dir
for file in "$@"; do for file in "$@"; do
if [ -L "$file" ]; then
target="$(readlink -f "$file")"
dest="$RAM_ROOT/$file" dest="$RAM_ROOT/$file"
[ ! -f "$dest" ] && { [ -f $file -a ! -f $dest ] && {
dir="$(dirname "$dest")" dir="$(dirname $dest)"
mkdir -p "$dir" mkdir -p "$dir"
ln -s "$target" "$dest" cp $file $dest
}
file="$target"
fi
dest="$RAM_ROOT/$file"
[ -f "$file" -a ! -f "$dest" ] && {
dir="$(dirname "$dest")"
mkdir -p "$dir"
cp "$file" "$dest"
} }
done done
} }
install_bin() { install_bin() { # <file> [ <symlink> ... ]
local src files
src=$1 src=$1
files=$1 files=$1
[ -x "$src" ] && files="$src $(libs $src)" [ -x "$src" ] && files="$src $(libs $src)"
install_file $files install_file $files
shift
for link in "$@"; do {
dest="$RAM_ROOT/$link"
dir="$(dirname $dest)"
mkdir -p "$dir"
[ -f "$dest" ] || ln -s $src $dest
}; done
}
supivot() { # <new_root> <old_root>
/bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
/bin/mount -o noatime,move /proc $1/proc && \
pivot_root $1 $1$2 || {
/bin/umount -l $1 $1
return 1
}
/bin/mount -o noatime,move $2/sys /sys
/bin/mount -o noatime,move $2/dev /dev
/bin/mount -o noatime,move $2/tmp /tmp
/bin/mount -o noatime,move $2/overlay /overlay 2>&-
return 0
}
run_ramfs() { # <command> [...]
install_bin /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
/sbin/pivot_root /sbin/reboot /bin/sync /bin/dd /bin/grep \
/bin/cp /bin/mv /bin/tar /usr/bin/md5sum "/usr/bin/[" /bin/dd \
/bin/vi /bin/ls /bin/cat /usr/bin/awk /usr/bin/hexdump \
/bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc \
/bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir \
/bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/find \
/bin/mknod
install_bin /bin/uclient-fetch /bin/wget
install_bin /sbin/mtd
install_bin /sbin/mount_root
install_bin /sbin/snapshot
install_bin /sbin/snapshot_tool
install_bin /usr/sbin/ubiupdatevol
install_bin /usr/sbin/ubiattach
install_bin /usr/sbin/ubiblock
install_bin /usr/sbin/ubiformat
install_bin /usr/sbin/ubidetach
install_bin /usr/sbin/ubirsvol
install_bin /usr/sbin/ubirmvol
install_bin /usr/sbin/ubimkvol
install_bin /usr/sbin/partx
install_bin /usr/sbin/losetup
install_bin /usr/sbin/mkfs.ext4
for file in $RAMFS_COPY_BIN; do
install_bin ${file//:/ }
done
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
supivot $RAM_ROOT /mnt || {
echo "Failed to switch over to ramfs. Please reboot."
exit 1
}
/bin/mount -o remount,ro /mnt
/bin/umount -l /mnt
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/bin/umount -l /overlay
}
# spawn a new shell from ramdisk to reduce the probability of cache issues
exec /bin/busybox ash -c "$*"
}
kill_remaining() { # [ <signal> ]
local sig="${1:-TERM}"
echo -n "Sending $sig to remaining processes ... "
local my_pid=$$
local my_ppid=$(cut -d' ' -f4 /proc/$my_pid/stat)
local my_ppisupgraded=
grep -q upgraded /proc/$my_ppid/cmdline >/dev/null && {
local my_ppisupgraded=1
}
local stat
for stat in /proc/[0-9]*/stat; do
[ -f "$stat" ] || continue
local pid name state ppid rest
read pid name state ppid rest < $stat
name="${name#(}"; name="${name%)}"
local cmdline
read cmdline < /proc/$pid/cmdline
# Skip kernel threads
[ -n "$cmdline" ] || continue
if [ $$ -eq 1 ] || [ $my_ppid -eq 1 ] && [ -n "$my_ppisupgraded" ]; then
# Running as init process, kill everything except me
if [ $pid -ne $$ ] && [ $pid -ne $my_ppid ]; then
echo -n "$name "
kill -$sig $pid 2>/dev/null
fi
else
case "$name" in
# Skip essential services
*procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*|*nas*|*relayd*) : ;;
# Killable process
*)
if [ $pid -ne $$ ] && [ $ppid -ne $$ ]; then
echo -n "$name "
kill -$sig $pid 2>/dev/null
fi
;;
esac
fi
done
echo ""
} }
run_hooks() { run_hooks() {
@ -65,31 +175,28 @@ v() {
[ "$VERBOSE" -ge 1 ] && echo "$@" [ "$VERBOSE" -ge 1 ] && echo "$@"
} }
json_string() {
local v="$1"
v="${v//\\/\\\\}"
v="${v//\"/\\\"}"
echo "\"$v\""
}
rootfs_type() { rootfs_type() {
/bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }' /bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }'
} }
get_image() { # <source> [ <command> ] get_image() { # <source> [ <command> ]
local from="$1" local from="$1"
local cat="$2" local conc="$2"
local cmd
if [ -z "$cat" ]; then case "$from" in
local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" http://*|ftp://*) cmd="wget -O- -q";;
*) cmd="cat";;
esac
if [ -z "$conc" ]; then
local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
case "$magic" in case "$magic" in
1f8b) cat="zcat";; 1f8b) conc="zcat";;
425a) cat="bzcat";; 425a) conc="bzcat";;
*) cat="cat";;
esac esac
fi fi
$cat "$from" 2>/dev/null eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}"
} }
get_magic_word() { get_magic_word() {
@ -221,14 +328,12 @@ default_do_upgrade() {
fi fi
} }
do_upgrade_stage2() { do_upgrade() {
v "Performing system upgrade..." v "Performing system upgrade..."
if [ -n "$do_upgrade" ]; then if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
eval "$do_upgrade" platform_do_upgrade "$ARGV"
elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
platform_do_upgrade "$IMAGE"
else else
default_do_upgrade "$IMAGE" default_do_upgrade "$ARGV"
fi fi
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
@ -236,11 +341,12 @@ do_upgrade_stage2() {
fi fi
v "Upgrade completed" v "Upgrade completed"
sleep 1 [ -n "$DELAY" ] && sleep "$DELAY"
ask_bool 1 "Reboot" && {
v "Rebooting system..." v "Rebooting system..."
umount -a umount -a
reboot -f reboot -f
sleep 5 sleep 5
echo b 2>/dev/null >/proc/sysrq-trigger echo b 2>/dev/null >/proc/sysrq-trigger
}
} }

View File

@ -1,150 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh
export IMAGE="$1"
COMMAND="$2"
export ARGV="$IMAGE"
export ARGC=1
export SAVE_CONFIG=1
export SAVE_PARTITIONS=1
export INTERACTIVE=0
export VERBOSE=1
export CONFFILES=/tmp/sysupgrade.conffiles
export CONF_TAR=/tmp/sysupgrade.tgz
RAMFS_COPY_BIN= # extra programs for temporary ramfs root
RAMFS_COPY_DATA= # extra data files
[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0
[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0
include /lib/upgrade
supivot() { # <new_root> <old_root>
/bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1
mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
/bin/mount -o noatime,move /proc $1/proc && \
pivot_root $1 $1$2 || {
/bin/umount -l $1 $1
return 1
}
/bin/mount -o noatime,move $2/sys /sys
/bin/mount -o noatime,move $2/dev /dev
/bin/mount -o noatime,move $2/tmp /tmp
/bin/mount -o noatime,move $2/overlay /overlay 2>&-
return 0
}
switch_to_ramfs() {
for binary in \
/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \
pivot_root mount_root reboot sync kill sleep \
md5sum hexdump cat zcat bzcat dd tar \
ls basename find cp mv rm mkdir rmdir mknod touch chmod \
'[' printf wc grep awk sed cut \
mtd partx losetup mkfs.ext4 \
ubiupdatevol ubiattach ubiblock ubiformat \
ubidetach ubirsvol ubirmvol ubimkvol \
snapshot snapshot_tool \
$RAMFS_COPY_BIN
do
local file="$(which "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
supivot $RAM_ROOT /mnt || {
echo "Failed to switch over to ramfs. Please reboot."
exit 1
}
/bin/mount -o remount,ro /mnt
/bin/umount -l /mnt
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/bin/umount -l /overlay
}
}
kill_remaining() { # [ <signal> [ <loop> ] ]
local loop_limit=10
local sig="${1:-TERM}"
local loop="${2:-0}"
local run=true
local stat
local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat)
echo -n "Sending $sig to remaining processes ... "
while $run; do
run=false
for stat in /proc/[0-9]*/stat; do
[ -f "$stat" ] || continue
local pid name state ppid rest
read pid name state ppid rest < $stat
name="${name#(}"; name="${name%)}"
# Skip PID1, our parent, ourself and our children
[ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue
local cmdline
read cmdline < /proc/$pid/cmdline
# Skip kernel threads
[ -n "$cmdline" ] || continue
echo -n "$name "
kill -$sig $pid 2>/dev/null
[ $loop -eq 1 ] && run=true
done
let loop_limit--
[ $loop_limit -eq 0 ] && {
echo
echo "Failed to kill all processes."
exit 1
}
done
echo
}
killall -9 telnetd
killall -9 dropbear
killall -9 ash
kill_remaining TERM
sleep 3
kill_remaining KILL 1
sleep 1
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
# Needs to be unset again because of busybox weirdness ...
IS_PRE_UPGRADE=
fi
if [ -n "$(rootfs_type)" ]; then
echo "Switching to ramdisk..."
switch_to_ramfs
fi
# Exec new shell from ramfs
exec /bin/busybox ash -c "$COMMAND"

View File

@ -1,15 +1,17 @@
#!/bin/sh #!/bin/sh
. /lib/functions.sh . /lib/functions.sh
. /lib/functions/system.sh . /lib/functions/system.sh
# initialize defaults # initialize defaults
RAMFS_COPY_BIN="" # extra programs for temporary ramfs root
RAMFS_COPY_DATA="" # extra data files
export MTD_CONFIG_ARGS="" export MTD_CONFIG_ARGS=""
export INTERACTIVE=0 export INTERACTIVE=0
export VERBOSE=1 export VERBOSE=1
export SAVE_CONFIG=1 export SAVE_CONFIG=1
export SAVE_OVERLAY=0 export SAVE_OVERLAY=0
export SAVE_PARTITIONS=1 export SAVE_PARTITIONS=1
export DELAY=
export CONF_IMAGE= export CONF_IMAGE=
export CONF_BACKUP_LIST=0 export CONF_BACKUP_LIST=0
export CONF_BACKUP= export CONF_BACKUP=
@ -23,6 +25,7 @@ export TEST=0
while [ -n "$1" ]; do while [ -n "$1" ]; do
case "$1" in case "$1" in
-i) export INTERACTIVE=1;; -i) export INTERACTIVE=1;;
-d) export DELAY="$2"; shift;;
-v) export VERBOSE="$(($VERBOSE + 1))";; -v) export VERBOSE="$(($VERBOSE + 1))";;
-q) export VERBOSE="$(($VERBOSE - 1))";; -q) export VERBOSE="$(($VERBOSE - 1))";;
-n) export SAVE_CONFIG=0;; -n) export SAVE_CONFIG=0;;
@ -47,9 +50,10 @@ done
export CONFFILES=/tmp/sysupgrade.conffiles export CONFFILES=/tmp/sysupgrade.conffiles
export CONF_TAR=/tmp/sysupgrade.tgz export CONF_TAR=/tmp/sysupgrade.tgz
IMAGE="$1" export ARGV="$*"
export ARGC="$#"
[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && { [ -z "$ARGV" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && {
cat <<EOF cat <<EOF
Usage: $0 [<upgrade-option>...] <image file or URL> Usage: $0 [<upgrade-option>...] <image file or URL>
$0 [-q] [-i] <backup-command> <file> $0 [-q] [-i] <backup-command> <file>
@ -86,7 +90,7 @@ EOF
exit 1 exit 1
} }
[ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && { [ -n "$ARGV" -a -n "$NEED_IMAGE" ] && {
cat <<-EOF cat <<-EOF
-b|--create-backup and -r|--restore-backup do not perform a firmware upgrade. -b|--create-backup and -r|--restore-backup do not perform a firmware upgrade.
Do not specify both -b|-r and a firmware image. Do not specify both -b|-r and a firmware image.
@ -108,8 +112,14 @@ add_uci_conffiles() {
add_overlayfiles() { add_overlayfiles() {
local file="$1" local file="$1"
find /overlay/upper/etc/ -type f -o -type l | sed \ if [ -d /overlay/upper ]; then
local overlaydir="/overlay/upper"
else
local overlaydir="/overlay"
fi
find $overlaydir/etc/ -type f -o -type l | sed \
-e 's,^/overlay\/upper/,/,' \ -e 's,^/overlay\/upper/,/,' \
-e 's,^/overlay/,/,' \
-e '\,/META_[a-zA-Z0-9]*$,d' \ -e '\,/META_[a-zA-Z0-9]*$,d' \
-e '\,/functions.sh$,d' \ -e '\,/functions.sh$,d' \
-e '\,/[^/]*-opkg$,d' \ -e '\,/[^/]*-opkg$,d' \
@ -120,26 +130,20 @@ add_overlayfiles() {
# hooks # hooks
sysupgrade_image_check="fwtool_check_image platform_check_image" sysupgrade_image_check="fwtool_check_image platform_check_image"
sysupgrade_pre_upgrade="fwtool_pre_upgrade" sysupgrade_pre_upgrade="fwtool_pre_upgrade"
[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \
if [ $SAVE_OVERLAY = 1 ]; then sysupgrade_init_conffiles="add_uci_conffiles" || \
[ ! -d /overlay/upper/etc ] && {
echo "Cannot find '/overlay/upper/etc', required for '-c'"
exit 1
}
sysupgrade_init_conffiles="add_overlayfiles" sysupgrade_init_conffiles="add_overlayfiles"
else
sysupgrade_init_conffiles="add_uci_conffiles"
fi
include /lib/upgrade include /lib/upgrade
[ "$1" = "nand" ] && nand_upgrade_stage2 $@
do_save_conffiles() { do_save_conffiles() {
local conf_tar="${1:-$CONF_TAR}" local conf_tar="${1:-$CONF_TAR}"
[ -z "$(rootfs_type)" ] && { [ -z "$(rootfs_type)" ] && {
echo "Cannot save config while running from ramdisk." echo "Cannot save config while running from ramdisk."
ask_bool 0 "Abort" && exit ask_bool 0 "Abort" && exit
rm -f "$conf_tar"
return 0 return 0
} }
run_hooks "$CONFFILES" $sysupgrade_init_conffiles run_hooks "$CONFFILES" $sysupgrade_init_conffiles
@ -153,7 +157,7 @@ do_save_conffiles() {
} }
if [ $CONF_BACKUP_LIST -eq 1 ]; then if [ $CONF_BACKUP_LIST -eq 1 ]; then
run_hooks "$CONFFILES" $sysupgrade_init_conffiles add_uci_conffiles "$CONFFILES"
cat "$CONFFILES" cat "$CONFFILES"
rm -f "$CONFFILES" rm -f "$CONFFILES"
exit 0 exit 0
@ -180,33 +184,8 @@ type platform_check_image >/dev/null 2>/dev/null || {
exit 1 exit 1
} }
case "$IMAGE" in
http://*)
wget -O/tmp/sysupgrade.img "$IMAGE"
IMAGE=/tmp/sysupgrade.img
;;
esac
IMAGE="$(readlink -f "$IMAGE")"
case "$IMAGE" in
'')
echo "Image file not found."
exit 1
;;
/tmp/*) ;;
*)
v "Image not in /tmp, copying..."
cp -f "$IMAGE" /tmp/sysupgrade.img
IMAGE=/tmp/sysupgrade.img
;;
esac
export ARGV="$IMAGE"
export ARGC=1
for check in $sysupgrade_image_check; do for check in $sysupgrade_image_check; do
( $check "$IMAGE" ) || { ( eval "$check \"\$ARGV\"" ) || {
if [ $FORCE -eq 1 ]; then if [ $FORCE -eq 1 ]; then
echo "Image check '$check' failed but --force given - will update anyway!" echo "Image check '$check' failed but --force given - will update anyway!"
break break
@ -232,7 +211,6 @@ elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
[ $TEST -eq 1 ] || do_save_conffiles [ $TEST -eq 1 ] || do_save_conffiles
export SAVE_CONFIG=1 export SAVE_CONFIG=1
else else
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"
export SAVE_CONFIG=0 export SAVE_CONFIG=0
fi fi
@ -240,26 +218,28 @@ if [ $TEST -eq 1 ]; then
exit 0 exit 0
fi fi
if [ $SAVE_PARTITIONS -eq 0 ]; then
touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
else
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
fi
run_hooks "" $sysupgrade_pre_upgrade run_hooks "" $sysupgrade_pre_upgrade
install_bin /sbin/upgraded # Some platforms/devices may want different sysupgrade process, e.g. without
v "Commencing upgrade. All shell sessions will be closed now." # killing processes yet or calling ubus system upgrade method.
# This is needed e.g. on NAND devices where we just want to trigger stage1 at
COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2' # this point.
if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
if [ -n "$FAILSAFE" ]; then platform_pre_upgrade "$ARGV"
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade fi
lock -u /tmp/.failsafe
else ubus call system upgrade
ubus call system sysupgrade "{ touch /tmp/sysupgrade
\"prefix\": $(json_string "$RAM_ROOT"),
\"path\": $(json_string "$IMAGE"), if [ ! -f /tmp/failsafe ] ; then
\"command\": $(json_string "$COMMAND") kill_remaining TERM
}" sleep 3
kill_remaining KILL
fi
if [ -n "$(rootfs_type)" ]; then
v "Switching to ramdisk..."
run_ramfs '. /lib/functions.sh; include /lib/upgrade; do_upgrade'
else
do_upgrade
fi fi

View File

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

View File

@ -158,11 +158,18 @@ if VERSIONOPT
config VERSION_DIST config VERSION_DIST
string string
prompt "Release distribution" prompt "Release distribution"
default "OpenWrt" default "LEDE"
help help
This is the name of the release distribution. This is the name of the release distribution.
If unspecified, it defaults to OpenWrt. If unspecified, it defaults to OpenWrt.
config VERSION_NICK
string
prompt "Release version nickname"
help
This is the release codename embedded in the image.
If unspecified, it defaults to the name of source branch.
config VERSION_NUMBER config VERSION_NUMBER
string string
prompt "Release version number" prompt "Release version number"
@ -183,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO config VERSION_REPO
string string
prompt "Release repository" prompt "Release repository"
default "http://downloads.lede-project.org/snapshots" default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT"
help help
This is the repository address embedded in the image, it defaults This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders: to the trunk snapshot repo; the url may contain the following placeholders:
@ -192,13 +199,15 @@ if VERSIONOPT
%v .. Configured release version number or "snapshot", lowercase %v .. Configured release version number or "snapshot", lowercase
%C .. Configured release revision code or value of %R, uppercase %C .. Configured release revision code or value of %R, uppercase
%c .. Configured release revision code or value of %R, lowercase %c .. Configured release revision code or value of %R, lowercase
%D .. Distribution name or "OpenWrt", uppercase %N .. Release name, uppercase
%d .. Distribution name or "openwrt", lowercase %n .. Release name, lowercase
%D .. Distribution name or "Lede", uppercase
%d .. Distribution name or "lede", lowercase
%T .. Target name %T .. Target name
%S .. Target/Subtarget name %S .. Target/Subtarget name
%A .. Package architecture %A .. Package architecture
%t .. Build taint flags, e.g. "no-all busybox" %t .. Build taint flags, e.g. "no-all busybox"
%M .. Manufacturer name or "OpenWrt" %M .. Manufacturer name or "Lede"
%P .. Product name or "Generic" %P .. Product name or "Generic"
%h .. Hardware revision or "v0" %h .. Hardware revision or "v0"

View File

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

View File

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

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

View File

@ -1,88 +0,0 @@
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,7 +9,6 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=grub PKG_NAME:=grub
PKG_CPE_ID:=cpe:/a:gnu:grub2
PKG_VERSION:=2.02 PKG_VERSION:=2.02
PKG_RELEASE:=1 PKG_RELEASE:=1

View File

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

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=kexec-tools PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.14 PKG_VERSION:=2.0.14-rc1
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6 PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b
PKG_FIXUP:=autoreconf PKG_FIXUP:=autoreconf
@ -21,49 +21,22 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/kexec-tools/Default define Package/kexec-tools
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities 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/ URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
MAINTAINER:=Florian Fainelli <florian@openwrt.org> MAINTAINER:=Florian Fainelli <florian@openwrt.org>
endef MENU:=1
define Package/kexec-tools
$(call Package/kexec-tools/Default)
TITLE:=kexec-tools transition meta package
DEPENDS:=+kexec
endef endef
define Package/kexec-tools/description define Package/kexec-tools/description
kexec is a set of system calls that allows you to load kexec is a set of systems call that allows you to load
another kernel from the currently executing Linux kernel. another kernel from the currently executing Linux kernel.
The kexec utility allows to load and boot another kernel.
endef endef
define Package/kexec define Package/kexec-tools/config
$(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" source "$(SOURCE)/Config.in"
endef endef
@ -92,45 +65,24 @@ CONFIGURE_VARS += \
BUILD_CC="$(HOSTCC)" \ BUILD_CC="$(HOSTCC)" \
TARGET_CC="$(TARGET_CC)" TARGET_CC="$(TARGET_CC)"
kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
define Build/Compile define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
endef endef
define Package/kexec-tools/install define Package/kexec-tools/install
:
endef
define Package/kexec/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(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
# make a link for compatability with other distros # make a link for compatability with other distros
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/sbin
$(LN) ../usr/sbin/kexec $(1)/sbin/kexec $(LN) ../usr/sbin/kexec $(1)/sbin/kexec
endef 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-tools))
$(eval $(call BuildPackage,kexec))
$(eval $(call BuildPackage,kdump))

View File

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

@ -1,11 +0,0 @@
#!/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

@ -1,182 +0,0 @@
#!/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,14 +10,13 @@
#include <errno.h> #include <errno.h>
--- a/src/mtd.h --- a/src/mtd.h
+++ b/src/mtd.h +++ b/src/mtd.h
@@ -25,8 +25,11 @@ @@ -25,8 +25,10 @@
#ifndef MTD_H #ifndef MTD_H
#define MTD_H #define MTD_H
+#define _GNU_SOURCE +#define _GNU_SOURCE
#include <mtd/mtd-user.h> #include <mtd/mtd-user.h>
#include <endian.h> #include <endian.h>
+#include <stdint.h>
+#include <fcntl.h> +#include <fcntl.h>
#include "BootControlBlocks.h" #include "BootControlBlocks.h"

View File

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

View File

@ -2,7 +2,6 @@
* RouterBOOT configuration utility * RouterBOOT configuration utility
* *
* Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org> * 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 * 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 * under the terms of the GNU General Public License version 2 as published
@ -30,7 +29,6 @@
#define RB_ERR_INVALID 2 #define RB_ERR_INVALID 2
#define RB_ERR_NOMEM 3 #define RB_ERR_NOMEM 3
#define RB_ERR_IO 4 #define RB_ERR_IO 4
#define RB_ERR_NOTWANTED 5
#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) #define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
@ -69,11 +67,6 @@ struct rbcfg_command {
int (*exec)(int argc, const char *argv[]); int (*exec)(int argc, const char *argv[]);
}; };
struct rbcfg_soc {
const char *needle;
const int type;
};
static void usage(void); static void usage(void);
/* Globals */ /* Globals */
@ -108,10 +101,6 @@ static const struct rbcfg_value rbcfg_boot_device[] = {
RB_BOOT_DEVICE_ETHONCE), RB_BOOT_DEVICE_ETHONCE),
CFG_U32("nand", "boot from NAND only", CFG_U32("nand", "boot from NAND only",
RB_BOOT_DEVICE_NANDONLY), 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[] = { static const struct rbcfg_value rbcfg_boot_key[] = {
@ -142,32 +131,12 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = {
RB_CPU_MODE_REGULAR), 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[] = { static const struct rbcfg_value rbcfg_booter[] = {
CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR),
CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP),
}; };
static struct rbcfg_env rbcfg_envs[] = { static const struct rbcfg_env rbcfg_envs[] = {
{ {
.name = "boot_delay", .name = "boot_delay",
.id = RB_ID_BOOT_DELAY, .id = RB_ID_BOOT_DELAY,
@ -204,12 +173,6 @@ static struct rbcfg_env rbcfg_envs[] = {
.type = RBCFG_ENV_TYPE_U32, .type = RBCFG_ENV_TYPE_U32,
.values = rbcfg_cpu_mode, .values = rbcfg_cpu_mode,
.num_values = ARRAY_SIZE(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", .name = "uart_speed",
.id = RB_ID_UART_SPEED, .id = RB_ID_UART_SPEED,
@ -273,10 +236,8 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
buf += 2; buf += 2;
buflen -= 2; buflen -= 2;
if (id == RB_ID_TERMINATOR) { if (id == RB_ID_TERMINATOR)
ret = RB_ERR_NOTWANTED;
break; break;
}
if (buflen < len) if (buflen < len)
break; break;
@ -292,7 +253,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
buflen -= len; buflen -= len;
} }
if (RB_ERR_NOTFOUND == ret) if (ret)
fprintf(stderr, "no tag found with id=%u\n", tag_id); fprintf(stderr, "no tag found with id=%u\n", tag_id);
return ret; return ret;
@ -783,96 +744,6 @@ usage(void)
fprintf(stderr, "\n"); 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[]) int main(int argc, const char *argv[])
{ {
const struct rbcfg_command *cmd = NULL; const struct rbcfg_command *cmd = NULL;
@ -881,8 +752,6 @@ int main(int argc, const char *argv[])
rbcfg_name = (char *) argv[0]; rbcfg_name = (char *) argv[0];
fixup_rbcfg_envs();
if (argc < 2) { if (argc < 2) {
usage(); usage();
return EXIT_FAILURE; return EXIT_FAILURE;

View File

@ -32,7 +32,6 @@
#define RB_ID_BOOT_PROTOCOL 9 #define RB_ID_BOOT_PROTOCOL 9
#define RB_ID_SOFT_10 10 #define RB_ID_SOFT_10 10
#define RB_ID_SOFT_11 11 #define RB_ID_SOFT_11 11
#define RB_ID_CPU_FREQ 12
#define RB_ID_BOOTER 13 #define RB_ID_BOOTER 13
#define RB_UART_SPEED_115200 0 #define RB_UART_SPEED_115200 0
@ -60,8 +59,6 @@
#define RB_BOOT_DEVICE_CFCARD 2 #define RB_BOOT_DEVICE_CFCARD 2
#define RB_BOOT_DEVICE_ETHONCE 3 #define RB_BOOT_DEVICE_ETHONCE 3
#define RB_BOOT_DEVICE_NANDONLY 5 #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_ANY 0
#define RB_BOOT_KEY_DEL 1 #define RB_BOOT_KEY_DEL 1
@ -72,13 +69,6 @@
#define RB_BOOT_PROTOCOL_BOOTP 0 #define RB_BOOT_PROTOCOL_BOOTP 0
#define RB_BOOT_PROTOCOL_DHCP 1 #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_REGULAR 0
#define RB_BOOTER_BACKUP 1 #define RB_BOOTER_BACKUP 1

View File

@ -6,28 +6,90 @@
# #
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=u-boot
PKG_VERSION:=2010.03 PKG_VERSION:=2010.03
PKG_RELEASE:=1 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_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 include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=ar71xx TITLE:=
BUILD_SUBTARGET:=generic CONFIG:=
IMAGE:=
endef endef
define U-Boot/nbg460n_550n_550nh define uboot/nbg460n_550n_550nh
TITLE:=NBG460N/550N/550NH routers TITLE:=U-boot for the NBG460N/550N/550NH routers
BUILD_DEVICES:=NBG_460N_550N_550NH DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default)
HIDDEN:=y
endef endef
UBOOT_MAKE_FLAGS := UBOOTS:=nbg460n_550n_550nh
UBOOT_TARGETS:=nbg460n_550n_550nh 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
$(eval $(call BuildPackage/U-Boot)) 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))) \
)

View File

@ -7,83 +7,68 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2016.05 PKG_VERSION:=2016.05
PKG_RELEASE:=1 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_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171
include $(INCLUDE_DIR)/u-boot.mk PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=at91 TITLE:=
UBOOT_IMAGE:=u-boot.bin boot.bin
endef endef
define U-Boot/at91sam9m10g45ek_nandflash define uboot/at91sam9m10g45ek_nandflash
NAME:=AT91SAM9M10G45-EK board (NandFlash) TITLE:=U-Boot for the AT91SAM9M10G45-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9m10g45ek
endef endef
define U-Boot/at91sam9x5ek_nandflash define uboot/at91sam9x5ek_nandflash
NAME:=AT91SAM9X5-EK board (NandFlash) TITLE:=U-Boot for the AT91SAM9X5-EK board (NandFlash)
BUILD_SUBTARGET:=legacy
BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek
endef endef
define U-Boot/sama5d3_xplained_nandflash UBOOTS := \
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 \ at91sam9m10g45ek_nandflash \
at91sam9x5ek_nandflash \ at91sam9x5ek_nandflash
sama5d3_xplained_nandflash \
sama5d3_xplained_mmc \ define Package/uboot/template
sama5d2_xplained_mmc \ define Package/uboot-at91-$(1)
sama5d2_xplained_spiflash \ SECTION:=boot
sama5d4_xplained_mmc \ CATEGORY:=Boot Loaders
sama5d4_xplained_spiflash \ DEPENDS:=@TARGET_at91
sama5d4_xplained_nandflash 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
define Build/Compile define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
@ -91,4 +76,27 @@ define Build/Compile
KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))" KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
endef endef
$(eval $(call BuildPackage/U-Boot)) 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))) \
)

View File

@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\
ftp://ftp.denx.de/pub/u-boot ftp://ftp.denx.de/pub/u-boot
PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955
PKG_BUILD_DEPENDS:=fstools PKG_BUILD_DEPENDS:=+fstools
PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE:=GPL-2.0 GPL-2.0+
PKG_LICENSE_FILES:=Licenses/README PKG_LICENSE_FILES:=Licenses/README
@ -112,10 +112,6 @@ ifneq ($(CONFIG_TARGET_oxnas),)
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
endif 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),) ifneq ($(CONFIG_TARGET_ramips),)
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools

View File

@ -7,10 +7,11 @@
touch /etc/config/ubootenv touch /etc/config/ubootenv
. /lib/ar71xx.sh
. /lib/uboot-envtools.sh . /lib/uboot-envtools.sh
. /lib/functions.sh . /lib/functions.sh
board=$(board_name) board=$(ar71xx_board_name)
case "$board" in case "$board" in
a40|\ a40|\
@ -19,7 +20,6 @@ alfa-ap120c|\
all0258n|\ all0258n|\
ap121f|\ ap121f|\
ap90q|\ ap90q|\
arduino-yun|\
cap324|\ cap324|\
cap4200ag|\ cap4200ag|\
carambola2|\ carambola2|\
@ -28,7 +28,6 @@ cpe870|\
cr3000|\ cr3000|\
cr5000|\ cr5000|\
eap300v2|\ eap300v2|\
ens202ext|\
gl-ar300m|\ gl-ar300m|\
hornet-ub|\ hornet-ub|\
hornet-ub-x2|\ hornet-ub-x2|\
@ -66,20 +65,12 @@ dap-2695-a1|\
wzr-hp-ag300h) wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
;; ;;
dr342|\
dr531) dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" 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) qihoo-c301)
ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
;; ;;
wi2a-ac200i)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000"
;;
esac esac
config_load ubootenv config_load ubootenv

View File

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

View File

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

View File

@ -7,33 +7,13 @@
touch /etc/config/ubootenv touch /etc/config/ubootenv
. /lib/ipq806x.sh
. /lib/uboot-envtools.sh . /lib/uboot-envtools.sh
. /lib/functions.sh . /lib/functions.sh
board=$(board_name) board=$(ipq806x_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 case "$board" in
ap148 | db149)
ubootenv_add_uci_config $(ubootenv_mtdinfo)
;;
ea8500) ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
;; ;;

View File

@ -7,18 +7,17 @@
touch /etc/config/ubootenv touch /etc/config/ubootenv
. /lib/kirkwood.sh
. /lib/uboot-envtools.sh . /lib/uboot-envtools.sh
. /lib/functions.sh . /lib/functions.sh
board=$(board_name) board=$(kirkwood_board_name)
case "$board" in case "$board" in
dockstar|\ dockstar|\
guruplug-server-plus|\ guruplug-server-plus|\
ib62x0|\ ib62x0|\
linksys-viper|\ linksys-viper|\
nsa310b|\
nsa325|\
pogo_e02|\ pogo_e02|\
sheevaplug|\ sheevaplug|\
sheevaplug-esata) sheevaplug-esata)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

@ -1,41 +0,0 @@
#!/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

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

@ -1,32 +0,0 @@
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,63 +7,68 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2014.04 PKG_VERSION:=2014.04
PKG_RELEASE:=1 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_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31
include $(INCLUDE_DIR)/u-boot.mk PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=imx6 TITLE:=
UBOOT_IMAGE:=u-boot.imx CONFIG:=
IMAGE:=
endef endef
define U-Boot/mx6qsabresd define uboot/mx6qsabresd
NAME:=SABRE i.MX6Quad board TITLE:=U-Boot for SABRE i.MX6Quad board
endef endef
define U-Boot/nitrogen6dl define uboot/nitrogen6dl
NAME:=Nitrogen6x i.MX6Dual-Lite 1GB board TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
endef endef
define U-Boot/nitrogen6dl2g define uboot/nitrogen6dl2g
NAME:=Nitrogen6x i.MX6Dual-Lite 2GB board TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
endef endef
define U-Boot/nitrogen6q define uboot/nitrogen6q
NAME:=Nitrogen6x/SABRE Lite (MX6Q/1GB) TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
endef endef
define U-Boot/nitrogen6q2g define uboot/nitrogen6q2g
NAME:=Nitrogen6x i.MX6Quad 2GB board TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
endef endef
define U-Boot/nitrogen6s define uboot/nitrogen6s
NAME:=Nitrogen6x i.MX6Solo 512MB board TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
endef endef
define U-Boot/nitrogen6s1g define uboot/nitrogen6s1g
NAME:=Nitrogen6x i.MX6Solo 1GB board TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
endef endef
define U-Boot/wandboard_dl define uboot/wandboard_dl
NAME:=Wandboard Dual Lite TITLE:=U-Boot for the Wandboard Dual Lite
BUILD_DEVICES:=wandboard
endef endef
define U-Boot/wandboard_quad define uboot/wandboard_quad
NAME:=Wandboard Quad TITLE:=U-Boot for the Wandboard Quad
BUILD_DEVICES:=wandboard
endef endef
define U-Boot/wandboard_solo define uboot/wandboard_solo
NAME:=Wandboard Solo TITLE:=U-Boot for the Wandboard Solo
BUILD_DEVICES:=wandboard
endef endef
UBOOT_TARGETS := \ UBOOTS := \
mx6qsabresd \ mx6qsabresd \
nitrogen6dl \ nitrogen6dl \
nitrogen6dl2g \ nitrogen6dl2g \
@ -75,4 +80,58 @@ UBOOT_TARGETS := \
wandboard_quad \ wandboard_quad \
wandboard_solo wandboard_solo
$(eval $(call BuildPackage/U-Boot)) 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))) \
)

View File

@ -7,77 +7,94 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_VERSION:=2017.09 PKG_NAME:=u-boot
PKG_VERSION:=2016.09.01
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 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
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=kirkwood TITLE:=
BUILD_DEVICES:=$(patsubst %_second_stage,%,$(1))
endef endef
define U-Boot/dockstar define uboot/dockstar
NAME:=Seagate DockStar TITLE:=U-Boot for Seagate DockStar
endef endef
define U-Boot/dockstar_second_stage define uboot/dockstar_second_stage
NAME:=Seagate DockStar (second stage) TITLE:=second stage U-Boot for Seagate DockStar
endef endef
define U-Boot/goflexhome define uboot/goflexhome
NAME:=the Seagate GoFlexHome/GoFlexNet TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet
endef endef
define U-Boot/ib62x0 define uboot/ib62x0
NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
endef endef
define U-Boot/ib62x0_second_stage define uboot/ib62x0_second_stage
NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage) TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
endef endef
define U-Boot/iconnect define uboot/iconnect
NAME:=Iomega iConnect Wireless TITLE:=U-Boot for Iomega iConnect Wireless
endef endef
define U-Boot/iconnect_second_stage define uboot/iconnect_second_stage
NAME:=Iomega iConnect Wireless (second stage) TITLE:=second stage U-Boot for Iomega iConnect Wireless
endef endef
define U-Boot/nsa310 define uboot/pogo_e02
NAME:=Zyxel NSA310 TITLE:=U-Boot for Cloud Engines Pogoplug E02
endef endef
define U-Boot/nsa325 define uboot/pogo_e02_second_stage
NAME:=Zyxel NSA325v1 and v2 TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02
endef endef
define U-Boot/pogo_e02 define uboot/sheevaplug
NAME:=Cloud Engines Pogoplug E02 TITLE:=U-Boot for SheevaPlug
endef endef
define U-Boot/pogo_e02_second_stage UBOOTS:= \
NAME:=Cloud Engines Pogoplug E02 (second stage)
endef
define U-Boot/sheevaplug
NAME:=SheevaPlug
endef
UBOOT_TARGETS := \
dockstar dockstar_second_stage \ dockstar dockstar_second_stage \
goflexhome \ goflexhome \
ib62x0 ib62x0_second_stage \ ib62x0 ib62x0_second_stage \
iconnect iconnect_second_stage \ iconnect iconnect_second_stage \
nsa310 \
nsa325 \
pogo_e02 pogo_e02_second_stage \ pogo_e02 pogo_e02_second_stage \
sheevaplug 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
define Build/Configure define Build/Configure
$(if $(findstring _second_stage,$(BUILD_VARIANT)), $(if $(findstring _second_stage,$(BUILD_VARIANT)),
$(CP) \ $(CP) \
@ -95,21 +112,34 @@ define Build/Compile
CROSS_COMPILE=$(TARGET_CROSS) CROSS_COMPILE=$(TARGET_CROSS)
mkimage -A $(ARCH) -O linux -T kernel -C none \ mkimage -A $(ARCH) -O linux -T kernel -C none \
-a 0x600000 -e 0x600000 \ -a 0x600000 -e 0x600000 \
-n 'U-Boot uImage' \ -n 'OpenWrt Das U-Boot uImage' \
-d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
endef endef
define Package/u-boot/install define Package/uboot/install/default
$(CP) \ $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
$(PKG_BUILD_DIR)/u-boot.bin \ $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
$(PKG_BUILD_DIR)/u-boot.kwb \ $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
$(PKG_BUILD_DIR)/u-boot.img \ $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
$(1)/ $(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/
endef endef
define Build/InstallDev define Package/uboot/install/template
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin define Package/uboot-kirkwood-$(1)/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/ $(call Package/uboot/install/default,$(2))
endef
endef endef
$(eval $(call BuildPackage/U-Boot)) $(foreach u,$(UBOOTS), \
$(eval $(call Package/uboot/install/template,$(u),$(u))) \
)
$(foreach u,$(UBOOTS), \
$(eval $(call BuildUBootPackage,$(u))) \
$(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
)

View File

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

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

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

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

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

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

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

@ -1,683 +0,0 @@
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 */

View File

@ -1,14 +1,14 @@
--- a/include/configs/dockstar.h --- a/include/configs/dockstar.h
+++ b/include/configs/dockstar.h +++ b/include/configs/dockstar.h
@@ -19,6 +19,7 @@ @@ -31,6 +31,7 @@
#define CONFIG_KW88F6281 1 /* SOC Name */ * Commands configuration
#define CONFIG_MACH_DOCKSTAR /* Machine type */ */
#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
+#define CONFIG_SYS_MVFS +#define CONFIG_SYS_MVFS
#define CONFIG_CMD_ENV
#define CONFIG_CMD_NAND
/* /*
* mv-common.h should be defined after CMD configs since it used them @@ -53,29 +54,29 @@
@@ -37,29 +38,29 @@
* it has to be rounded to sector size * it has to be rounded to sector size
*/ */
#define CONFIG_ENV_SIZE 0x20000 /* 128k */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */
@ -26,12 +26,11 @@
- "ubifsload 0x800000 ${kernel}; " \ - "ubifsload 0x800000 ${kernel}; " \
- "ubifsload 0x1100000 ${initrd}; " \ - "ubifsload 0x1100000 ${initrd}; " \
- "bootm 0x800000 0x1100000" - "bootm 0x800000 0x1100000"
-
-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0"
+ "ubi part ubi; " \ + "ubi part ubi; " \
+ "ubi read 0x800000 kernel; " \ + "ubi read 0x800000 kernel; " \
+ "bootm 0x800000" + "bootm 0x800000"
+
-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0"
+#define CONFIG_MTDPARTS \ +#define CONFIG_MTDPARTS \
+ "mtdparts=orion_nand:" \ + "mtdparts=orion_nand:" \
+ "0xe0000@0x0(uboot)," \ + "0xe0000@0x0(uboot)," \

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,328 +11,336 @@ PKG_NAME:=u-boot
PKG_VERSION:=2013.10 PKG_VERSION:=2013.10
PKG_RELEASE:=1 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_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 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=lantiq TITLE:=
SOC:=
DDR_SETTINGS:= DDR_SETTINGS:=
IMAGE:=
DEPS:=
endef endef
define U-Boot/arv4519pw_ram define uboot/arv4519pw_ram
NAME:=Arcadyan arv4519pw (RAM) TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4519pw
DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv4519pw_nor define uboot/arv4519pw_nor
NAME:=Arcadyan arv4519pw (NOR) TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4519pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv4519pw_brn define uboot/arv4519pw_brn
NAME:=Arcadyan arv4519pw (BRN) TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4519pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7506pw11_ram define uboot/arv7506pw11_ram
NAME:=Arcadyan ARV7506PW11 (RAM) TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7506pw11
DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7506pw11_nor define uboot/arv7506pw11_nor
NAME:=Arcadyan ARV7506PW11 (NOR) TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7506pw11 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7506pw11_brn define uboot/arv7506pw11_brn
NAME:=Arcadyan ARV7506PW11 (BRN) TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7506pw11 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw_ram define uboot/arv7510pw_ram
NAME:=Arcadyan arv7510pw (RAM) TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4510pw
DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw_nor define uboot/arv7510pw_nor
NAME:=Arcadyan arv7510pw (NOR) TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4510pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw_brn define uboot/arv7510pw_brn
NAME:=Arcadyan arv7510pw (BRN) TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv4510pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw22_ram define uboot/arv7510pw22_ram
NAME:=Arcadyan arv7510pw22 (RAM) TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7510pw22
DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw22_nor define uboot/arv7510pw22_nor
NAME:=Arcadyan arv7510pw22 (NOR) TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7510pw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7510pw22_brn define uboot/arv7510pw22_brn
NAME:=Arcadyan arv7510pw22 (BRN) TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7510pw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7518pw_ram define uboot/arv7518pw_ram
NAME:=Arcadyan arv7518pw (RAM) TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7518pw
DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7518pw_nor define uboot/arv7518pw_nor
NAME:=Arcadyan arv7518pw (NOR) TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7518pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv7518pw_brn define uboot/arv7518pw_brn
NAME:=Arcadyan arv7518pw (BRN) TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv7518pw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw_ram define uboot/arv752dpw_ram
NAME:=Arcadyan arv752dpw (RAM) TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
BUILD_DEVICES:=arcadyan_arv752dpw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw_nor define uboot/arv752dpw_nor
NAME:=Arcadyan arv752dpw (NOR) TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv752dpw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw_brn define uboot/arv752dpw_brn
NAME:=Arcadyan arv752dpw (BRN) TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv752dpw DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw22_ram define uboot/arv752dpw22_ram
NAME:=Arcadyan arv752dpw22 (RAM) TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv752dpw22
DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw22_nor define uboot/arv752dpw22_nor
NAME:=Arcadyan arv752dpw22 (NOR) TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv752dpw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv752dpw22_brn define uboot/arv752dpw22_brn
NAME:=Arcadyan arv752dpw22 (BRN) TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv752dpw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv8539pw22_ram define uboot/arv8539pw22_ram
NAME:=Speedport W 504V Typ A (RAM) TITLE:=U-Boot for Speedport W 504V Typ A (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv8539pw22
DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv8539pw22_nor define uboot/arv8539pw22_nor
NAME:=Speedport W 504V Typ A (NOR) TITLE:=U-Boot for Speedport W 504V Typ A (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv8539pw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/arv8539pw22_brn define uboot/arv8539pw22_brn
NAME:=Speedport W 504V Typ A (BRN) TITLE:=U-Boot for Speedport W 504V Typ A (BRN)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=arcadyan_arv8539pw22 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/gigasx76x_ram define uboot/gigasx76x_ram
NAME:=Siemens Gigaset sx76x (RAM) TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=siemens_gigaset-sx76x
DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/gigasx76x_nor define uboot/gigasx76x_nor
NAME:=Siemens Gigaset sx76x (NOR) TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=siemens_gigaset-sx76x DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/acmp252_ram define uboot/acmp252_ram
NAME:=AudioCodes MP-252 (RAM) TITLE:=U-Boot for AudioCodes MP-252 (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=audiocodes_mp-252
DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/acmp252_nor define uboot/acmp252_nor
NAME:=AudioCodes MP-252 (NOR) TITLE:=U-Boot for AudioCodes MP-252 (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=audiocodes_mp-252 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/bthomehubv5a_ram define uboot/bthomehubv5a_ram
NAME:=BT Home Hub 5A (RAM) TITLE:=U-Boot for BT Home Hub 5A (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=bt_homehub-v5a
DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/easy50712_ram define uboot/easy50712_ram
NAME:=Lantiq EASY50712 (RAM) TITLE:=U-Boot for Lantiq EASY50712 (RAM)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=lantiq_easy50712
DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/easy50712_nor define uboot/easy50712_nor
NAME:=Lantiq EASY50712 (NOR) TITLE:=U-Boot for Lantiq EASY50712 (NOR)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=lantiq_easy50712 DEPS:=@TARGET_lantiq_xway
endef endef
define U-Boot/easy50712_norspl define uboot/easy50712_norspl
NAME:=Lantiq EASY50712 (NOR SPL) TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
BUILD_SUBTARGET:=xway SOC:=danube
BUILD_DEVICES:=lantiq_easy50712 IMAGE:=u-boot.ltq.lzo.norspl
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPS:=@TARGET_lantiq_xway
DEPENDS+=@BROKEN
endef endef
define U-Boot/easy80920_ram define uboot/easy80920_ram
NAME:=Lantiq EASY80920 (RAM) TITLE:=U-Boot for Lantiq EASY80920 (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand
DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/easy80920_nor define uboot/easy80920_nor
NAME:=Lantiq EASY80920 (NOR) TITLE:=U-Boot for Lantiq EASY80920 (NOR)
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand SOC:=vr9
BUILD_SUBTARGET:=xrx200 DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/easy80920_norspl define uboot/easy80920_norspl
NAME:=Lantiq EASY80920 (NOR SPL) TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand IMAGE:=u-boot.ltq.lzo.norspl
UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPS:=@TARGET_lantiq_xrx200
DEPENDS+=@BROKEN
endef endef
define U-Boot/easy80920_sfspl define uboot/easy80920_sfspl
NAME:=Lantiq EASY80920 (SPI SPL) TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand IMAGE:=u-boot.ltq.lzo.sfspl
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPS:=@TARGET_lantiq_xrx200
DEPENDS+=@BROKEN
endef endef
define U-Boot/fb3370_eva define uboot/fb3370_eva
NAME:=AVM FRITZ3370 (EVA) TITLE:=U-Boot for AVM FRITZ3370 (EVA)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=avm_fritz3370 DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/fb3370_ram define uboot/fb3370_ram
NAME:=AVM FRITZ3370 (RAM) TITLE:=U-Boot for AVM FRITZ3370 (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=avm_fritz3370
DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/fb3370_sfspl define uboot/fb3370_sfspl
NAME:=AVM FRITZ3370 (SPI SPL) TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=avm_fritz3370 IMAGE:=u-boot.ltq.lzo.sfspl
UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPS:=@TARGET_lantiq_xrx200
DEPENDS+=@BROKEN
endef endef
define U-Boot/p2812hnufx_ram define uboot/p2812hnufx_ram
NAME:=ZyXEL P-2812HNU-Fx (RAM) TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=zyxel_p-2812hnu-f1
DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/p2812hnufx_nandspl define uboot/p2812hnufx_nandspl
NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=zyxel_p-2812hnu-f1 IMAGE:=u-boot.ltq.lzo.nandspl
UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl DEPS:=@TARGET_lantiq_xrx200
DEPENDS+=@BROKEN
endef endef
define U-Boot/vgv7510kw22_brn define uboot/vgv7510kw22_brn
NAME:=Arcadyan VGV7510KW22 (BRN) TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/vgv7510kw22_nor define uboot/vgv7510kw22_nor
NAME:=Arcadyan VGV7510KW22 (NOR) TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/vgv7510kw22_ram define uboot/vgv7510kw22_ram
NAME:=Arcadyan VGV7510KW22 (RAM) TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7510kw22-nor
DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/vgv7519_brn define uboot/vgv7519_brn
NAME:=Arcadyan VGV7519 (BRN) TITLE:=U-Boot for Arcadyan VGV7519 (BRN)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/vgv7519_nor define uboot/vgv7519_nor
NAME:=Arcadyan VGV7519 (NOR) TITLE:=U-Boot for Arcadyan VGV7519 (NOR)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DEPS:=@TARGET_lantiq_xrx200
endef endef
define U-Boot/vgv7519_ram define uboot/vgv7519_ram
NAME:=Arcadyan VGV7519 (RAM) TITLE:=U-Boot for Arcadyan VGV7519 (RAM)
BUILD_SUBTARGET:=xrx200 SOC:=vr9
BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn
DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
DEPS:=@TARGET_lantiq_xrx200
endef endef
UBOOT_TARGETS:= \ UBOOTS:= \
arv4519pw_ram arv4519pw_nor arv4519pw_brn \ arv4519pw_ram arv4519pw_nor arv4519pw_brn \
arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \ arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \
arv7510pw_ram arv7510pw_nor arv7510pw_brn \ arv7510pw_ram arv7510pw_nor arv7510pw_brn \
@ -351,6 +359,25 @@ UBOOT_TARGETS:= \
vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \ vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
vgv7519_brn vgv7519_nor vgv7519_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 define CompressVR9Firmware
$(STAGING_DIR_HOST)/bin/lzma e \ $(STAGING_DIR_HOST)/bin/lzma e \
$(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \ $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
@ -366,25 +393,40 @@ define Build/Prepare
$(call CompressVR9Firmware,22f,2) $(call CompressVR9Firmware,22f,2)
endef endef
UBOOT_MAKE_FLAGS := define Build/Configure
$(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
endef
ifeq ($(SUBTARGET),xway) define Build/Compile
SOC:=danube $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
else endef
SOC:=vr9
endif
define Package/u-boot/install/uart 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
awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \ awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
-v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \ -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
> $(PKG_BUILD_DIR)/ddr_settings > $(PKG_BUILD_DIR)/ddr_settings
perl $(PKG_BUILD_DIR)/tools/gct.pl \ perl $(PKG_BUILD_DIR)/tools/gct.pl \
$(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \ $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
$(1)/u-boot.asc $(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
endef endef
define Package/u-boot/install $(foreach u,$(UBOOTS), \
$(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default)) $(eval $(call BuildUBootPackage,$(u))) \
endef $(eval $(call Package/uboot/install/template,$(u))) \
$(eval $(call BuildPackage,uboot-lantiq-$(u))) \
$(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) +static int spl_uncompress_lzo(struct spl_image *spl, unsigned long loadaddr)
+{ +{
+ size_t len = CONFIG_SYS_LOAD_SIZE; + size_t len;
+ int ret; + int ret;
+ +
+ spl_puts("SPL: decompressing U-Boot with LZO\n"); + spl_puts("SPL: decompressing U-Boot with LZO\n");
@ -3237,7 +3237,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+} +}
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/arch-danube/config.h +++ b/arch/mips/include/asm/arch-danube/config.h
@@ -0,0 +1,164 @@ @@ -0,0 +1,163 @@
+/* +/*
+ * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -3296,7 +3296,6 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET 0x4000 +#define CONFIG_SYS_INIT_SP_OFFSET 0x4000
+ +
+/* SRAM */ +/* SRAM */
@ -3476,7 +3475,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#endif /* __DANUBE_SOC_H__ */ +#endif /* __DANUBE_SOC_H__ */
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/arch-vrx200/config.h +++ b/arch/mips/include/asm/arch-vrx200/config.h
@@ -0,0 +1,188 @@ @@ -0,0 +1,187 @@
+/* +/*
+ * Copyright (C) 2010 Lantiq Deutschland GmbH + * Copyright (C) 2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -3547,7 +3546,6 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
+ +
+/* SRAM */ +/* SRAM */
@ -7259,7 +7257,7 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+static struct phy_driver pef7071_driver = { +static struct phy_driver pef7071_driver = {
+ .name = "Lantiq XWAY PEF7071", + .name = "Lantiq XWAY PEF7071",
+ .uid = 0xd565a400, + .uid = 0xd565a400,
+ .mask = 0xFFFFFFF8, + .mask = 0xFFFFFFFF,
+ .features = PHY_GBIT_FEATURES, + .features = PHY_GBIT_FEATURES,
+ .config = ltq_phy_config, + .config = ltq_phy_config,
+ .startup = ltq_phy_startup, + .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) #define STATUS_LANTIQ (STATUS_MIPS34K | STATUS_MIPS32_64)
--- /dev/null --- /dev/null
+++ b/arch/mips/include/asm/arch-arx100/config.h +++ b/arch/mips/include/asm/arch-arx100/config.h
@@ -0,0 +1,176 @@ @@ -0,0 +1,175 @@
+/* +/*
+ * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH
+ * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com
@ -967,7 +967,6 @@ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
+#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_START 0x81000000
+#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000
+#define CONFIG_SYS_LOAD_ADDR 0x81000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000
+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024)
+#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024)
+ +
+/* SRAM */ +/* SRAM */

View File

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

View File

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

View File

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

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

@ -1,53 +0,0 @@
#
# Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape-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,71 +6,100 @@
# #
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/image.mk
PKG_NAME:=uboot-layerscape PKG_NAME:=uboot-layerscape
PKG_SOURCE_DATE:=2017-08-24 PKG_VERSION:=v1.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768
PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git
PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d 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
include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define U-Boot/Default define uboot/Default
BUILD_TARGET:=layerscape TITLE:=
BUILD_SUBTARGET:=armv8_64b CONFIG:=
BUILD_DEVICES:=$(1) IMAGE:=
UBOOT_IMAGE:=u-boot-dtb.bin
HIDDEN:=y
endef endef
define U-Boot/ls1043ardb define uboot/ls1043ardb
NAME:=NXP ls1043ardb 64b Dev Board TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board
CONFIG=ls1043ardb
endef endef
define U-Boot/ls1046ardb define uboot/ls1046ardb
NAME:=NXP ls1046ardb 64b Dev Board TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board
UBOOT_CONFIG:=ls1046ardb_qspi CONFIG=ls1046ardb_qspi
endef endef
define U-Boot/ls1012ardb define uboot/ls1012ardb
NAME:=NXP ls1012ardb 64b Dev Board TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board
UBOOT_CONFIG:=ls1012ardb_qspi CONFIG=ls1012ardb_qspi
IMAGE=u-boot-swap.bin
endef endef
define U-Boot/ls1088ardb UBOOTS := \
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 \ ls1043ardb \
ls1046ardb \ ls1046ardb \
ls1012ardb \ ls1012ardb
ls1088ardb \
ls2088ardb \
ls1012afrdm
define Build/InstallDev define Package/uboot/template
$(INSTALL_DIR) $(STAGING_DIR_IMAGE) define Package/uboot-layerscape-64b-$(1)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin 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
endef endef
define Package/u-boot/install/default define BuildUBootPackage
$(eval $(uboot/Default))
$(eval $(uboot/$(1)))
$(call Package/uboot/template,$(1),$(TITLE))
endef endef
$(eval $(call BuildPackage/U-Boot)) 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))) \
)

View File

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

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

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

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

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

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

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