Modify

Opened 8 years ago

Last modified 4 years ago

#7471 reopened enhancement

Initial support for jjPlus JWAP003

Reported by: cezary@… Owned by: juhosg
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: Cc:

Description

Patch included.

Flash procedure:

fis init
load -r -b 0x80060000 openwrt-ar71xx-generic-jwap003-kernel.bin
fis create linux.bin
load -r -b 0x80120000 openwrt-ar71xx-generic-jwap003-rootfs-
fis create rootfs
fis load -l linux.bin
exec

Attachments (2)

jwap003.patch (6.5 KB) - added by cezary@… 8 years ago.
jwap003-new1.patch (8.2 KB) - added by cezary@… 8 years ago.

Download all attachments as: .zip

Change History (17)

Changed 8 years ago by cezary@…

comment:1 Changed 8 years ago by juhosg

  • Component changed from packages to kernel
  • Owner changed from developers to juhosg
  • Status changed from new to accepted
  • Type changed from defect to enhancement
--- target/linux/ar71xx/base-files/etc/defconfig/jwap003/network	1970-01-01 01:00:00.000000000 +0100
+++ target/linux/ar71xx/base-files/etc/defconfig/jwap003/network	2010-06-14 20:47:44.000000000 +0200
@@ -0,0 +1,16 @@
+config 'interface' 'loopback'
+       option 'ifname'   'lo'
+       option 'proto'    'static'
+       option 'ipaddr'   '127.0.0.1'
+       option 'netmask'  '255.0.0.0'
+
+config 'interface' 'lan'
+        option 'ifname'   'eth1'
+        option 'type'     'bridge'
+        option 'proto'    'static'
+        option 'ipaddr'   '192.168.1.1'
+        option 'netmask'  '255.255.255.0'
+
+config 'interface' 'wan'
+        option 'ifname' 'eth0'
+        option 'proto' 'dhcp'
--- target/linux/ar71xx/base-files/lib/ar71xx.sh	2010-06-14 20:49:19.312014523 +0200
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh	2010-06-11 21:47:27.000000000 +0200
@@ -115,6 +115,9 @@
 	*WZR-HP-G300NH)
 		name="wzr-hp-g300nh"
 		;;
+	*JWAP003)
+		name="jwap003"
+		;;
 	*)
 		name="generic"
 		;;
--- target/linux/ar71xx/config-2.6.32	2010-06-14 20:49:17.836026256 +0200
+++ target/linux/ar71xx/config-2.6.32	2010-06-11 21:44:26.000000000 +0200
@@ -43,6 +43,7 @@
 CONFIG_AR71XX_MACH_WRT160NL=y
 CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_MACH_WZR_HP_G300NH=y
+CONFIG_AR71XX_MACH_JWAP003=y
 CONFIG_AR71XX_NVRAM=y
 CONFIG_AR71XX_WDT=y
 CONFIG_AR8216_PHY=y

Please keep these config symbols sorted alphabetically. And please add this symbol to the config-2.6.3[345] as well.

--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-jwap003.c	1970-01-01 01:00:00.000000000 +0100
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-jwap003.c	2010-06-14 20:18:44.000000000 +0200
@@ -0,0 +1,102 @@
+/*
+ *  jjPlus JWAP003 board support
+ *
+ *  Copyright (C) 2010 Cezary Jackiewicz <cezary@eko.one.pl>
+ *
+ *  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
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <asm/mach-ar71xx/ar71xx.h>
+//#include <linux/i2c.h>
+//#include <linux/i2c-gpio.h>

Remove these comments please.

+
+#include "machtype.h"
+#include "devices.h"
+#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-pb42-pci.h"
+#include "dev-usb.h"
+
+#define JWAP003_BUTTONS_POLL_INTERVAL	20
+
+#define JWAP003_GPIO_WPS	11
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition jwap003_partitions[] = {
+	{
+		.name		= "Redboot",
+		.offset		= 0,
+		.size		= 0x040000,
+		.mask_flags	= MTD_WRITEABLE,
+	} , {
+		.name		= "kernel",
+		.offset		= 0x040000,
+		.size		= 0x0e0000,
+	} , {
+		.name		= "rootfs",
+		.offset		= 0x120000,
+		.size		= 0x6c0000,
+	} , {
+		.name		= "FIS directory",
+		.offset		= 0x7e0000,
+		.size		= 0x00f000,
+		.mask_flags	= MTD_WRITEABLE,
+	} , {
+		.name		= "boardconfig",
+		.offset		= 0x7ef000,
+		.size		= 0x001000,
+		.mask_flags	= MTD_WRITEABLE,
+	}
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
+static struct flash_platform_data jwap003_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+	.parts		= jwap003_partitions,
+	.nr_parts	= ARRAY_SIZE(jwap003_partitions),
+#endif
+};

Why do you have to define the partition map? It should be provided by the generic redboot parser.

+
+static struct gpio_button jwap003_gpio_buttons[] __initdata = {
+	{
+		.desc		= "wps",
+		.type		= EV_KEY,
+		.code		= KEY_WPS_BUTTON,
+		.threshold	= 3,
+		.gpio		= JWAP003_GPIO_WPS,
+		.active_low	= 1,
+	}
+};
+
+static void __init jwap003_init(void)
+{
+	ar71xx_add_device_m25p80(NULL);
+
+	ar71xx_add_device_mdio(0x0);
+
+	ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+	ar71xx_eth0_data.speed = SPEED_100;
+	ar71xx_eth0_data.duplex = DUPLEX_FULL;
+	ar71xx_eth0_data.has_ar8216 = 1;
+
+	ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+	ar71xx_eth1_data.phy_mask = 0x10;
+
+	ar71xx_add_device_eth(0);
+	ar71xx_add_device_eth(1);
+
+	ar71xx_add_device_usb();
+
+	ar71xx_add_device_gpio_buttons(-1, JWAP003_BUTTONS_POLL_INTERVAL,
+				       ARRAY_SIZE(jwap003_gpio_buttons),
+				       jwap003_gpio_buttons);
+
+	pb42_pci_init();
+}
+
+MIPS_MACHINE(AR71XX_MACH_JWAP003, "JWAP003", "jjPlus JWAP003", jwap003_init);
--- target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h	2010-06-14 20:49:19.121024492 +0200
+++ target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h	2010-06-12 18:41:21.000000000 +0200
@@ -54,6 +54,7 @@
 	AR71XX_MACH_WRT160NL,	/* Linksys WRT160NL */
 	AR71XX_MACH_WRT400N,	/* Linksys WRT400N */
 	AR71XX_MACH_WZR_HP_G300NH, /* Buffalo WZR-HP-G300NH */
+	AR71XX_MACH_JWAP003,	/* JJPLUS JWAP003 */
 };
 
 #endif /* _AR71XX_MACHTYPE_H */
--- target/linux/ar71xx/files/arch/mips/ar71xx/Makefile	2010-06-14 20:49:19.117024631 +0200
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Makefile	2010-06-11 21:48:02.000000000 +0200
@@ -53,3 +53,4 @@
 obj-$(CONFIG_AR71XX_MACH_WRT160NL)	+= mach-wrt160nl.o
 obj-$(CONFIG_AR71XX_MACH_WRT400N)	+= mach-wrt400n.o
 obj-$(CONFIG_AR71XX_MACH_WZR_HP_G300NH)	+= mach-wzr-hp-g300nh.o
+obj-$(CONFIG_AR71XX_MACH_JWAP003)	+= mach-jwap003.o

These should be sorted as well.

--- target/linux/ar71xx/generic/profiles/jjplus.mk	1970-01-01 01:00:00.000000000 +0100
+++ target/linux/ar71xx/generic/profiles/jjplus.mk	2010-06-11 21:11:52.000000000 +0200
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/JWAP003
+	NAME:=jjPlus JWAP0003
+	PACKAGES:=wpad-mini kmod-ath9k kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+
+define Profile/JWAP003/Description
+	Package set optimized for the jjPlus JWAP003 board.
+endef
+
+$(eval $(call Profile,JWAP003))
--- target/linux/ar71xx/image/Makefile	2010-06-14 20:49:18.425004796 +0200
+++ target/linux/ar71xx/image/Makefile	2010-06-12 07:07:05.000000000 +0200
@@ -565,6 +565,10 @@
 	$(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG300NH,wzr-hp-g300nh,board=WZR-HP-G300NH)
 endef
 
+define Image/Build/Profile/JWAP003
+	$(call Image/Build/Template/$(fs_64k)/$(1),PB4X,jwap003,board=JWAP003)
+endef
+
 define Image/Build/Profile/Default
 	$(call Image/Build/Profile/AP81,$(1))
 	$(call Image/Build/Profile/AP83,$(1))
@@ -594,6 +598,7 @@
 	$(call Image/Build/Profile/WRT400N,$(1))
 	$(call Image/Build/Profile/WRT160NL,$(1))
 	$(call Image/Build/Profile/WZRHPG300NH,$(1))
+	$(call Image/Build/Profile/JWAP003,$(1))

Ditto.

 endef
 
 define Image/Build/Profile/Minimal

comment:2 Changed 8 years ago by jow

  • Status changed from accepted to assigned

comment:3 Changed 8 years ago by cezary@…

Ok, new version with fixes. Flash:

fis init
load -r -b 0x80060000 openwrt-ar71xx-generic-jwap003-kernel.bin
fis create linux.bin
load -r -b %{FREEMEMLO} openwrt-ar71xx-generic-jwap003-rootfs-squashfs.bin
fis create rootfs

Changed 8 years ago by cezary@…

comment:4 Changed 7 years ago by juhosg

  • Resolution set to fixed
  • Status changed from assigned to closed

Applied in r23165. Thanks!

comment:5 Changed 7 years ago by oc80z@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Just pulled JWAP003 kernel image, jffs2 and squashfs for the JJPLUS. I'll compile from trunk.

RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
RedBoot> load -r -b 0x80060000 openwrt-ar71xx-generic-jwap003-kernel.bin
Using default protocol (TFTP)
Raw file loaded 0x80060000-0x8013ffff, assumed entry at 0x80060000
RedBoot> fis create kernel
... Erase from 0xbf040000-0xbf120000: ..............
... Program from 0x80060000-0x80140000 at 0xbf040000: ..............
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
RedBoot> load -r -b %{FREEMEMLO} openwrt-ar71xx-generic-jwap003-rootfs-squashfs.bin
Using default protocol (TFTP)
Raw file loaded 0x80051400-0x801d13ff, assumed entry at 0x80051400
RedBoot> fis create rootfs
... Erase from 0xbf120000-0xbf2a0000: ........................
... Program from 0x80051400-0x801d1400 at 0xbf120000: ........................
... Erase from 0xbffe0000-0xbfff0000: .
... Program from 0x80ff0000-0x81000000 at 0xbffe0000: .
RedBoot> fis load kernel
RedBoot> fis load -l kernel
Image loaded from 0x80060000-0x802e7d14
RedBoot> exec -c "root=/dev/mtdblock0"
Now booting linux kernel:
 Base address 0x80050000 Entry 0x80060000
 Cmdline : root=/dev/mtdblock0
SoC: Atheros AR7130 rev 2
Clocks: CPU:300.000MHz, DDR:300.000MHz, AHB:150.000MHz, Ref:40.000MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line:  board=JWAP003 console=ttyS0,115200 ethaddr=00.15.61.90.0f.4c rootfstype=squashfs,jffs2 noinitrd
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00070032
Readback ErrCtl register=00070032
Memory: 29360k/32768k available (2036k kernel code, 3408k reserved, 381k data, 172k init, 0k highmem)
SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:80
Calibrating delay loop... 199.88 BogoMIPS (lpj=999424)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is jjPlus JWAP003
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
i2c-gpio i2c-gpio.0: using pins 1 (SDA) and 0 (SCL)
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: found w25q128, expected m25p80
m25p80 spi0.0: w25q128 (16384 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0xffe000
Searching for RedBoot partition table in spi0.0 at offset 0xfff000
No RedBoot partition table detected in spi0.0
spi0.0: no WRT160NL signature found
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth0: AR8216 switch driver attached.
eth1: Atheros AG71xx at 0xba000000, irq 5
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "(null)" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00           16384 mtdblock0  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)


