OpenWrt Forum Archive

Topic: Adding Support for 96338w2

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

Hey all
I have a Alice wlan 1121  http://wiki.openwrt.org/toh/siemens/s1621-z220-a
its a broadcom based adsl2+ modem .
Other devices with same board id i know are: DNA- A212, DNA-A213 and Nokia Siemens Networks Residential Router 1600
(i dont know about the board pcb layout ( pictures are welcome)
Other devices with same pcb layout  but wrong board id are: D-Link DSL-2640U/BRU/C Ver. C1  http://wiki.openwrt.org/toh/d-link/dsl-2640u-bru-c

Have patched board_bcm963xx.c to Support 96338w2 but my unit isnt reachable over lan and wlan is not showing up. So i have to wait for my serial cable.

Have tried  serial console from raspberry pi to the router but i see only signs i cant read in minicom and picocom. :-(

little update have lan ports up and runing after a compilation patch and flash marathon ;-)
Luci does a good job.

ToDo:
testing.
get wifi working.
adding usb port get usb working.
submit patches .

(Last edited by dennistlg on 1 Jan 2013, 22:05)

Watching at you board photo, it seems there exists an a place designed to solder a usb connector near the switch and behind a reset button. Not sure if you may also need to patch your kernel before you solder all needed components.

You may need to patch the kernel with something like this:

--- a/drivers/usb/host/ohci-bcm63xx.c
+++ b/drivers/usb/host/ohci-bcm63xx.c
@@ -20,8 +20,6 @@
     struct ohci_hcd *ohci = hcd_to_ohci(hcd);
     int ret;
 
-    ohci->num_ports = 1;
-
     ret = ohci_init(ohci);
     if (ret < 0)
         return ret;
@@ -79,8 +77,8 @@
     usb_host_clock = clk;
     msleep(100);
 
-    if (BCMCPU_IS_6348())
-        bcm_rset_writel(RSET_OHCI_PRIV, 0, OHCI_PRIV_REG);
+    if (BCMCPU_IS_6348() || BCMCPU_IS_6338())
+        bcm_rset_writel(RSET_OHCI_PRIV, 1, OHCI_PRIV_REG);
     else if (BCMCPU_IS_6358()) {
         reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6358_REG);
         reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;

Since bcm6338 SoCs only have one usb port and it seems to be slave as default.

Wow thanks Danitool have a secound thread about adding usb.  Nice to see this patch!

Here is a boot log from flashed device.  (connected over serial.)
Wireless is not working. All other things working good!

If anyone can help me with wireless stuff i would be happy.
its a bcm4312 connected with sdio to the bcm6338


CFE version 1.0.37-12.1 for BCM96338 (32bit,SP,BE)
Build Date: Fri Nov 14 16:18:28 CST 2008 (root@localhost.localdomain)
Copyright (C) 2000-2006 Broadcom Corporation.

Boot Address 0xbfc00000

Initializing Arena.
Initializing Devices.
Parallel flash device: name MX29LV320AB, id 0x22a8, size 4096KB
CPU type 0x29010: 240MHz
Total memory: 16777216 bytes (16MB)

Total memory used by CFE:  0x80401000 - 0x805281D0 (1208784)
Initialized Data:          0x8041D700 - 0x8041F9F0 (8944)
BSS Area:                  0x8041F9F0 - 0x804261D0 (26592)
Local Heap:                0x804261D0 - 0x805261D0 (1048576)
Stack Area:                0x805261D0 - 0x805281D0 (8192)
Text (code) segment:       0x80401000 - 0x8041D6F8 (116472)
Boot area (physical):      0x00529000 - 0x00569000
Relocation Factor:         I:00000000 - D:00000000

Board IP address                  : 192.168.1.1:ffffff00  
Host IP address                   : 192.168.1.159  
Gateway IP address                :   
Run from flash/host (f/h)         : h  
Default host run file name        : 308nfs6358  
Default host flash file name      : bcm963xx_fs_kernel  
Boot delay (0-9 seconds)          : 1  
Board Id (0-9)                    : 96338W2  
Number of MAC Addresses (1-32)    : 11  
Base MAC Address                  : 00:1e:40:db:25:3a  
PSI Size (1-64) KBytes            : 24  

*** Press any key to stop auto run (1 seconds) ***
Auto run second count down: 0
Booting from only image (0xbfc10000) ...
Code Address: 0x80010000, Entry Address: 0x80010000
Decompression OK!
Entry at 0x80010000
Closing network.
Starting program at 0x80010000
[    0.000000] Linux version 3.6.11 (snakefreak@Snakefreak-AMD) (gcc version 4.6.4 20121106 (prerelease) (Linaro GCC 4.6-2012.11) ) #2 Tue 3
[    0.000000] Detected Broadcom 0x6338 CPU revision a2
[    0.000000] CPU frequency is 240 MHz
[    0.000000] 16MB of RAM installed
[    0.000000] registering 8 GPIOs
[    0.000000] board_bcm963xx: Boot address 0xbfc00000
[    0.000000] board_bcm963xx: CFE version: 1.0.37-12.1
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00029010 (Broadcom BCM6338)
[    0.000000] board_bcm963xx: board name: 96338W2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 01000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x00ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x00ffffff]
[    0.000000] Reserving 0MB of memory at 0MB for crashkernel
[    0.000000] Primary instruction cache 16kB, VIPT, 2-way, linesize 16 bytes.
[    0.000000] Primary data cache 8kB, 2-way, VIPT, no aliases, linesize 16 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
[    0.000000] Kernel command line:  root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
[    0.000000] PID hash table entries: 64 (order: -4, 256 bytes)
[    0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Memory: 12976k/16384k available (2260k kernel code, 3408k reserved, 400k data, 208k init, 0k highmem)
[    0.000000] NR_IRQS:128
[    0.000000] Calibrating delay loop... 237.82 BogoMIPS (lpj=475648)
[    0.040000] pid_max: default: 32768 minimum: 301
[    0.044000] Mount-cache hash table entries: 512
[    0.056000] NET: Registered protocol family 16
[    0.128000] bio: create slab <bio-0> at 0
[    0.148000] Switching to clocksource MIPS
[    0.176000] NET: Registered protocol family 2
[    0.184000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.192000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.196000] TCP: Hash tables configured (established 512 bind 512)
[    0.204000] TCP: reno registered
[    0.208000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.216000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.224000] NET: Registered protocol family 1
[    0.236000] audit: initializing netlink socket (disabled)
[    0.244000] type=2000 audit(0.244:1): initialized
[    0.252000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.256000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.268000] msgmni has been set to 25
[    0.272000] io scheduler noop registered
[    0.276000] io scheduler deadline registered (default)
[    0.288000] bcm63xx_uart.0: ttyS0 at MMIO 0xfffe0300 (irq = 10) is a bcm63xx_uart
[    0.296000] console [ttyS0] enabled, bootconsole disabled
[    0.296000] console [ttyS0] enabled, bootconsole disabled
[    0.320000] physmap platform flash device: 00400000 at 1fc00000
[    0.328000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022a8
[    0.340000] Amd/Fujitsu Extended Query Table at 0x0040
[    0.344000]   Amd/Fujitsu Extended Query version 1.1.
[    0.352000] number of CFI chips: 1
[    0.352000] bcm63xxpart: CFE boot tag found with version 6 and board type 96338W2
[    0.360000] bcm63xxpart: Partition 0 is CFE offset 0 and length 10000
[    0.368000] bcm63xxpart: Partition 1 is kernel offset 10100 and length eff00
[    0.376000] bcm63xxpart: Partition 2 is rootfs offset 100000 and length 2f0000
[    0.384000] bcm63xxpart: Partition 3 is nvram offset 3f0000 and length 10000
[    0.392000] bcm63xxpart: Partition 4 is linux offset 10000 and length 3e0000
[    0.400000] bcm63xxpart: Spare partition is offset 2c0004 and length 12fffc
[    0.404000] 5 bcm63xxpart partitions found on MTD device physmap-flash.0
[    0.412000] Creating 5 MTD partitions on "physmap-flash.0":
[    0.420000] 0x000000000000-0x000000010000 : "CFE"
[    0.432000] 0x000000010100-0x000000100000 : "kernel"
[    0.440000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-oy
[    0.460000] 0x000000100000-0x0000003f0000 : "rootfs"
[    0.476000] mtd: partition "rootfs" set to be root filesystem
[    0.484000] mtd: partition "rootfs_data" created automatically, ofs=2C0000, len=130000 
[    0.492000] 0x0000002c0000-0x0000003f0000 : "rootfs_data"
[    0.504000] 0x0000003f0000-0x000000400000 : "nvram"
[    0.520000] 0x000000010000-0x0000003f0000 : "linux"
[    0.560000] bcm63xx-wdt bcm63xx-wdt:  started, timer margin: 30 sec
[    0.584000] TCP: cubic registered
[    0.588000] NET: Registered protocol family 17
[    0.592000] 8021q: 802.1Q VLAN Support v1.8
[    0.620000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    0.632000] Freeing unused kernel memory: 208k freed
awk: /proc/cpuinfo: No such file or directory
[    5.340000] roboswitch: Probing device eth0: found a 5325! It's a 5350.
[    6.456000] There is already a switch registered on the device 'eth0'
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
[   11.680000] jffs2: notice: (304) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and.
switching to jffs2
- init -

Please press Enter to activate this console. [   17.400000] Compat-drivers backport release: compat-drivers-2012-12-04
[   17.408000] Backport based on wireless-testing.git master-2012-12-06
[   17.412000] compat.git: wireless-testing.git
[   17.532000] cfg80211: Calling CRDA to update world regulatory domain
[   17.536000] cfg80211: World regulatory domain updated:
[   17.544000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   17.552000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   17.560000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   17.568000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   17.576000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   17.584000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.004000] There is already a switch registered on the device 'eth0'
[   19.100000] Broadcom 43xx driver loaded [ Features: PNL ]
[   19.164000] Button Hotplug driver version 0.4.1
[   19.280000] PPP generic driver version 2.4.2
[   19.884000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   20.384000] NET: Registered protocol family 24
[   20.464000] nf_conntrack version 0.5.0 (206 buckets, 824 max)
[   35.376000] eth0: link forced UP - 100/full - flow control off/off
[   35.396000] device eth0 entered promiscuous mode
[   35.408000] br-lan: port 1(eth0) entered forwarding state
[   35.412000] br-lan: port 1(eth0) entered forwarding state
[   37.416000] br-lan: port 1(eth0) entered forwarding state



BusyBox v1.19.4 (2013-01-01 18:57:54 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r34954)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# 

Not sure if bcm6338 SoCs have SDIO interface. Probably it uses the SPI interface instead. No idea how the b43 driver can be modified to work with SPI. Neither the SPI interface works in Backfire, the work must be done with AA. Ask developers at IRC to point you to the right way.

The discussion might have continued from here.