OpenWrt Forum Archive

Topic: Questions Regarding Device Porting

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am now try my attempt to port a Lantiq device however I have some questions.

1) mtd partitions

The original firmware only comes with 2 partition uboot and rootfs.
Do I have to the original partition configuration or can I add my own partitions like uboot _env and rootfs_data?

2) LED GPIOs

How do I actually find out which LED is linked to which output?

Help please. Thank You

alphasparc wrote:

1) mtd partitions

The original firmware only comes with 2 partition uboot and rootfs.
Do I have to the original partition configuration or can I add my own partitions like uboot _env and rootfs_data?

You can use as many partition as you wish. You don't need to create rootfs_data manually, it will be automatically created.

alphasparc wrote:

2) LED GPIOs

How do I actually find out which LED is linked to which output?

Either by looking into the manufacturer's GPL sources, or by trial and error:

First

echo $GPIO >  /sys/class/gpio/export

When checking for led:

echo out > /sys/class/gpio$GPIO/direction
echo 0 > /sys/class/gpio$GPIO/value
echo 1 > /sys/class/gpio$GPIO/value

If it was connected to a led a led should have turned off or on when writing 1.

When checking for button gpios:

echo in > /sys/class/gpio$GPIO/direction
# don't press the button
cat /sys/class/gpio$GPIO/value
# now press the button
cat /sys/class/gpio$GPIO/value

If it was connected to a button, then the value should change between 0 and 1 when (de)pressing it.

Repeat as necessary.

Thanks

broadband_led 1 off 0 on
ledc_10 1 on 0 off
usbdev_led 1 on 0 off
internet_led 1 off 0 on
internet_red_led 1 on 0 off
power_led 0 red 1 green

Hi I compiled the image up but it cannot find the rootfs
What did I missed?

Bytes transferred = 3145732 (300004 hex)
AMAZON_S # bootm
## Booting image at 80800000 ...
   Image Name:   MIPS OpenWrt Linux-3.3.8
   Created:      2012-09-27  13:21:42 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    957194 Bytes = 934.8 kB
   Load Address: 80002000
   Entry Point:  80002000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80002000) ...
## Giving linux memsize in MB, 32

Starting kernel ...

[    0.000000] Linux version 3.3.8 (alphasparc@LAPTOP) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #3 Thu Sep 27 21:21:39 SGT 2012
[    0.000000] SoC: GR9 rev 1.2
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001954c (MIPS 34Kc)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00002000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00002000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: console=ttyLTQ1,115200 rootfstype=squashfs,jffs2 machtype=GR7000
[    0.000000] MIPS: no machine found for id 'GR7000', supported machines:
[    0.000000] id                       name
[    0.000000] Generic                  Generic Lantiq based board
[    0.000000] FRITZ7320                FRITZ!BOX 7320
[    0.000000] DGN3500B                 Netgear DGN3500B
[    0.000000] WBMR                     WBMR
[    0.000000] P2601HNFX                ZyXEL P-2601HN-Fx
[    0.000000] H201L                    ZTE ZXV10 H201L
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00000005
[    0.000000] Readback ErrCtl register=00000005
[    0.000000] Memory: 29412k/32768k available (2258k kernel code, 3356k reserved, 378k data, 168k init, 0k highmem)
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 333MHz
[    0.000000] Calibrating delay loop... 221.18 BogoMIPS (lpj=442368)
[    0.040000] pid_max: default: 32768 minimum: 301
[    0.044000] Mount-cache hash table entries: 512
[    0.052000] NET: Registered protocol family 16
[    0.060000] gpiochip_add: registered GPIOs 0 to 15 on device: ltq_gpio
[    0.064000] gpiochip_add: registered GPIOs 16 to 31 on device: ltq_gpio
[    0.068000] gpiochip_add: registered GPIOs 32 to 47 on device: ltq_gpio
[    0.072000] gpiochip_add: registered GPIOs 48 to 55 on device: ltq_gpio
[    0.076000] MIPS: machine is Generic Lantiq based board
[    0.092000] bio: create slab <bio-0> at 0
[    0.100000] Switching to clocksource MIPS
[    0.108000] NET: Registered protocol family 2
[    0.112000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.120000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.128000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.132000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.140000] TCP reno registered
[    0.144000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.148000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.156000] NET: Registered protocol family 1
[    0.160000] gptu: totally 6 16-bit timers/counters
[    0.168000] gptu: misc_register on minor 63
[    0.172000] gptu: succeeded to request irq 126
[    0.176000] gptu: succeeded to request irq 127
[    0.180000] gptu: succeeded to request irq 128
[    0.184000] gptu: succeeded to request irq 129
[    0.188000] gptu: succeeded to request irq 130
[    0.192000] gptu: succeeded to request irq 131
[    0.200000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.208000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.216000] msgmni has been set to 57
[    0.220000] io scheduler noop registered
[    0.224000] io scheduler deadline registered (default)
[    0.232000] ltq_asc.1: ttyLTQ1 at MMIO 0x1e100c00 (irq = 112) is a ltq_asc
[    0.236000] console [ttyLTQ1] enabled, bootconsole disabled
[    0.236000] console [ttyLTQ1] enabled, bootconsole disabled
[    0.256000] TCP cubic registered
[    0.260000] NET: Registered protocol family 17
[    0.264000] 8021q: 802.1Q VLAN Suppor[    0.268000] VFS: Cannot open root device "(null)" or unknown-block(0,0)
[    0.272000] Please append a correct "root=" boot option; here are the available partitions:
[    0.284000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

(Last edited by alphasparc on 27 Sep 2012, 16:10)

Help anybody?

[    0.000000] MIPS: no machine found for id 'GR7000', supported machines:
[    0.000000] id                       name
[    0.000000] Generic                  Generic Lantiq based board
[    0.000000] FRITZ7320                FRITZ!BOX 7320
[    0.000000] DGN3500B                 Netgear DGN3500B
[    0.000000] WBMR                     WBMR
[    0.000000] P2601HNFX                ZyXEL P-2601HN-Fx
[    0.000000] H201L                    ZTE ZXV10 H201L

You need to provide a mach file for "GR7000"

Hi I just copied wholesale in the folder /trunk/target/linux/lantiq/files/arch/mips/lantiq/xway/
mach-wbmr.c to mach-gr7000 and renamed everything inside from wbmr to gr7000.
I am quite sure it is the wrong but I don't have any better idea...

Things I added/modified
/trunk/target/linux/lantiq/files/arch/mips/lantiq/xway/mach-gr7000.c
/trunk/target/linux/lantiq/image/Makefile
/trunk/target/linux/lantiq/ar9/profiles/007-aztech.mk
/trunk/target/linux/lantiq/ar9/config-default

Can someone please enlighten me?
I am still stuck.

In your source LANTIQ_MACH_GR7000 exists in mach-gr7000.c?

MIPS_MACHINE(LANTIQ_MACH_GR7000,
                        "GR7000",
                        "GR7000",
                        gr7000_init);

Do your define it in machtypes.h?

I think I know why, the files are not in the source yet, it is in the patches...didn't think of looking at the patches.

TS, any update on this?

The discussion might have continued from here.