comment:6 Changed 7 years ago by obsy

root=/dev/mtdblock0

Remove this from cmdline. Flash not detected.

comment:7 Changed 7 years ago by oc80z

I have tried many things, i am troubleshooting a trunk initramfs kernel build. I am suspicious of the following code which was commited not too long ago for initial support:

static struct mtd_partition jwap003_partitions[] = { 
 	31	        { 
 	32	                .name           = "Redboot", 
 	33	                .offset         = 0, 
 	34	                .size           = 0x040000, 
 	35	                .mask_flags     = MTD_WRITEABLE, 

I have tried many cmdline options, filesystems. Compressed and not compressed etc. I am also seeing lack of PCI support (SPI?) for Mini-PCI cards (tried bc43xx[fwcutter]) and other prism/atheros cards. Additionally, both ethernet ports are not found via lspci. Nothing is found with lspci. Kernel makemenuconfig shows SPI support is enabled. Will repost with any specifics on redboot partitioning because my current Redboot slice is "RedBoot" which I believe is not matching the case of OpenWRT's struct in the ar71xx/nand section of code. cheers.

comment:8 Changed 7 years ago by oc80z

I just noticed the patches (both jwap003.patch and jwap003-new.patch) were not applied since the last post. I've patches the files and am compiling a new kernel. a Big thanks for these patches.

comment:9 Changed 7 years ago by oc80z

To follow up, the board i was working on was physically modified for reasons not need further answered within this scope. I can say a typical JWAP003 is fully compatible with the above patches that are currently applied to trunk. Cheers!

comment:10 follow-ups: Changed 7 years ago by nbd

The issue is that the mtd device is detected with an erase size of 0x1000, whereas RedBoot operates on blocks with a size of 0x10000, so the kernel doesn't find the RedBoot partition table.

comment:11 in reply to: ↑ 10 Changed 7 years ago by anonymous

Replying to nbd:

The issue is that the mtd device is detected with an erase size of 0x1000, whereas RedBoot operates on blocks with a size of 0x10000, so the kernel doesn't find the RedBoot partition table.

The memory banks in the picture here: http://openrouter.info/images/Uzytkownikow/obsy/jwap003/7.JPG show 1 of 2 banks soldered to the pb42. This works OK and confirmed with trunk source-build and binary openwrt.

however, the first troubleshoot ticket i submitted was a board with 2 of 2 banks of memory installed. The entry/base-memory addresses must be different. Should I post up that info? Additionally, the JWAP003 profile is named JWAP0003 (typo) in build menuconfig.

I am investigating the POE on WAN ethernet at the moment. Not sure if both boards are programmed for POE-passive or other.. POE-WAN port will power-spike/draw the board to power-off.

comment:12 Changed 7 years ago by anonymous

Now it should by called ja73pf

comment:13 Changed 7 years ago by oc80z

yes the board is not JWAP0003. also, the error is causing issues. A 16MB Flash chip is on -this- board, not a ST 8MB Flash chip.

m25p80 spi0.0: found w25q128, expected m25p80
m25p80 spi0.0: w25q128 (16384 Kbytes)

comment:14 in reply to: ↑ 10 Changed 7 years ago by oc80z

Replying to nbd:

The issue is that the mtd device is detected with an erase size of 0x1000, whereas RedBoot operates on blocks with a size of 0x10000, so the kernel doesn't find the RedBoot partition table.

Do you know of any workarounds? I have been trying to get redboot.c to see the FIS Directory and march-jwap003.c MTD_PARTITIONS .name,.size etc.. but no luck. How come a brainslayer jwap003 build of dd-wrt can read the partitions? Yikes G.

comment:15 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as reopened .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.