Re: [OpenWrt-Devel] Patches/files when using external Git repo
Sorry about the useless subject, one unconsecrated moment and it was too late :-) -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] OpenWrt
Hi all, While trying to integrate a new platform, I tried using the external Git clone option (CONFIG_KERNEL_GIT_CLONE_URI and friends). This worked fine, however when the build system came to build the WLAN drivers (mac80211) package, the built aborted with this error: default.install make[3]: Leaving directory '/home/ags/projects/openwrt/openwrt/package/network/utils/iw' make[3]: Entering directory '/home/ags/projects/openwrt/openwrt/package/kernel/mac80211' rm -f /home/ags/projects/openwrt/openwrt/staging_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/stamp/.mac80211_installed cmp /home/ags/projects/openwrt/openwrt/build_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/linux-vf610/compat-wireless-2015-03-09/include/linux/ath9k_platform.h /home/ags/projects/openwrt/openwrt/build_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/linux-vf610/linux-4.0.4/include/linux/ath9k_platform.h /home/ags/projects/openwrt/openwrt/build_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/linux-vf610/compat-wireless-2015-03-09/include/linux/ath9k_platform.h /home/ags/projects/openwrt/openwrt/build_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/linux-vf610/linux-4.0.4/include/linux/ath9k_platform.h differ: char 1349, line 44 Makefile:2019: recipe for target '/home/ags/projects/openwrt/openwrt/build_dir/target-arm_cortex-a5+neon_uClibc-0.9.33.2_eabi/linux-vf610/compat-wireless-2015-03-09/.configured_yynyynnnynnyyn' failed As far as I understand the Makefile the cmp check some files to be in the right version (e.g. patches/files no applied). The updated files seem to be available in the folder ./target/linux/generic/files/include/linux/ath9k_platform.h, however, probably due to using an external tree, they do not get applied. Hence my question: Is there a way to let the build system apply them even when using the external tree functionality? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] ar71xx: Add platform machine support for the Netgear WNDR3700v4
> Yes, you're right. I want to make sure we have a unique configuration > for this machine without changing some existing code. > I'm a bit confused because the WNDR4300 is still marked as "broken". > So I decided to make a unique one. Also I can't check the image on the > WNDR4300 because lack of the hardware. WNDR4300 is marked as broken because sysupgrade does not work yet. You can send me a patch integrating WNDR3700v4 into WNDR4300 code, I have a device around to test it. -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 1/2] iwinfo: add Atheros AR9580 to hardware.txt
Signed-off-by: Stefan Agner --- package/network/utils/iwinfo/src/hardware.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/utils/iwinfo/src/hardware.txt b/package/network/utils/iwinfo/src/hardware.txt index 66cbe2a..153ffeb 100644 --- a/package/network/utils/iwinfo/src/hardware.txt +++ b/package/network/utils/iwinfo/src/hardware.txt @@ -51,6 +51,7 @@ 0x168c 0x0029 0x168c 0xa0950 0 "Atheros" "AR9223" 0x168c 0x002a 0x168c 0xa0930 0 "Atheros" "AR9280" 0x168c 0x002b 0x168c 0xa0910 0 "Atheros" "AR9285" +0x168c 0x0033 0x168c 0xa1200 0 "Atheros" "AR9580" 0x1814 0x3050 0x1814 0x00050 0 "RaLink" "Rt3050" 0x1814 0x3052 0x1814 0x00080 0 "RaLink" "Rt3052" 0x1814 0x3352 0x1814 0x000c0 0 "RaLink" "Rt3352" -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v2 2/2] iwinfo: add device detection using modalias
Detect SoC wireless mac such as AR9340 using the devices modalias string. Beside PCI IDs the hardware.txt can now contain modalias strings as device identification. Signed-off-by: Stefan Agner --- package/network/utils/iwinfo/src/hardware.txt | 1 + package/network/utils/iwinfo/src/include/iwinfo.h | 1 + .../utils/iwinfo/src/include/iwinfo/utils.h| 3 +- .../network/utils/iwinfo/src/include/iwinfo/wext.h | 1 + package/network/utils/iwinfo/src/iwinfo_nl80211.c | 50 +++--- package/network/utils/iwinfo/src/iwinfo_utils.c| 39 - package/network/utils/iwinfo/src/iwinfo_wext.c | 9 7 files changed, 78 insertions(+), 26 deletions(-) diff --git a/package/network/utils/iwinfo/src/hardware.txt b/package/network/utils/iwinfo/src/hardware.txt index 153ffeb..85b2986 100644 --- a/package/network/utils/iwinfo/src/hardware.txt +++ b/package/network/utils/iwinfo/src/hardware.txt @@ -51,6 +51,7 @@ 0x168c 0x0029 0x168c 0xa0950 0 "Atheros" "AR9223" 0x168c 0x002a 0x168c 0xa0930 0 "Atheros" "AR9280" 0x168c 0x002b 0x168c 0xa0910 0 "Atheros" "AR9285" +"platform:ar934x_wmac" 0 0 "Atheros" "AR9340" 0x168c 0x0033 0x168c 0xa1200 0 "Atheros" "AR9580" 0x1814 0x3050 0x1814 0x00050 0 "RaLink" "Rt3050" 0x1814 0x3052 0x1814 0x00080 0 "RaLink" "Rt3052" diff --git a/package/network/utils/iwinfo/src/include/iwinfo.h b/package/network/utils/iwinfo/src/include/iwinfo.h index ebea319..474b44f 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo.h +++ b/package/network/utils/iwinfo/src/include/iwinfo.h @@ -138,6 +138,7 @@ struct iwinfo_hardware_entry { uint16_t device_id; uint16_t subsystem_vendor_id; uint16_t subsystem_device_id; + char modalias[64]; int16_t txpower_offset; int16_t frequency_offset; }; diff --git a/package/network/utils/iwinfo/src/include/iwinfo/utils.h b/package/network/utils/iwinfo/src/include/iwinfo/utils.h index d58ec5f..90aa84a 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/utils.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/utils.h @@ -37,7 +37,8 @@ int iwinfo_ifmac(const char *ifname); void iwinfo_close(void); -struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id); +struct iwinfo_hardware_entry * iwinfo_hardware_modalias(char *modalias); +struct iwinfo_hardware_entry * iwinfo_hardware_pci(struct iwinfo_hardware_id *id); int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id); diff --git a/package/network/utils/iwinfo/src/include/iwinfo/wext.h b/package/network/utils/iwinfo/src/include/iwinfo/wext.h index e84f6a6..b86b050 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/wext.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/wext.h @@ -51,6 +51,7 @@ int wext_get_countrylist(const char *ifname, char *buf, int *len); int wext_get_hwmodelist(const char *ifname, int *buf); int wext_get_mbssid_support(const char *ifname, int *buf); int wext_get_hardware_id(const char *ifname, char *buf); +int wext_get_hardware_modalias(const char *ifname, char *buf); int wext_get_hardware_name(const char *ifname, char *buf); void wext_close(void); diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c index a258d2f..c43bd09 100644 --- a/package/network/utils/iwinfo/src/iwinfo_nl80211.c +++ b/package/network/utils/iwinfo/src/iwinfo_nl80211.c @@ -2281,28 +2281,8 @@ int nl80211_get_mbssid_support(const char *ifname, int *buf) int nl80211_get_hardware_id(const char *ifname, char *buf) { int rv; - char *res; - /* Got a radioX pseudo interface, find some interface on it or create one */ - if (!strncmp(ifname, "radio", 5)) - { - /* Reuse existing interface */ - if ((res = nl80211_phy2ifname(ifname)) != NULL) - { - rv = wext_get_hardware_id(res, buf); - } - - /* Need to spawn a temporary iface for finding IDs */ - else if ((res = nl80211_ifadd(ifname)) != NULL) - { - rv = wext_get_hardware_id(res, buf); - nl80211_ifdel(res); - } - } - else - { - rv = wext_get_hardware_id(ifname, buf); - } + rv = wext_get_hardware_id(ifname, buf); /* Failed to obtain hardware IDs, search board config */ if (rv) @@ -2317,11 +2297,33 @@ static const struct iwinfo_hardware_entry * nl80211_get_hardware_entry(const char *ifname) { struct iwinfo_hardware_id id; + static struct iwinfo_hardware_entry *he = NULL; + char *res, *real_ifname = ifname, *tmp_ifname = NULL; +
[OpenWrt-Devel] [PATCH v2 0/2] WNDR4300 iwinfo hardware.txt update
This patches updates iwinfo to get the device string of the Wireless MAC correctly. The PCI connected AR9580 (used for 5GHz) is only an entry in the hardware.txt database. The SoC Wireless MAC AR9340 needed some extension in the iwinfo code. I came up with the solution to use the modalias strings in order to detect the on SoC Wireless MAC. I'm not sure wheater this is a clean solution, I think its better than poking around in the EEPROM/MTD in order to find some (pseudo) device/vendor id. At least for the Atheros based devices this should work fine since all Wirless MAC have a distinct modalias (see arch/mips/ath79/dev-wmac.c). Changes since v1: - Don't fail if no entry was found - Renamed modstring to modalias - Create temporary iface for modalias method as well Stefan Agner (2): iwinfo: add Atheros AR9580 to hardware.txt iwinfo: add device detection using modalias package/network/utils/iwinfo/src/hardware.txt | 2 + package/network/utils/iwinfo/src/include/iwinfo.h | 1 + .../utils/iwinfo/src/include/iwinfo/utils.h| 3 +- .../network/utils/iwinfo/src/include/iwinfo/wext.h | 1 + package/network/utils/iwinfo/src/iwinfo_nl80211.c | 50 +++--- package/network/utils/iwinfo/src/iwinfo_utils.c| 39 - package/network/utils/iwinfo/src/iwinfo_wext.c | 9 7 files changed, 79 insertions(+), 26 deletions(-) -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] iwinfo: add device detection using modalias
Detect SoC wireless mac such as AR9340 using the devices modalias string. Beside PCI IDs the hardware.txt can now contain modalias strings as device identification. Signed-off-by: Stefan Agner --- package/network/utils/iwinfo/src/hardware.txt | 1 + package/network/utils/iwinfo/src/include/iwinfo.h | 1 + .../utils/iwinfo/src/include/iwinfo/utils.h| 3 +- .../network/utils/iwinfo/src/include/iwinfo/wext.h | 1 + package/network/utils/iwinfo/src/iwinfo_nl80211.c | 9 +++-- package/network/utils/iwinfo/src/iwinfo_utils.c| 39 +- package/network/utils/iwinfo/src/iwinfo_wext.c | 9 + 7 files changed, 58 insertions(+), 5 deletions(-) diff --git a/package/network/utils/iwinfo/src/hardware.txt b/package/network/utils/iwinfo/src/hardware.txt index 153ffeb..85b2986 100644 --- a/package/network/utils/iwinfo/src/hardware.txt +++ b/package/network/utils/iwinfo/src/hardware.txt @@ -51,6 +51,7 @@ 0x168c 0x0029 0x168c 0xa0950 0 "Atheros" "AR9223" 0x168c 0x002a 0x168c 0xa0930 0 "Atheros" "AR9280" 0x168c 0x002b 0x168c 0xa0910 0 "Atheros" "AR9285" +"platform:ar934x_wmac" 0 0 "Atheros" "AR9340" 0x168c 0x0033 0x168c 0xa1200 0 "Atheros" "AR9580" 0x1814 0x3050 0x1814 0x00050 0 "RaLink" "Rt3050" 0x1814 0x3052 0x1814 0x00080 0 "RaLink" "Rt3052" diff --git a/package/network/utils/iwinfo/src/include/iwinfo.h b/package/network/utils/iwinfo/src/include/iwinfo.h index ebea319..0729915 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo.h +++ b/package/network/utils/iwinfo/src/include/iwinfo.h @@ -138,6 +138,7 @@ struct iwinfo_hardware_entry { uint16_t device_id; uint16_t subsystem_vendor_id; uint16_t subsystem_device_id; + char modstring[64]; int16_t txpower_offset; int16_t frequency_offset; }; diff --git a/package/network/utils/iwinfo/src/include/iwinfo/utils.h b/package/network/utils/iwinfo/src/include/iwinfo/utils.h index d58ec5f..0328ccf 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/utils.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/utils.h @@ -37,7 +37,8 @@ int iwinfo_ifmac(const char *ifname); void iwinfo_close(void); -struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id); +struct iwinfo_hardware_entry * iwinfo_hardware_modstring(char *modstring); +struct iwinfo_hardware_entry * iwinfo_hardware_pci(struct iwinfo_hardware_id *id); int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id); diff --git a/package/network/utils/iwinfo/src/include/iwinfo/wext.h b/package/network/utils/iwinfo/src/include/iwinfo/wext.h index e84f6a6..aefc72b 100644 --- a/package/network/utils/iwinfo/src/include/iwinfo/wext.h +++ b/package/network/utils/iwinfo/src/include/iwinfo/wext.h @@ -51,6 +51,7 @@ int wext_get_countrylist(const char *ifname, char *buf, int *len); int wext_get_hwmodelist(const char *ifname, int *buf); int wext_get_mbssid_support(const char *ifname, int *buf); int wext_get_hardware_id(const char *ifname, char *buf); +int wext_get_hardware_modstring(const char *ifname, char *buf); int wext_get_hardware_name(const char *ifname, char *buf); void wext_close(void); diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c index a258d2f..9d23d36 100644 --- a/package/network/utils/iwinfo/src/iwinfo_nl80211.c +++ b/package/network/utils/iwinfo/src/iwinfo_nl80211.c @@ -2317,11 +2317,14 @@ static const struct iwinfo_hardware_entry * nl80211_get_hardware_entry(const char *ifname) { struct iwinfo_hardware_id id; + static char modstring[64]; - if (nl80211_get_hardware_id(ifname, (char *)&id)) - return NULL; + if (!nl80211_get_hardware_id(ifname, (char *)&id)) + return iwinfo_hardware_pci(&id); - return iwinfo_hardware(&id); + /* Get hardware from modstring (SoC) */ + if (!wext_get_hardware_modstring(ifname, modstring)) + return iwinfo_hardware_modstring(modstring); } int nl80211_get_hardware_name(const char *ifname, char *buf) diff --git a/package/network/utils/iwinfo/src/iwinfo_utils.c b/package/network/utils/iwinfo/src/iwinfo_utils.c index 1a831f3..09194c9 100644 --- a/package/network/utils/iwinfo/src/iwinfo_utils.c +++ b/package/network/utils/iwinfo/src/iwinfo_utils.c @@ -127,7 +127,7 @@ void iwinfo_close(void) ioctl_socket = -1; } -struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id) +struct iwinfo_hardware_entry * iwinfo_hardware_modstring(char *modstring) { FILE *db; char buf[256] = { 0 }; @@ -140,6 +140,43 @@ struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id) {
[OpenWrt-Devel] [PATCH 0/2] WNDR4300 iwinfo hardware.txt update
This patches updates iwinfo to get the device string of the Wireless MAC correctly. The PCI connected AR9580 (used for 5GHz) is only an entry in the hardware.txt database. The SoC Wireless MAC AR9340 needed some extension in the iwinfo code. I came up with the solution to use the modalias strings in order to detect the on SoC Wireless MAC. I'm not sure wheater this is a clean solution, I think its better than poking around in the EEPROM/MTD in order to find some (pseudo) device/vendor id. At least for the Atheros based devices this should work fine since all Wirless MAC have a distinct modalias (see arch/mips/ath79/dev-wmac.c). -- Stefan Stefan Agner (2): iwinfo: add Atheros AR9580 to hardware.txt iwinfo: add device detection using modalias package/network/utils/iwinfo/src/hardware.txt | 2 ++ package/network/utils/iwinfo/src/include/iwinfo.h | 1 + .../utils/iwinfo/src/include/iwinfo/utils.h| 3 +- .../network/utils/iwinfo/src/include/iwinfo/wext.h | 1 + package/network/utils/iwinfo/src/iwinfo_nl80211.c | 9 +++-- package/network/utils/iwinfo/src/iwinfo_utils.c| 39 +- package/network/utils/iwinfo/src/iwinfo_wext.c | 9 + 7 files changed, 59 insertions(+), 5 deletions(-) -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/2] iwinfo: add Atheros AR9580 to hardware.txt
Signed-off-by: Stefan Agner --- package/network/utils/iwinfo/src/hardware.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/utils/iwinfo/src/hardware.txt b/package/network/utils/iwinfo/src/hardware.txt index 66cbe2a..153ffeb 100644 --- a/package/network/utils/iwinfo/src/hardware.txt +++ b/package/network/utils/iwinfo/src/hardware.txt @@ -51,6 +51,7 @@ 0x168c 0x0029 0x168c 0xa0950 0 "Atheros" "AR9223" 0x168c 0x002a 0x168c 0xa0930 0 "Atheros" "AR9280" 0x168c 0x002b 0x168c 0xa0910 0 "Atheros" "AR9285" +0x168c 0x0033 0x168c 0xa1200 0 "Atheros" "AR9580" 0x1814 0x3050 0x1814 0x00050 0 "RaLink" "Rt3050" 0x1814 0x3052 0x1814 0x00080 0 "RaLink" "Rt3052" 0x1814 0x3352 0x1814 0x000c0 0 "RaLink" "Rt3352" -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] ar71xx: wndr4300: set official mac addresses
Get the factory assigned mac addresses stored in the caldata partition and asign them to lan, wan and radio1. Signed-off-by: Stefan Agner --- package/base-files/files/lib/functions/uci-defaults.sh | 9 + target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 6 ++ 2 files changed, 15 insertions(+) diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index bf6fe1e..061c871 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -210,6 +210,15 @@ set network.$ifname.macaddr='$mac' EOF } +ucidef_set_wireless_macaddr() { + local ifname=$1 + local mac=$2 + + uci batch <https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Nevermind, the second time it worked: [2.71] UBI: attaching mtd8 to ubi0 [2.74] UBI: EOF marker found, PEBs from 17 will be erased [2.74] UBI: scanning is finished [2.77] gluebi (pid 1): gluebi_resized: got update notification for unknown UBI device 0 volume 1 [2.78] UBI: volume 1 ("rootfs_data") re-sized from 1 to 146 LEBs [2.79] UBI: attached mtd8 (name "ubiroot", size 23 MiB) to ubi0 [2.80] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes [2.81] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 [2.81] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096 [2.82] UBI: good PEBs: 184, bad PEBs: 0, corrupted PEBs: 0 [2.82] UBI: user volume: 2, internal volumes: 1, max. volumes count: 128 [2.83] UBI: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1699075075 [2.84] UBI: available PEBs: 0, total reserved PEBs: 184, PEBs reserved for bad PEB handling: 20 [2.85] UBI: background thread "ubi_bgt0d" started, PID 263 [2.86] mtd: device 12 (rootfs) set to be root filesystem [2.87] VFS: Mounted root (squashfs filesystem) readonly on device 31:12. Probably because I made no make clean before building the new image with those EOF marker? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
> Weird. For me it was working only at the first boot after flashing the image, > but any modifications in the fs has been lost after subsequent reboots. Hm, might be I did not looked at that correctly. Altough, I installed some packages and I think they were still there after reboot... Just updated to latest master and flashed the image using Factory Reset (U-Boot TFTP-Server). The flashing worked fine, but I now get an error on bootup: [2.71] UBI: attaching mtd8 to ubi0 [2.79] UBI error: scan_peb: bad image sequence number 248591051 in PEB 63, expected 172450884 [2.80] Erase counter header dump: [2.81] magic 0x55424923 [2.81] version1 [2.81] ec 1 [2.82] vid_hdr_offset 2048 [2.82] data_offset4096 [2.82] image_seq 248591051 [2.83] hdr_crc0x98ac164 [2.83] erase counter header hexdump: [2.83] UBI error: ubi_attach_mtd_dev: failed to attach mtd8, error -22 [2.84] UBI error: ubi_init: cannot attach mtd8 [2.85] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 It looks like there's a bug in the new EOF marker support. I looked into the code, I found this interesting comment just before the "bad image sequence" error message: /* * Make sure that all PEBs have the same image sequence number. * This allows us to detect situations when users flash UBI * images incorrectly, so that the flash has the new UBI image * and leftovers from the old one. This feature was added * relatively recently, and the sequence number was always * zero, because old UBI implementations always set it to zero. * For this reasons, we do not panic if some PEBs have zero * sequence number, while other PEBs have non-zero sequence * number. */ -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi Gabor Am 2013-11-06 10:14, schrieb Gabor Juhos: > I have applied both patches, although I did several modifications in those. Cool, thanks! Just compiled an image and flashed it, works fine on my device! >> By creating a file system manually I tested using UBIFS instead of JFFS2 >> as the overlaying file system, it seems to work. However, userspace >> utilities (ubox) need to be altered in order to support this properly. > > Correct. I had to modify ubox to make it work correctly with JFFS2 on emulated > MTD devices. On my device, when using ubox without any patchs, I get errors, but it worked somehow... I already tested UBIFS on the device by manually overlaying it, technically things look good. But to support proper UBIFS instead of JFFS2 we would need another bunch of changes to ubox and also quite a lot of changes to the init scripts. What do you think, were to begin on this matter? > AFAIK the WAN port is not connected to the second ethernet interface, so we > are > using VLANs to separate that from the LAN ports. It is working, but currently > it > uses the same MAC address as the LAN interface. Additionally, this MAC address > is a randomly genereated one. We should read the correct MAC from the flash > and > set the interface MAC addresses based on that. You're right, its already configured correctly on eth0.2. Just tested the WAN port, looks good on my device. Thanks for your great work! Having mainline OpenWRT on it, I really like this device! -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/2] ar71xx: Generate UBI image for WNDR4300
Extended the Makefile to generate a working factory reset image for Netgear WNDR4300. The image uses UBI with two volumes squashfs (rootfs) and JFFS2 (rootfs_data). In order to make stock U-Boot happy, a fake header is placed just before the root image (at the very end of the kernel partition). Signed-off-by: Stefan Agner --- target/linux/ar71xx/image/Makefile | 92 ++--- target/linux/ar71xx/image/ubinize.cfg | 15 ++ target/linux/ar71xx/nand/config-default | 4 +- 3 files changed, 103 insertions(+), 8 deletions(-) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index ba88099..b7c917a 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -204,7 +204,7 @@ wnr2200_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmwa wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro wndr3700v2_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro -wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),1152k(kernel),24448k(rootfs),25600k@0x6c(firmware),256k(caldata_backup),-(reserved) +wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),1152k(kernel),24448k(ubiroot),25600k@0x6c(firmware),256k(caldata_backup),-(reserved) zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x5(firmware) mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro @@ -713,7 +713,72 @@ define Image/Build/Netgear/initramfs $(5) endef -Image/Build/NetgearNAND/initramfs=$(call Image/Build/Netgear/initramfs,$(1),$(2),$(3),$(4),$(5)) + +# $1: Image Type (ubi) +# $2: Board name (small caps) +# $3: Kernel board specific cmdline +# $4: Kernel mtdparts definition +# $5: U-Boot magic +# $6: Board name (upper caps) +# $7: +# $8: DNI Hardware version +define Image/Build/NetgearNAND + $(eval firmwaresize=$(call mtdpartsize,firmware,$(4))) + $(eval kernelsize=$(call mtdpartsize,kernel,$(4))) + $(eval imageraw=$(call imgname,ubifs,$(2))-raw.img) + # Create firmware image full of 0xff to use the UBIFS auto-resize function + firmwareblocks=(($(firmwaresize) / 131072)); \ + dd if=/dev/zero bs=128k count={firmwareblocks} conv=sync | tr '\000' '\377' > $(imageraw) + # Insert Kernel and UBI image to rootfs and generate DNI image + dd if=vmlinux-$(2).uImage.fakehdrforubi of=$(imageraw) conv=notrunc + kernelblocks=(($(kernelsize) / 131072)); \ + dd if=$(KDIR)/root.ubi of=$(imageraw) bs=128k seek={kernelblocks} conv=notrunc + $(STAGING_DIR_HOST)/bin/mkdniimg \ + -B $(6) -v OpenWrt.$(REVISION) -r "r" $(8) \ + -i $(imageraw) \ + -o $(call imgname,$(1),$(2))-factory.img +endef + +# $1: (empty?) +# $2: Board name (small caps) +# $3: Kernel board specific cmdline +# $4: Kernel mtdparts definition +# $5: U-Boot magic +define Image/Build/NetgearNAND/buildkernel + $(eval kernelsize=$(call mtdpartsize,kernel,$(4))) + echo == NetgearNAND buildkernel == + $(call MkuImageLzma,$(2),$(3) $(4),-d20) + -rm -rf $(KDIR_TMP)/$(2) + mkdir -p $(KDIR_TMP)/$(2)/image + $(STAGING_DIR_HOST)/bin/wndr3700 \ + $(KDIR_TMP)/vmlinux-$(2).uImage \ + $(KDIR_TMP)/vmlinux-$(2).uImage.tmp \ + $(5) + # Create fake header using UBI EC Header magic (UBI_EC_HDR_MAGIC) + echo -n "UBI#" > $(KDIR_TMP)/ubihdr + mkimage -A mips -O linux -T filesystem -C none \ + -a 0xbf07 -e 0xbf07 \ + -n 'MIPS OpenWrt rootfs' \ + -d $(KDIR_TMP)/ubihdr \ + $(KDIR_TMP)/ubihdr.uImage + $(STAGING_DIR_HOST)/bin/wndr3700 \ + $(KDIR_TMP)/ubihdr.uImage \ + $(KDIR_TMP)/ubihdr-$(2).uImage \ + $(5) + # Calculate size between kernel and header of root filesystem + # (this will be filled with zeros) + paddingsize=(($(kernelsize) - `stat -c%s $(KDIR_TMP)/vmlinux-$(2).uImage.tmp` - 64)); \ + ( \ + cat $(KDIR_TMP)/vmlinux-$(2).uImage.tmp; \ + dd if=/dev/zero bs=1 count={paddingsize}; \ + head -c 64 $(KDIR_TMP)/ubihdr-$(2).uImage \ + ) > vmlinux-$(2).uImage.fakehdrforubi +endef + + +define Image/Build/NetgearNAND/initramfs + $(call Image/Build/Netgear,$(1),$(2),$(3),$(4),$(5),
[OpenWrt-Devel] [PATCH 1/2] ar71xx: Add new subtarget nand for WNDR4300
Add new subtarget nand with UBI/UBIFS including GLUEBI and squashfs. This target will be used for NAND based router which make use of UBI (and maybe UBIFS later on) in order to provide proper NAND support. Signed-off-by: Stefan Agner --- target/linux/ar71xx/Makefile | 2 +- target/linux/ar71xx/image/Makefile | 7 +- target/linux/ar71xx/image/ubinize.cfg| 14 target/linux/ar71xx/nand/config-default | 119 +++ target/linux/ar71xx/nand/profiles/netgear.mk | 22 + target/linux/ar71xx/nand/target.mk | 8 ++ 6 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize.cfg create mode 100644 target/linux/ar71xx/nand/config-default create mode 100644 target/linux/ar71xx/nand/profiles/netgear.mk create mode 100644 target/linux/ar71xx/nand/target.mk diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 1f75ab8..8c7a1d6 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -11,7 +11,7 @@ BOARD:=ar71xx BOARDNAME:=Atheros AR7xxx/AR9xxx FEATURES:=mips16 CPU_TYPE=34kc -SUBTARGETS:=generic mikrotik +SUBTARGETS:=generic nand mikrotik LINUX_VERSION:=3.10.17 diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 0d8f72b..ba88099 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -872,8 +872,6 @@ $(eval $(call SingleProfile,Netgear,64kraw,WNDR3800,wndr3800,WNDR3700,ttyS0,1152 $(eval $(call SingleProfile,Netgear,64kraw,WNDRMAC,wndrmac,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMAC,"",-H 29763654+16+64)) $(eval $(call SingleProfile,Netgear,64kraw,WNDRMACV2,wndrmacv2,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMACv2,"",-H 29763654+16+128)) -$(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),3703,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2pOM2P)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600MR600)) @@ -1004,6 +1002,11 @@ $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES))) $(eval $(call MultiProfile,Madwifi,EAP7660D UBNTRS UBNTRSPRO UBNTLSSR71 WP543)) endif # ifeq ($(SUBTARGET),generic) +ifeq ($(SUBTARGET),nand) +$(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),3703,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3)) +endif # ifeq ($(SUBTARGET),nand) + + $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES))) define Image/Build/squashfs diff --git a/target/linux/ar71xx/image/ubinize.cfg b/target/linux/ar71xx/image/ubinize.cfg new file mode 100644 index 000..04f300c --- /dev/null +++ b/target/linux/ar71xx/image/ubinize.cfg @@ -0,0 +1,14 @@ +[rootfs] +# Volume mode (other option is static) +mode=ubi +# Source image +image=root.squashfs +# Volume ID in UBI image +vol_id=0 +# Allow for dynamic resize +vol_type=dynamic +# Volume name +vol_name=rootfs +# Autoresize volume at first mount +# vol_flags=autoresize + diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default new file mode 100644 index 000..8da7048 --- /dev/null +++ b/target/linux/ar71xx/nand/config-default @@ -0,0 +1,119 @@ +# CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_MACH_ALFA_AP96 is not set +# CONFIG_ATH79_MACH_ALFA_NX is not set +# CONFIG_ATH79_MACH_ALL0258N is not set +# CONFIG_ATH79_MACH_ALL0315N is not set +# CONFIG_ATH79_MACH_AP113 is not set +# CONFIG_ATH79_MACH_AP121 is not set +# CONFIG_ATH79_MACH_AP132 is not set +# CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP81 is not set +# CONFIG_ATH79_MACH_AP83 is not set +# CONFIG_ATH79_MACH_AP96 is not set +# CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_CAP4200AG is not set +# CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_DB120 is not set +# CONFIG_ATH79_MACH_DIR_505_A1 is not set +# CONFIG_ATH79_MACH_DIR_600_A1 is not set +# CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_825_B1 is not set +# CONFIG_ATH79_MACH_DIR_825_C1 is not set +# CONFIG_ATH79_MACH_EAP7660D is not set +# CONFIG_ATH79_MACH_EW_DORIN is not set +# CONFIG_ATH79_MACH_HORNET_UB is not set +# CONFIG_ATH79_MACH_JA76PF is not set +# CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_MR600 is not set +# CONFIG_ATH79_MACH_MYNET_N600 is not set +# CONFIG_ATH79_MACH_MZK_W04NU is not set +# CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_NBG460N is not set +# CONFIG_ATH79_MACH_OM2P is not set +# CONFIG_ATH79_MACH_PB42 is not set +# CONFIG_ATH79_MACH_PB44 is not set +# CONFIG_ATH79_MACH_PB92 is not set +# CONFIG_ATH79_MACH_RB2011 is not set +# CONFIG_ATH79_MACH_RB4XX is not set +# CONFIG_ATH79_MACH_RB750 is not set +# CONFIG_ATH79_MACH_RB95X is not set
[OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi, This replaces my patch sent in September. I rebased the changes to master as of today. Also I altered the functionality; The image now uses squashfs and JFFS2 on UBI (using GLUEBI) in order to provide proper NAND support. Its not the final solution, but works right now out of the box regarding user space utilites. Would be nice to see this initial support upstream. By creating a file system manually I tested using UBIFS instead of JFFS2 as the overlaying file system, it seems to work. However, userspace utilities (ubox) need to be altered in order to support this properly. Gabor, I also noticed that the WAN port on this device does not work yet. I looked into the code, the platform code only registers one ethernet device right now. Do you know whats missing there to make WAN working? -- Stefan Stefan Agner (2): ar71xx: Add new subtarget nand for WNDR4300 ar71xx: Generate UBI image for WNDR4300 target/linux/ar71xx/Makefile | 2 +- target/linux/ar71xx/image/Makefile | 97 -- target/linux/ar71xx/image/ubinize.cfg| 29 +++ target/linux/ar71xx/nand/config-default | 119 +++ target/linux/ar71xx/nand/profiles/netgear.mk | 22 + target/linux/ar71xx/nand/target.mk | 8 ++ 6 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize.cfg create mode 100644 target/linux/ar71xx/nand/config-default create mode 100644 target/linux/ar71xx/nand/profiles/netgear.mk create mode 100644 target/linux/ar71xx/nand/target.mk -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/5] ar71xx: Empty whole rootfs partition on WNDR4300
UBIFS needs the whole partition to be empty upon first mounting. Since the bootloader only flashes the used amount of the UBI image, this patch padds the image with 0xff. Signed-off-by: Stefan Agner --- target/linux/ar71xx/image/Makefile | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index f9912f0..33e620d 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -720,14 +720,19 @@ endef # $7: # $8: DNI Hardware version define Image/Build/NetgearNAND - # Append UBI image to rootfs and generate DNI image - ( \ - cat vmlinux-$(2).uImage.fakehdrforubi; \ - cat $(KDIR)/root.ubi \ - ) > $(call imgname,ubifs,$(2))-uboot.img + $(eval firmwaresize=$(call mtdpartsize,firmware,$(4))) + $(eval kernelsize=$(call mtdpartsize,kernel,$(4))) + $(eval imageraw=$(call imgname,ubifs,$(2))-raw.img) + # Create firmware image full of 0xff to use the UBIFS auto-resize function + firmwareblocks=(($(firmwaresize) / 131072)); \ + dd if=/dev/zero bs=128k count={firmwareblocks} conv=sync | tr '\000' '\377' > $(imageraw) + # Insert Kernel and UBI image to rootfs and generate DNI image + dd if=vmlinux-$(2).uImage.fakehdrforubi of=$(imageraw) conv=notrunc + kernelblocks=(($(kernelsize) / 131072)); \ + dd if=$(KDIR)/root.ubi of=$(imageraw) bs=128k seek={kernelblocks} conv=notrunc $(STAGING_DIR_HOST)/bin/mkdniimg \ -B $(6) -v OpenWrt.$(REVISION) -r "r" $(8) \ - -i $(call imgname,ubifs,$(2))-uboot.img \ + -i $(imageraw) \ -o $(call imgname,ubifs,$(2))-factory.img endef -- 1.8.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/5] ar71xx: factory image generation for WNDR4300
Add factory image generation using UBI/UBIFS. The rootfile is mounted rw, no overlay support yet. Just in front of the rootfs (still on the kernel partition), a fake header needs to be in place to make stock U-Boot happy. This fake header tells the system rootfs is 4 bytes long. The first for bytes of the rootfs is an UBI magic (ASCII UBI#). Signed-off-by: Stefan Agner --- target/linux/ar71xx/image/Makefile | 64 +++-- target/linux/ar71xx/nand/config-default | 2 +- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index ea97a29..f9912f0 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -710,7 +710,67 @@ define Image/Build/Netgear/initramfs $(5) endef -Image/Build/NetgearNAND/initramfs=$(call Image/Build/Netgear/initramfs,$(1),$(2),$(3),$(4),$(5)) + +# $1: squashfs-64k +# $2: Board name (small caps) +# $3: Kernel board specific cmdline +# $4: Kernel mtdparts definition +# $5: U-Boot magic +# $6: Board name (upper caps) +# $7: +# $8: DNI Hardware version +define Image/Build/NetgearNAND + # Append UBI image to rootfs and generate DNI image + ( \ + cat vmlinux-$(2).uImage.fakehdrforubi; \ + cat $(KDIR)/root.ubi \ + ) > $(call imgname,ubifs,$(2))-uboot.img + $(STAGING_DIR_HOST)/bin/mkdniimg \ + -B $(6) -v OpenWrt.$(REVISION) -r "r" $(8) \ + -i $(call imgname,ubifs,$(2))-uboot.img \ + -o $(call imgname,ubifs,$(2))-factory.img +endef + +# $1: (empty?) +# $2: Board name (small caps) +# $3: Kernel board specific cmdline +# $4: Kernel mtdparts definition +# $5: U-Boot magic +define Image/Build/NetgearNAND/buildkernel + $(eval kernelsize=$(call mtdpartsize,kernel,$(4))) + echo == NetgearNAND buildkernel == + $(call MkuImageLzma,$(2),$(3) $(4),-d20) + -rm -rf $(KDIR_TMP)/$(2) + mkdir -p $(KDIR_TMP)/$(2)/image + $(STAGING_DIR_HOST)/bin/wndr3700 \ + $(KDIR_TMP)/vmlinux-$(2).uImage \ + $(KDIR_TMP)/vmlinux-$(2).uImage.tmp \ + $(5) + # Create fake header using UBI EC Header magic (UBI_EC_HDR_MAGIC) + echo -n "UBI#" > $(KDIR_TMP)/ubihdr + mkimage -A mips -O linux -T filesystem -C none \ + -a 0xbf07 -e 0xbf07 \ + -n 'MIPS OpenWrt rootfs' \ + -d $(KDIR_TMP)/ubihdr \ + $(KDIR_TMP)/ubihdr.uImage + $(STAGING_DIR_HOST)/bin/wndr3700 \ + $(KDIR_TMP)/ubihdr.uImage \ + $(KDIR_TMP)/ubihdr-$(2).uImage \ + $(5) + # Calculate size between kernel and header of root filesystem + # (this will be filled with zeros) + paddingsize=(($(kernelsize) - `stat -c%s $(KDIR_TMP)/vmlinux-$(2).uImage.tmp` - 64)); \ + ( \ + cat $(KDIR_TMP)/vmlinux-$(2).uImage.tmp; \ + dd if=/dev/zero bs=1 count={paddingsize}; \ + head -c 64 $(KDIR_TMP)/ubihdr-$(2).uImage \ + ) > vmlinux-$(2).uImage.fakehdrforubi +endef + + +define Image/Build/NetgearNAND/initramfs + $(call Image/Build/Netgear,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8)) +endef ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3)) @@ -866,7 +926,7 @@ $(eval $(call SingleProfile,Netgear,64kraw,WNDR3800,wndr3800,WNDR3700,ttyS0,1152 $(eval $(call SingleProfile,Netgear,64kraw,WNDRMAC,wndrmac,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMAC,"",-H 29763654+16+64)) $(eval $(call SingleProfile,Netgear,64kraw,WNDRMACV2,wndrmacv2,WNDR3700,ttyS0,115200,$$(wndr3700v2_mtdlayout),3701,WNDRMACv2,"",-H 29763654+16+128)) -$(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),3703,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3)) +$(eval $(call SingleProfile,NetgearNAND,128k,WNDR4300,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),3703,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2pOM2P)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600MR600)) diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 6b9170e..b1be7c9 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -1,7 +1,7 @@ CONFIG_ATH79_MACH_WNDR4300=y CONFIG_ATH79_DEV_NFC # CONFIG_ATH79_ROUTERBOOT is not set -CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd" +CONFIG_CMDLINE="ubi.mtd=8 root=ubi0:rootfs rootfstype=ubifs,squashfs noinitrd" CONFIG_JFFS2_FS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y -- 1.8.4 ___ openwrt-de
[OpenWrt-Devel] [PATCH 2/5] ar71xx: altered subtarget nand for UBI/UBIFS
Altered the subtarget nand, use UBI/UBIFS instead of YAFFS2. Added the first board WNDR4000 to the subtarget to generate an initramfs image with NAND/UBI/UBIFS support. Signed-off-by: Stefan Agner --- target/linux/ar71xx/nand/config-default | 53 - target/linux/ar71xx/nand/target.mk | 5 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index efa562c..6b9170e 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -1,34 +1,33 @@ -CONFIG_ATH79_MACH_RB2011=y -CONFIG_ATH79_MACH_RB4XX=y -CONFIG_ATH79_MACH_RB750=y -CONFIG_ATH79_MACH_RB95X=y -CONFIG_ATH79_ROUTERBOOT=y -CONFIG_CMDLINE="rootfstype=yaffs noinitrd" -# CONFIG_JFFS2_FS is not set -CONFIG_LEDS_RB750=y +CONFIG_ATH79_MACH_WNDR4300=y +CONFIG_ATH79_DEV_NFC +# CONFIG_ATH79_ROUTERBOOT is not set +CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd" +CONFIG_JFFS2_FS=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_XZ=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_GPIO=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_AR934X=y +CONFIG_MTD_NAND_AR934X_HW_ECC=y CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_NAND_RB4XX=y -CONFIG_MTD_NAND_RB750=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 # CONFIG_MTD_SM_COMMON is not set -# CONFIG_OVERLAYFS_FS is not set +CONFIG_OVERLAYFS_FS=y CONFIG_RLE_DECOMPRESS=y -CONFIG_SPI_RB4XX=y -CONFIG_SPI_RB4XX_CPLD=y -# CONFIG_SQUASHFS is not set -CONFIG_YAFFS_9BYTE_TAGS=y -CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y -CONFIG_YAFFS_AUTO_YAFFS2=y -# CONFIG_YAFFS_DISABLE_BACKGROUND is not set -# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set -# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set -# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set -# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set -CONFIG_YAFFS_FS=y -CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y -CONFIG_YAFFS_XATTR=y -CONFIG_YAFFS_YAFFS1=y -CONFIG_YAFFS_YAFFS2=y +CONFIG_SQUASHFS=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_XZ=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ar71xx/nand/target.mk b/target/linux/ar71xx/nand/target.mk index c571c50..a1617bf 100644 --- a/target/linux/ar71xx/nand/target.mk +++ b/target/linux/ar71xx/nand/target.mk @@ -1,8 +1,9 @@ -BOARDNAME:=Devices with NAND flash (mostly Mikrotik) +BOARDNAME:=Devices with NAND flash +FEATURES:=squashfs ubifs targz mips16 define Target/Description Build firmware images for Atheros AR71xx/AR913x based boards with - NAND flash, e.g. MikroTik RB-4xx or RB-750 + NAND flash and UBI/UBIFS, e.g. Netgear WNDR4300 endef -- 1.8.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/5] ar71xx: Added ubinize.cfg and UBI flags to image Makefile
In order to generate UBI root filesytems the ubinize.cfg needs to be in place. The Makefile provides working default parameters for WNDR4300 used by the UBI utilities. Signed-off-by: Stefan Agner --- target/linux/ar71xx/image/Makefile| 3 +++ target/linux/ar71xx/image/ubinize.cfg | 14 ++ 2 files changed, 17 insertions(+) create mode 100644 target/linux/ar71xx/image/ubinize.cfg diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 1b276c5..ea97a29 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -9,6 +9,9 @@ include $(INCLUDE_DIR)/image.mk JFFS2_BLOCKSIZE = 64k 128k 256k +UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 +UBINIZE_OPTS = -m 2048 -p 128KiB + define imgname $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) endef diff --git a/target/linux/ar71xx/image/ubinize.cfg b/target/linux/ar71xx/image/ubinize.cfg new file mode 100644 index 000..49d55b9 --- /dev/null +++ b/target/linux/ar71xx/image/ubinize.cfg @@ -0,0 +1,14 @@ +[rootfs] +# Volume mode (other option is static) +mode=ubi +# Source image +image=root.ubifs +# Volume ID in UBI image +vol_id=0 +# Allow for dynamic resize +vol_type=dynamic +# Volume name +vol_name=rootfs +# Autoresize volume at first mount +vol_flags=autoresize + -- 1.8.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/5] ar71xx: create new subtarget nand-yaffs2
This target will be used for Mikrotik devices using YAFFS2 flash. The subtarget nand will support NAND devices on UBI/UBIFS. Signed-off-by: Stefan Agner --- target/linux/ar71xx/Makefile | 6 +--- target/linux/ar71xx/nand-yaffs2/config-default | 34 ++ .../ar71xx/nand-yaffs2/profiles/01-minimal.mk | 16 ++ .../linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk | 16 ++ target/linux/ar71xx/nand-yaffs2/target.mk | 8 + 5 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 target/linux/ar71xx/nand-yaffs2/config-default create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/target.mk diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index cabcf04..120328a 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -11,7 +11,7 @@ BOARD:=ar71xx BOARDNAME:=Atheros AR7xxx/AR9xxx FEATURES:=squashfs targz mips16 CPU_TYPE=34kc -SUBTARGETS:=generic nand +SUBTARGETS:=generic nand nand-yaffs2 LINUX_VERSION:=3.10.13 @@ -22,8 +22,4 @@ DEFAULT_PACKAGES += \ kmod-ledtrig-default-on kmod-ledtrig-timer kmod-ledtrig-netdev \ kmod-ath9k wpad-mini uboot-envtools -define Target/Description - Build firmware images for Atheros AR7xxx/AR9xxx based boards. -endef - $(eval $(call BuildTarget)) diff --git a/target/linux/ar71xx/nand-yaffs2/config-default b/target/linux/ar71xx/nand-yaffs2/config-default new file mode 100644 index 000..efa562c --- /dev/null +++ b/target/linux/ar71xx/nand-yaffs2/config-default @@ -0,0 +1,34 @@ +CONFIG_ATH79_MACH_RB2011=y +CONFIG_ATH79_MACH_RB4XX=y +CONFIG_ATH79_MACH_RB750=y +CONFIG_ATH79_MACH_RB95X=y +CONFIG_ATH79_ROUTERBOOT=y +CONFIG_CMDLINE="rootfstype=yaffs noinitrd" +# CONFIG_JFFS2_FS is not set +CONFIG_LEDS_RB750=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_GPIO=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_AR934X=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_RB4XX=y +CONFIG_MTD_NAND_RB750=y +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_OVERLAYFS_FS is not set +CONFIG_RLE_DECOMPRESS=y +CONFIG_SPI_RB4XX=y +CONFIG_SPI_RB4XX_CPLD=y +# CONFIG_SQUASHFS is not set +CONFIG_YAFFS_9BYTE_TAGS=y +CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED=y +CONFIG_YAFFS_AUTO_YAFFS2=y +# CONFIG_YAFFS_DISABLE_BACKGROUND is not set +# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set +# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set +# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set +# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set +CONFIG_YAFFS_FS=y +CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y +CONFIG_YAFFS_XATTR=y +CONFIG_YAFFS_YAFFS1=y +CONFIG_YAFFS_YAFFS2=y diff --git a/target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk b/target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk new file mode 100644 index 000..3651c88 --- /dev/null +++ b/target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/DefaultNoWifi + NAME:=Default Profile (no WiFi) + PACKAGES:= +endef + +define Profile/DefaultNoWifi/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,DefaultNoWifi)) diff --git a/target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk b/target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk new file mode 100644 index 000..a291ff6 --- /dev/null +++ b/target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk @@ -0,0 +1,16 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Ath5k + NAME:=Atheros WiFi (ath5k) + PACKAGES:=kmod-ath5k -kmod-ath9k +endef + +define Profile/Ath5k/Description + Package set compatible with hardware using Atheros WiFi cards. +endef +$(eval $(call Profile,Ath5k)) diff --git a/target/linux/ar71xx/nand-yaffs2/target.mk b/target/linux/ar71xx/nand-yaffs2/target.mk new file mode 100644 index 000..756c9d0 --- /dev/null +++ b/target/linux/ar71xx/nand-yaffs2/target.mk @@ -0,0 +1,8 @@ +BOARDNAME:=Devices with NAND flash using YAFFS2 + +define Target/Description + Build firmware images for Atheros AR71xx/AR913x based boards with + NAND flash and YAFFS2 filesystem, e.g. MikroTik RB-4xx or RB-750 +endef + + -- 1.8.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/5] Initial WNDR4300 support with UBIFS
Hi, Using this patch one can build an factory image "openwrt-ar71xx-nand-wndr4300-ubifs-factory.img" for WNDR4300 which is 25MiB in size (exactly the firmware partition size). The image contains only one UBIFS filesystem, so there is no recovery possible currently. Its implemented in the nand subtarget, the old nand subtarget was renamed to nand-yaffs2. I published a branch on Github as well: https://github.com/falstaff84/openwrt Since UBIFS needs a clean NAND, the image consist mostly of 0xff. U-Boot doesn't clean the whole firmware partition by itself, so its done by using a "full sized" image. I tried using two UBIFS, overlaying each other (one read-only mounted, the other read-write). Some test showed that it worked, but the rootfs needs a lot more space than a squashfs filesystem. UBIFS has a weaker compressing algorithm and needs space for its journal. Here is where I ask myself what the goal is, which way should OpenWRT's NAND/UBI support take...? If we want to fit the image in those 25MiB Netgear uses, squashfs looks like the way to go: A squashfs ontop of UBI. Gluebi is probably most appropriate at the moment since its already supported in the kernel. Then create a script/program which creates a second UBI volume and the rootfs_data filesystem using UBIFS. On the other hand, this router has a lot of free space (96MiB) at the end (partition is called "reserved", maybe we should just use this. Since 25MiB for rootfs would be enough even with UBI, a UBI only solution would work too. To provide easy factory reset, the startscript just have to explicitly mount the rootfs ("rom") ro However, U-Boot can only write those 25MiB Netgear uses. So the image has to be below that line in any case (actual usable size is a lot smaller)... My preferred solution: Use the "reserved" partition as rootfs_data: Rename that partition in the mtdpart list. Create a script which creates a new UBI partition, create a volume and a UBIFS on it. (a second volume is needed since the partition "caldata_backup" is in between). The rootfs could be UBIFS ro or squashfs on UBI. Comments welcome :-) See also http://wiki.openwrt.org/toh/netgear/wndr4300 -- Stefan Stefan Agner (5): ar71xx: create new subtarget nand-yaffs2 ar71xx: altered subtarget nand for UBI/UBIFS ar71xx: Added ubinize.cfg and UBI flags to image Makefile ar71xx: factory image generation for WNDR4300 ar71xx: Empty whole rootfs partition on WNDR4300 target/linux/ar71xx/Makefile | 6 +- target/linux/ar71xx/image/Makefile | 72 +- target/linux/ar71xx/image/ubinize.cfg | 14 + target/linux/ar71xx/nand-yaffs2/config-default | 34 ++ .../ar71xx/nand-yaffs2/profiles/01-minimal.mk | 16 + .../linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk | 16 + target/linux/ar71xx/nand-yaffs2/target.mk | 8 +++ target/linux/ar71xx/nand/config-default| 53 target/linux/ar71xx/nand/target.mk | 5 +- 9 files changed, 188 insertions(+), 36 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize.cfg create mode 100644 target/linux/ar71xx/nand-yaffs2/config-default create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/01-minimal.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/profiles/02-ath5k.mk create mode 100644 target/linux/ar71xx/nand-yaffs2/target.mk -- 1.8.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
Am 2013-09-27 13:25, schrieb Gabor Juhos: > 2013.09.25. 11:26 keltezéssel, Gabor Juhos írta: >> Hm, this is a NULL pointer dereference. It seems that the >> nand_write_subpage_hwecc function tries to run a callback which is not >> initialized by the ar934x-nfc driver. I will look into that later. > > FYI, I have disabled writing of subpages in the driver. It is not supported by > the controller if hardware ECC is used. At least I was not able to make it > work. > >> In the past, I have tested the ar934x-nfc driver (w/o hw ECC) with the >> modules >> provided by the mtdtests package and it passed all tests. Ideally, it should >> be >> tested again with hw ECC support but that is quite dangerous on devices which >> are using a NAND flash only. > > It passes all MTD tests now. Tested on the first MB of the reserved area on a > on > the WNDR4300: Great thanks! Using this patch I could successfully boot a kernel with a UBI-image flashed by U-Boot! However, I try now to understand the boot process/flashing process of Netgears U-Boot and OpenWRT itself. I try to understand the image/Makefile. On WNDR4300 I do understand the normal process: Netgear checks the kernel header and the rootfs header (which are altered versions of the default U-Boot (special magic)). Then the kernel starts booting. I could use the same tool which is used for WNDR3700(v2) routers to replace the header (the wndr3700 utility). Now I try to understand how the upgrade mechanism works. This is what I see when reading WNDR4300 U-Boot code (mainly the magic happens in StartTftpServerToRecoveFirmware): When in "Factory Reset Mode", a TFTP server is running. After the user downloaded a file, the system checks the DNI header. Next data after the DNI header is flashed to a fixed address (length to be written is taken from file size according to TFTP): #define CFG_IMAGE_BASE_ADDR0x6c #define CFG_IMAGE_LEN 0x194 Bad blocks are simply ignored (data is written to next block). U-Boot doesnt clean the whole device, only the length of the image will be cleaned! If data fits not in available space, or too many blocks had to be skipped, U-Boot stops flashing and prints an error. But theres no other handling, than that, so system would try to start despite that fact... printf("** FAIL !! too many bad blocks, no enough space for data.\n"); (This could be useful: UBI needs all blocks cleaned! We can create a image which is filled with 0xff. U-Boot would clean the whole NAND, and it would work even on devices with bad blocks) I try now to understand how image/Makefile works. So when the kernel is backed, put in a LZMA packed uImage. Then wndr3700 changes the magic. Now things are a bit confusing to me: It gets packet using mksquashfs-lzma, again mkimaged and then the headers are replaced again.. Why? And this whole image is used for the sysupgrade and factory reset image... Who is unpacking/flashing this? The original Netgear WNDR4300 image contains only DNI => uImage... Are things working differently for WNDR3700? How? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
Am 2013-09-24 19:09, schrieb Gabor Juhos: >> A dd command with conv=noerror leads to a image witch is 16KiB smaller >> than it should be. > > Don't use dd on NAND flashes. Use the nanddump utility from the mtd-utils > package instead. Ok I understand that /dev/mtdblock[x] is not the way to handle NAND, but reading should work anyway. By using nanddump I could successfully dump the images, although the ECC check corrected bitflips. I guess that when using this NAND through mtdblock, this leads to an I/O error (since its the exactly same place, 2880*512 = 0x00168000). root@OpenWrt:/tmp# dd if=/dev/mtdblock10 of=/tmp/gaga [ 1350.92] end_request: I/O error, dev mtdblock10, sector 2880 [ 1350.92] Buffer I/O error on device mtdblock10, logical block 360 [ 1351.00] end_request: I/O error, dev mtdblock10, sector 2880 [ 1351.00] Buffer I/O error on device mtdblock10, logical block 360 dd: /dev/mtdblock10: Input/output error root@OpenWrt:/tmp# nanddump /dev/mtd10 >/tmp/wndr4300-mtd10-nanddump.img --omito ob --bb=skipbad ECC failed: 0 ECC corrected: 48 Number of bad blocks: 0 Number of bbt blocks: 0 Block size 131072, page size 2048, OOB size 64 Dumping data starting at 0x and ending at 0x0190... ECC: 16 corrected bitflip(s) at offset 0x00168000 But this is not a showstopper than, since the driver seems to work correctly using the mtd interface. > Did you write/erase the any of the partitions by any chance? Hm, I think I played around mounting the jffs2 partition once.. this should be after the CRC checked squashfs, but maybe I used the wrong mtd. This would explain the error. I reflashed the image, since then it boots fine even after using nanddump etc. from initram Now I tried to create a UBI volume using the initramfs-Kernel. I get this kernel crash dump: # ubiattach -m 8 /dev/ubi_ctrl [ 3712.32] UBI: attaching mtd8 to ubi0 [ 3712.51] UBI: scanning is finished [ 3712.52] UBI: empty MTD device detected [ 3712.52] CPU 0 Unable to handle kernel paging request at virtual address , epc == , ra == 802094fc [ 3712.53] Oops[#1]: [ 3712.53] CPU: 0 PID: 1216 Comm: ubiattach Not tainted 3.10.12 #10 [ 3712.53] task: 878b5d50 ti: 8654c000 task.ti: 8654c000 [ 3712.53] $ 0 : 0001 8037c810 [ 3712.53] $ 4 : 87826010 0001 01ff 0200 [ 3712.53] $ 8 : 0005 80064830 [ 3712.53] $12 : d8197822 [ 3712.53] $16 : 878261b8 87826010 86e34000 [ 3712.53] $20 : 0200 86e34500 86e34d00 0007 [ 3712.53] $24 : [ 3712.53] $28 : 8654c000 8654dae8 802094fc [ 3712.53] Hi: [ 3712.53] Lo: 0010 [ 3712.53] epc : (null) [ 3712.53] Not tainted [ 3712.53] ra: 802094fc nand_write_subpage_hwecc+0xa0/0x1c4 [ 3712.53] Status: 1100dc03 KERNEL EXL IE [ 3712.53] Cause : 0088 [ 3712.53] BadVA : [ 3712.53] PrId : 0001974c (MIPS 74Kc) [ 3712.53] Modules linked in: ath9k ath9k_common pppoe ppp_async iptable_nat ath9k_hw ath pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ip_tables crc_ccitt compat ledtrig_usbdev ledtrig_netdev ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher usb_storage leds_gpio ohci_hcd ledtrig_timer ledtrig_default_on ehci_platform ehci_hcd sd_mod scsi_mod gpio_button_hotplug ext4 jbd2 mbcache usbcore nls_base usb_common crc32c crypto_hash [ 3712.53] Process ubiattach (pid: 1216, threadinfo=8654c000, task=878b5d50, tls=77b24440) [ 3712.53] Stack : 1040 80099d00 0004 0010 8037c810 878261b8 87826010 0200 86e34500 0001 0fc0 0fc0 802093ac 878261b8 80208f98 878261b8 86e34500 878261b8 878261b8 8654dc00 87826010 0200 0200 0fc0 80209d18 8794e600 8654dc08 86e34500 ... [ 3712.53] Call Trace: [ 3712.53] [<80099d00>] __wake_up+0x24/0x44 [ 3712.53] [<802093ac>] nand_write_page+0xc0/0x170 [ 3712.53] [<80208f98>] nand_release_device+0x30/0x3c [ 3712.53] [<80209d18>] nand_do_write_ops+0x308/0x3c4 [ 3712.53] [<801fb0d0>] part_erase+0x22c/0x2c8 [ 3712.53] [<80209f28>] nand_write+0x5c/0x94 [ 3712.53] [<8021ae34>] ubi_io_write+0x350/0x618 [ 3712.53] [<8020048c>] erase_callback+0x0/0x14 [ 3712.53] [<8021b2ec>] ubi_io_write_
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
Am 2013-09-23 21:08, schrieb Gabor Juhos: > It should be possible to fix the board via JTAG. At least it seems that the > PCB > has an unpopulated JTAG header. Yes I thought about this too, but since I didn't found an openocd configuration which should work with this SoC, I didn't even tried it. I guess I would download U-Boot to RAM and try to reflash U-Boot from there, right? Do you have a working JTAG toolchain for this SoC? Today I tested the driver. After adding the relevant Kernel configuration (CONFIG_MTD_NAND_AR934X_HW_ECC) I could successfully read from the device, data look good. However, when I tried to dd the whole kernel I get some errors: # dd if=/dev/mtdblock7 of=/tmp/wndr4300-mtd7-kernel.img [ 325.31] end_request: I/O error, dev mtdblock7, sector 424 [ 325.31] Buffer I/O error on device mtdblock7, logical block 53 [ 325.34] end_request: I/O error, dev mtdblock7, sector 536 [ 325.34] Buffer I/O error on device mtdblock7, logical block 67 [ 325.38] end_request: I/O error, dev mtdblock7, sector 424 [ 325.38] Buffer I/O error on device mtdblock7, logical block 53 dd: /dev/mtdblock7: Input/output error My first guess was this is/are bad blocks. But U-Boot seems not to support this idea: ar7240> nand bad Device 0 bad blocks: ar7240> Maybe U-Boot's bad block management doesn't work with those information... A dd command with conv=noerror leads to a image witch is 16KiB smaller than it should be. After working only with initramfs, the default Firmware doesn't boot anymore: ** check rootfs image ** Verifying Checksum ...Bad Data CRC This CRC checks the rootfs. Netgear put another uImage header just before the rootfs partition (but still in the kernel partition). It looks like the Kernel already changed something on NAND, which causes this Bad Data CRC... I then flashed the latest Netgear Firmware again. Guess what, I could successfully dd the whole kernel... But dd the rootfs still has Buffer I/O errors. Any idea what could go wrong here? I think it would be a good idea to figure out whats wrong before doing further steps... -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
Am 2013-09-17 08:18, schrieb Gabor Juhos: > 2013.09.16. 1:06 keltezéssel, Stefan Agner írta: > It is done in software in the ar934x-nfc driver. The NAND controller of the > AR934x SoCs also supports hardware based ECC calculation but that is not yet > implemented in the driver. The hardware based ECC might use a different OOB > layout and that would cause similar problems if thas is enabled in the > bootloader. I checked that in the original firmware, they definitly use hardware NAND, in both, the Kernel and Bootloader (actually its the same driver). > I guess that it would be easy to figure out if the bootloader uses a different > OOB layout or not. I saw your commits 38069-38071, did you test them on a actual device? I erased my U-Boot when I used nand erase clean, somehow my command line got parsed wrong :-( I'll try to get a new device and test your changes. > The kernel automatically sets the "rootfs" partition to be the root filesystem > if the 'CONFIG_MTD_ROOTFS_ROOT_DEV' option is set. Thanks, this was a missing piece in my mind :-) I split those targets, will send a patch as soon as I've got something useful. - Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
Hi Gabor, [resend, forgot mailing list in to list] > In the early reference driver of the NAND controller, the data from the DMA > has > been swapped. On later reference drivers, this swapping has been removed. To > match with the reference driver, the current ar934x-nfc driver does not swaps > the data by default. If U-Boot on the WNDR4300 swaps the data then that can > cause ECC errors in all NAND pages. If that is the problem, swapping must be > enabled in the ar934x-nfc driver as well by an 'ath79_nfc_set_swap_dma(true)' > call before ath79_register_nfc(). See the mach-rb2011.c file [1] for example. I enabled this swapping, but without luck. Still can't mount filesystems flashed using U-boot. I guess that Netgears driver somehow uses the EC header differently (is this done in software?) Currently, I need to boot initramfs to flash/create root filesystems. But this has also advantages, since I can use all those UBI utilities... > UBI/squahsfs should be working, at least it has been tested by Free Electrons > [2] on older kernels. In my opinion, it makes no sense to use JFFS2 on an UBI > volume. That would complicate things with no good reason. For JFFS2, two > immediate layers are needed in order to make it work on UBI volumes whereas > UBIFS can work directly on that. Agree > IMHO, the optimal solution would be the following: > > Add direct support to squashfs in order to be able to use that on top of plain > UBI volumes. Create two UBI volumes and use squashfs on the first and UBIFS on > the second volume. This would be much cleaner solution than the > 'ubi->gluebi->mtdblock->squashfs' combination. I'm going to try squashfs on UBI. I see that Free Electrons refers with squashfs-ubiblk to that combination. As far as I can see, it should be easy as referring to the UBI volume as root device (e.g. /dev/ubiblk0_0). >> One other thing which bothers me: U-Boot checks the rootfs CRC. If these >> FS are on the same UBI volume, doesn't get NAND pages of the whole MTD >> changed (wear leveling?) > > No AFAIK. The UBI layer only uses the erase sectors of a given UBI volume for > wear leveling. Hm, but this would still change CRC, wouldn't it? >> The kernel command line is fixed in U-Boot, so we would have to generate >> an image with fixed (e.g. CONFIG_CMDLINE_OVERRIDE=y) cmdline. Any other >> idea? Is this the first Netgear target which encounters this problem? > > We are using the patch-cmdline tool to inject a board specific command line > into > the kernel for almost all boards [4]. Ok ic. As far as I see theres no "root=" configuration injected. Does the kernel has some hard coded defaults? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] SoC NAND driver ar934x/OpenWRT support on WNDR4300
In between I found out that the driver works fine if I erase/write the NAND first using the driver itself. But when I try to flash something using the stock U-Boot bootloader, the driver still complains as outlined in my first message. Right now I have a running kernel and root filesystem generated using git master. I generated these files by altering the ar71xx generic subtarget (included UBIFS, NAND driver etc.) I then flashed the kernel using stock U-Boot. To flash the root fs I used the already working initramfs and generated the UBI volume by hand, then used ubiupdatevol to write the generated *.ubifs image. Due to manual flashing, the default boot commands don't work since magics and CRCs are wrong. Beside that, there is no overlay right now, I have a read/writeable root fs. My goal is to generate a easily flashable (TFTP recovery or whatever) image for this router. Since I'm new to OpenWRT development I might be wrong with all this, so please help me/correct me... When the image is written by U-Boot, the rootfs won't be readable by the ar934x kernel driver (my initial problem). Any idea how to work around this? As far as I can see, there is only xburst which _use_ UBIFS right now. The ar71xx/nand target use YAFFS2 (at least this is what the kernel has included). The question is, should I include UBIFS to the NAND subtarget and transfer this device to this subtarget? Or should I create a new target (so there would be three generic => squashfs/jffs2, nand => YAFFS2, ubi => ubi/ubifs). Which is the NAND fs combination for OpenWRT in future anyway? I see following combinations (rootfs/rootfs_data): - UBI/squashfs, UBI/JFFS2 (using gluebi, stacking of FS, are these tested and working combinations? Too complicated?) - UBI/UBIFS(ro), UBI/UBIFS (I read that UBIFS doesnt allow to be a overlayfs since it lacks whiteout feature.. Is this true?) One other thing which bothers me: U-Boot checks the rootfs CRC. If these FS are on the same UBI volume, doesn't get NAND pages of the whole MTD changed (wear leveling?) The kernel command line is fixed in U-Boot, so we would have to generate an image with fixed (e.g. CONFIG_CMDLINE_OVERRIDE=y) cmdline. Any other idea? Is this the first Netgear target which encounters this problem? Or maybe go straight forward and just wipe the whole device, flash a U-Boot without integrity checks, use the whole NAND... (would be a one way thing... is there a solution where user can do this without opening the device..) Any thoughts? Thanks -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] SoC NAND driver ar934x on WNDR4300
Hi, This weekend I compiled OpenWRT for my WNDR4300. As stated in the documentation, only initramfs works currently so I hooked up serial port and ran the image using U-Boot/TFTP. I created an image with the SoC NAND driver from Jonus in order to boot an image from NAND flash, but I get errors while booting: [ 23.42] __nand_correct_data: uncorrectable ECC error__nand_correct_data: uncorrectable ECC error I enabled debuging output in the ar934x-nfc driver: [3.72] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xf1 (Micron NAND 128MiB 3,3V 8-bit), 128MiB, page size: 2048, OOB size: 64 [3.73] ar934x-nfc ar934x-nfc: buf:a795 size:2112 [3.73] Scanning device for bad blocks [ 49.75] ar934x-nfc ar934x-nfc: read, column=2048 page=65472 len=64 [ 49.76] ar934x-nfc ar934x-nfc: read a0:ffc00800 a1: len:40 cmd:0030006a dma:00cc ctrl:00080b54 [ 49.77] ar934x-nfc ar934x-nfc: got IRQ, status:0010 [ 49.77] ar934x-nfc ar934x-nfc: read, column=2048 page=65473 len=64 [ 49.78] ar934x-nfc ar934x-nfc: read a0:ffc10800 a1: len:40 cmd:0030006a dma:00cc ctrl:00080b54 [ 49.79] ar934x-nfc ar934x-nfc: got IRQ, status:0010 [ 49.80] 12 cmdlinepart partitions found on MTD device ar934x-nfc [ 49.80] Creating 12 MTD partitions on "ar934x-nfc": [ 49.81] 0x-0x0004 : "u-boot" [ 49.82] 0x0004-0x0008 : "u-boot-env" [ 49.82] 0x0008-0x000c : "caldata" [ 49.83] 0x000c-0x0014 : "pot" [ 49.83] 0x0014-0x0034 : "language" [ 49.84] 0x0034-0x003c : "config" [ 49.85] 0x003c-0x006c : "traffic_meter" [ 49.86] 0x006c-0x007e : "kernel" [ 49.86] 0x007e-0x01fc : "rootfs" [ 49.87] mtd: partition "rootfs" set to be root filesystem [ 49.87] ar934x-nfc ar934x-nfc: read, column=0 page=4032 len=2112 [ 49.88] ar934x-nfc ar934x-nfc: read a0:0fc0 a1: len:840 cmd:0030006a dma:00cc ctrl:00080b54 [ 49.89] ar934x-nfc ar934x-nfc: got IRQ, status:0010 [ 49.90] ar934x-nfc ar934x-nfc: read, column=0 page=4032 len=2112 [ 49.90] ar934x-nfc ar934x-nfc: read a0:0fc0 a1: len:840 cmd:0030006a dma:00cc ctrl:00080b54 [ 49.91] ar934x-nfc ar934x-nfc: got IRQ, status:0010 [ 49.92] __nand_correct_data: uncorrectable ECC error [ 49.92] split_squashfs: error occured while reading from "ar934x-nfc" [ 49.93] 0x006c-0x01fc : "firmware" [ 49.94] 0x01fc-0x0200 : "caldata_backup" [ 49.95] 0x0200-0x0800 : "reserved" Later, I get lots of these "__nand_correct_data: uncorrectable ECC error" messages. To me it looks like the length is the problem since the shorter reads doens't suffer this problem... Any idea? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Create PID file for xinetd
Create a pid file by default when starting xinetd (resolves #10342). Signed-off-by: Stefan Agner Index: net/xinetd/files/xinetd.init === --- net/xinetd/files/xinetd.init (Revision 28720) +++ net/xinetd/files/xinetd.init (Arbeitskopie) @@ -9,7 +9,7 @@ start() { [ -f $DEFAULT ] && . $DEFAULT [ -d $RUN_D ] || mkdir -p $RUN_D - xinetd $OPTIONS + xinetd -pidfile $PID_F $OPTIONS } stop() { ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Restart aiccu when wan reconnects
This changes propperly restarts aiccu when the wan interface is reconnected. This solves the reopened bug #7629. Signed-off-by: Stefan Agner Index: ipv6/aiccu/files/aiccu.hotplug === --- ipv6/aiccu/files/aiccu.hotplug (Revision 28386) +++ ipv6/aiccu/files/aiccu.hotplug (Arbeitskopie) @@ -1,2 +1,3 @@ #!/bin/sh -[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && /etc/init.d/aiccu enabled && /etc/init.d/aiccu start +[ "$ACTION" = "ifdown" ] && [ "$INTERFACE" = "wan" ] && /etc/init.d/aiccu enabled && /etc/init.d/aiccu stop +[ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ] && /etc/init.d/aiccu enabled && /etc/init.d/aiccu start ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel