Help with Inteno XG6846

Hi to all

i have a few XG6846 device
they are working well, and the 6th port (SFP) is helping me a lot
always needed +1 port :slight_smile:

my problem is that factory firmware is very limited, so i like to put OpenWRT on it to gain some SNMP information, etc
Nothing special, but i like OpenWRT look&feel
I itend to use these devices as smart L2 switch

i tried to compile own FW for 96328avng, older v4.x and latest v5.x kernel
Initram image boot from network, everything looks fine, execpt, the main thing :frowning:
there is no network

swconfig shows the chip, but every port is down.
Does someone want to help me to port OpenWRT on this device?

here is the original boot log

HELO
CPUI
L1CI
DRAM
----
PHYS
ZQDN
300H
PHYE
DINT
LSYN
USYN
MSYN
LMBE
RACE
PASS
----
ZBSS
CODE
DATA
L12F
MAIN


CFE version 1.0.38-114.101 for BCM96328 (32bit,SP,BE)
Build Date: Tue Jul  9 10:13:28 CST 2013 (mike_chen@cs1.xavi.com.tw)
Copyright (C) 2000-2011 Broadcom Corporation.

HS Serial flash device: name S25FL128, id 0x0118 size 16384KB
Total Flash size: 16384K with 256 sectors
Flash not used for Auxillary File System
Chip ID: BCM6328B0, MIPS: 320MHz, DDR: 320MHz, Bus: 160MHz
Main Thread: TP0
Memory Test Passed
Total Memory: 67108864 bytes (64MB)
Boot Address: 0xb8000000

Board IP address                  : 192.168.168.1:ffffff00
Host IP address                   : 192.168.168.66
Gateway IP address                :
Run from flash/host (f/h)         : f
Default host run file name        : vmlinux
Default host flash file name      : bcm963xx_fs_kernel
Boot delay (0-9 seconds)          : 2
Boot image (0=latest, 1=previous) : 0
Board Id (0-10)                   : 96328avng
Number of MAC Addresses (1-32)    : 11
Base MAC Address                  : 00:22:07:c4:4b:a5
PSI Size (1-64) KBytes            : 24
Enable Backup PSI [0|1]           : 0
System Log Size (0-256) KBytes    : 0
Auxillary File System Size Percent: 0
Main Thread Number [0|1]          : 0

*** Press any key to stop auto run (2 seconds) ***
Auto run second count down: 0
Booting from latest image (0xb8800000) ...
Code Address: 0x80010000, Entry Address: 0x80286720
Decompression OK!
Entry at 0x80286720
Closing network.
Disabling Switch ports.
Flushing Receive Buffers...
0 buffers found.
Closing DMA Channels.
Starting program at 0x80286720
Linux version 2.6.30 (mike_chen@cs1) (gcc version 4.4.2 (Buildroot 2010.02-git) ) #28 Thu Apr 30 17:43:16 CST 2015
HS Serial flash device: name S25FL128, id 0x0118 size 16384KB
96328avng prom init
CPU revision is: 0002a075 (Broadcom4350)
DSL SDRAM reserved: 0x100000
Determined physical RAM map:
 memory: 03f00000 @ 00000000 (usable)
Zone PFN ranges:
  DMA      0x00000000 -> 0x00001000
  Normal   0x00001000 -> 0x00003f00
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00003f00
On node 0 totalpages: 16128
free_area_init_node: node 0, pgdat 80334130, node_mem_map 81000000
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 94 pages used for memmap
  Normal zone: 11938 pages, LIFO batch:1
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16002
Kernel command line: root=31:0 ro noinitrd console=ttyS0,115200
wait instruction: enabled
Primary instruction cache 32kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 32kB, 2-way, VIPT, cache aliases, linesize 16 bytes
NR_IRQS:128
PID hash table entries: 256 (order: 8, 1024 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60304k/64512k available (2545k kernel code, 4188k reserved, 676k data, 120k init, 0k highmem)
Calibrating delay loop... 319.48 BogoMIPS (lpj=159744)
Mount-cache hash table entries: 512
--Kernel Config--
  SMP=0
  PREEMPT=0
  DEBUG_SPINLOCK=0
  DEBUG_MUTEXES=0
Broadcom Logger v0.1 Apr 14 2015 17:25:33
net_namespace: 812 bytes
NET: Registered protocol family 16
Total Flash size: 16384K with 256 sectors
Flash not used for Auxillary File System
registering PCI controller with io_map_base unset
registering PCI controller with io_map_base unset
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pci 0000:00:09.0: reg 10 32bit mmio: [0x10002600-0x100026ff]
pci 0000:00:0a.0: reg 10 32bit mmio: [0x10002500-0x100025ff]
pci 0000:01:00.0: PME# supported from D0 D3hot
pci 0000:01:00.0: PME# disabled
pci 0000:01:00.0: PCI bridge, secondary bus 0000:02
pci 0000:01:00.0:   IO window: disabled
pci 0000:01:00.0:   MEM window: disabled
pci 0000:01:00.0:   PREFETCH window: disabled
PCI: Setting latency timer of device 0000:01:00.0 to 64
BLOG v3.0 Initialized
BLOG Rule v1.0 Initialized
Broadcom IQoS v0.1 Apr 14 2015 17:26:18 initialized
Broadcom GBPM v0.1 Apr 14 2015 17:26:19 initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
squashfs: version 4.0 with LZMA457 ported by BRCM
fuse init (API version 7.11)
msgmni has been set to 117
io scheduler noop registered (default)
pcieport-driver 0000:01:00.0: device [14e4:6328] has invalid IRQ; check vendor BIOS
PCI: Setting latency timer of device 0000:01:00.0 to 64
Driver 'sd' needs updating - please use bus_type methods
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
NET: Registered protocol family 24
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
bcm963xx_mtd driver v2.0
File system address: 0xb8800100
Registered device mtd[BCM63XX RootFS] dev[0] Flash[0xb8800100,2056192]
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
PCI: Enabling device 0000:00:0a.0 (0000 -> 0002)
PCI: Setting latency timer of device 0000:00:0a.0 to 64
ehci_hcd 0000:00:0a.0: EHCI Host Controller
ehci_hcd 0000:00:0a.0: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:0a.0: Enabling legacy PCI PM
ehci_hcd 0000:00:0a.0: irq 50, io mem 0x10002500
ehci_hcd 0000:00:0a.0: USB f.f started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
PCI: Enabling device 0000:00:09.0 (0000 -> 0002)
PCI: Setting latency timer of device 0000:00:09.0 to 64
ohci_hcd 0000:00:09.0: OHCI Host Controller
ohci_hcd 0000:00:09.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:09.0: irq 49, io mem 0x10002600
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
brcmboard: brcm_board_init entry
PCIe: No device found - Powering down
Serial: BCM63XX driver $Revision: 3.00 $
Magic SysRq enabled (type ^ h for list of supported commands)
ttyS0 at MMIO 0xb0000100 (irq = 36) is a BCM63XX
ttyS1 at MMIO 0xb0000120 (irq = 47) is a BCM63XX
Total # RxBds=1920
bcmPktDmaBds_init: Broadcom Packet DMA BDs initialized

GACT probability NOT on
Mirror/redirect action on
u32 classifier
    input device check on
    Actions configured
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly on device 31:0.
Freeing unused kernel memory: 120k freed
init started: BusyBox v1.17.2 (2015-04-14 17:27:52 CST)
starting pid 187, tty '': '/etc/init.d/rcS'
/etc/init.d/rcS: line 13: syntax error: unexpected ")" (expecting ";;")
starting pid 190, tty '': '-/bin/sh'


BusyBox v1.17.2 (2015-04-14 17:27:52 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Loading drivers and kernel modules...
chipinfo: module license 'proprietary' taints kernel.
Disabling lock debugging due to kernel taint
brcmchipinfo: brcm_chipinfo_init entry
Broadcom Ingress QoS Module  Char Driver v0.1 Apr 14 2015 17:25:56 Registered<243>

Broadcom Ingress QoS ver 0.1 initialized
BPM: tot_mem_size=67108864B (64MB), buf_mem_size=10066329B (9MB), num of buffers=4802, buf size=2096
Broadcom BPM Module Char Driver v0.1 Apr 14 2015 17:25:55 Registered<244>
[NTC bpm] bpm_set_status: BPM status : enabled

NBUFF v1.0 Initialized
Initialized fcache state
Broadcom Packet Flow Cache  Char Driver v2.2 Apr 14 2015 17:25:56 Registered<242>
Created Proc FS /procfs/fcache
Broadcom Packet Flow Cache registered with netdev chain
Broadcom Packet Flow Cache learning via BLOG enabled.
Constructed Broadcom Packet Flow Cache v2.2 Apr 14 2015 17:25:56
Broadcom BCM6328B0 Ethernet Network Device v0.1 Apr 14 2015 17:25:58
ETH Init: Ch:0 - 200 tx BDs at 0xa3972000
ETH Init: Ch:0 - 1920 rx BDs at 0xa38a8000
dgasp: kerSysRegisterDyingGaspHandler: bcmsw registered
eth0: MAC Address: 00:22:07:C4:4B:A5
eth0 Link UP 1000 mbps full duplex
message received before monitor task is initialized kerSysSendtoMonitorTask
Init switch ports for igmpsnooping
Init switch LAN1~4 ports for EEE, enable = 0
Marvell switch control module loaded successfully.
xavi_igmpsnooping module loaded successfully.
XAVi fiber control module loaded successfully.
XAVi LED mode module loaded successfully.
XAVi port_limit  Apr 14 2015 17:26:04 debug (0)

===== Release Version XG6846_4.12ITT01.69 (build timestamp 150430_1743) =====

[devCtl_catvData][544] catvData: enable 0
Skipped rcl
SFP fiber start
SFP Copper is detected.
disable port 0 egress rate limiting
disable port 1 egress rate limiting
disable port 2 egress rate limiting
disable port 3 egress rate limiting
sendto: Network is unreachable
device eth0 entered promiscuous mode
br0: port 1(eth0) entering forwarding state
monitor task is initialized pid= 281
xavi_switch_daemon started.
xavi_wan started.
Allocating 1 taps...
1 of 1
.:: Gone into daemonland ::.
Switch VTB Flush!
Starting Master Thread... OK
Starting Interface Threads...
1 of 1Add an STU entry for init VTB !
device tap0 entered promiscuous mode
br0: port 2(tap0) entering forwarding state
br0: port 1(eth0) entering disabled state
br0: port 1(eth0) entering forwarding state
CATV: No signal/CATV not connected
GUI & DHCP option 66(url) or 67(file) Not Found.

here it is a OpenWRT dmesg


[    0.000000] Linux version 5.4.48 (user@serverb) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r13674-cbb66f9edb)) #0 Wed Jul 1 20:19:50 2020
[    0.000000] Detected Broadcom 0x6328 CPU revision b0
[    0.000000] CPU frequency is 320 MHz
[    0.000000] 64MB of RAM installed
[    0.000000] board_bcm963xx: Boot address 0xb8000000
[    0.000000] board_bcm963xx: CFE version: 1.0.38-114.101
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0002a075 (Broadcom BMIPS4350)
[    0.000000] board: board name: 96328avng
[    0.000000] MIPS: machine is Broadcom BCM96328avng reference board
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 16 bytes.
[    0.000000] Primary data cache 32kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 49932K/65536K available (4693K kernel code, 215K rwdata, 1076K rodata, 8728K init, 199K bss, 15604K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] random: get_random_bytes called from start_kernel+0x328/0x530 with crng_init=0
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11945377789 ns
[    0.000018] sched_clock: 32 bits at 160MHz, resolution 6ns, wraps every 13421772796ns
[    0.008130] Calibrating delay loop... 319.74 BogoMIPS (lpj=639488)
[    0.050521] pid_max: default: 32768 minimum: 301
[    0.055653] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.063231] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.080359] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.090439] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.097661] pinctrl core: initialized pinctrl subsystem
[    0.104349] NET: Registered protocol family 16
[    0.354099] registering PCI controller with io_map_base unset
[    0.410618] PCI host bridge to bus 0000:00
[    0.414907] pci_bus 0000:00: root bus resource [mem 0x10f00000-0x10ffffff]
[    0.421978] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.428959] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.435942] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.444155] pci 0000:00:00.0: [14e4:6328] type 01 class 0x060400
[    0.450484] pci 0000:00:00.0: PME# supported from D0 D3hot
[    0.457555] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.467012] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.473851] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.480667] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.495161] clocksource: Switched to clocksource MIPS
[    0.503554] NET: Registered protocol family 2
[    0.509828] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.518572] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.526527] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.533850] TCP: Hash tables configured (established 1024 bind 1024)
[    0.540981] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.547830] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.555681] NET: Registered protocol family 1
[    0.560313] PCI: CLS 0 bytes, default 16
[    0.983896] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    1.008176] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.014218] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.068329] bcm6328-pinctrl 10000080.pin-controller: registered at mmio (ptrval)
[    1.078394] 10000100.serial: ttyS0 at MMIO 0x10000100 (irq = 36, base_baud = 1562500) is a bcm63xx_uart
[    1.088161] printk: console [ttyS0] enabled
[    1.096754] printk: bootconsole [early0] disabled
[    1.127510] random: fast init done
[    1.131649] spi-nor spi1.0: s25fl128s1 (16384 Kbytes)
[    1.167606] bcm63xxpart: Partition 0 is CFE offset 0 and length 10000
[    1.174247] bcm63xxpart: Partition 1 is nvram offset ff0000 and length 10000
[    1.181485] bcm63xxpart: Partition 2 is linux offset 10000 and length fe0000
[    1.188819] 3 bcm63xxpart partitions found on MTD device spi1.0
[    1.194928] Creating 3 MTD partitions on "spi1.0":
[    1.199875] 0x000000000000-0x000000010000 : "CFE"
[    1.206858] 0x000000ff0000-0x000001000000 : "nvram"
[    1.213936] 0x000000010000-0x000000ff0000 : "linux"
[    1.229206] parser_imagetag: rootfs: CFE image tag found at 0x0 with version 6, board type 96328avng
[    1.238676] parser_imagetag: Partition 0 is rootfs offset 100 and length 1f6000
[    1.246193] parser_imagetag: Partition 1 is kernel offset 1f6100 and length 11cd5b
[    1.253976] parser_imagetag: Spare partition is offset 120000 and length ec0000
[    1.261579] 2 bcm963xx-imagetag partitions found on MTD device linux
[    1.268140] Creating 2 MTD partitions on "linux":
[    1.272979] 0x000000000100-0x0000001f6100 : "rootfs"
[    1.280205] mtd: device 3 (rootfs) set to be root filesystem
[    1.289095] mtdsplit: no squashfs found in "rootfs"
[    1.294214] 0x0000001f6100-0x000000312e5b : "kernel"
[    1.303770] libphy: Fixed MDIO Bus: probed
[    1.308606] bcm63xx_enetsw bcm63xx_enetsw.0: IRQ index 1 not found
[    1.356325] b53_common: found switch: BCM63xx, rev 0
[    1.362116] bcm63xx-wdt bcm63xx-wdt:  started, timer margin: 30 sec
[    1.371381] leds-gpio leds-gpio.0: Skipping unavailable LED gpio 0 ((null))
[    1.378579] leds-gpio leds-gpio.0: Skipping unavailable LED gpio 0 ((null))
[    1.385744] leds-gpio leds-gpio.0: Skipping unavailable LED gpio 0 ((null))
[    1.392906] leds-gpio leds-gpio.0: Skipping unavailable LED gpio 0 ((null))
[    1.400075] leds-gpio leds-gpio.0: Skipping unavailable LED gpio 0 ((null))
[    1.410158] NET: Registered protocol family 10
[    1.433314] Segment Routing with IPv6
[    1.437331] NET: Registered protocol family 17
[    1.442026] 8021q: 802.1Q VLAN Support v1.8
[    1.569332] Freeing unused kernel memory: 8728K
[    1.574018] This architecture does not have kernel memory protection.
[    1.580630] Run /init as init process
[    1.617588] init: Console is alive
[    1.621587] init: - watchdog -
[    1.655029] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.667749] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.685925] init: - preinit -
[    2.183432] random: jshn: uninitialized urandom read (4 bytes read)
[    2.271293] random: jshn: uninitialized urandom read (4 bytes read)
[    2.537832] random: jshn: uninitialized urandom read (4 bytes read)
[    3.013611] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[    4.003213] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.413839] procd: - early -
[    6.417034] procd: - watchdog -
[    7.018538] procd: - watchdog -
[    7.022351] procd: - ubus -
[    7.041744] urandom_read: 3 callbacks suppressed
[    7.041759] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.077548] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.084833] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.093595] procd: - init -
[    8.151439] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.311063] xt_time: kernel timezone is -0000
[    8.405647] PPP generic driver version 2.4.2
[    8.429199] NET: Registered protocol family 24
[    8.491743] kmodloader: done loading kernel modules from /etc/modules.d/*
[    8.744981] urngd: v1.0.2 started.
[    9.050432] random: crng init done
[    9.053946] random: 1 urandom warning(s) missed due to ratelimiting
[   38.579782] br-lan: port 1(eth0.1) entered blocking state
[   38.585367] br-lan: port 1(eth0.1) entered disabled state
[   38.591653] device eth0.1 entered promiscuous mode
[   38.596604] device eth0 entered promiscuous mode
[   38.655348] br-lan: port 1(eth0.1) entered blocking state
[   38.660922] br-lan: port 1(eth0.1) entered forwarding state
[   39.556454] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

so, i haved a few hours free and tried again

so far i found these:
red led is working
green led is working
reset button is working
i2c for sfp module is working

        leds {
                compatible = "gpio-leds";

                led_power: power {
                        label = "power";
                        gpios = <&pinctrl 20 1>;
                        default-state = "off";
                };

                led_upgrade: upgrade {
                        label = "upgrade";
                        gpios = <&pinctrl 18 1>;
                        default-state = "off";
                };
        };

        keys {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;

                reset {
                        label = "reset";
                        gpios = <&pinctrl 24 1>;
                        linux,code = <KEY_RESTART>;
                        debounce-interval = <60>;
                };
        };

        i2c0: i2c0 {
                compatible = "i2c-gpio";
                gpios = <&pinctrl 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) /* sda */
                        &pinctrl 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) /* scl */
                        >;
                i2c-gpio,delay-us = <10>;
                #address-cells = <1>;
                #size-cells = <0>;
                status = "ok";
        };

        i2c1: i2c1 {
                compatible = "i2c-gpio";
                gpios = <&pinctrl 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) /* sda */
                        &pinctrl 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN) /* scl */
                        >;
                i2c-gpio,delay-us = <10>;
                #address-cells = <1>;
                #size-cells = <0>;
                status = "ok";
        };

and here is i2c dump of sfp

i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x08-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- 56 -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@OpenWrt:/# i2cdump 0 0x50
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0, address 0x50, mode byte
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 03 04 22 00 00 00 08 00 00 00 00 01 0d 00 00 00    ??"...?....??...
10: 00 00 64 00 48 75 61 57 65 69 20 20 20 20 20 20    ..d.HuaWei
20: 20 20 20 20 00 00 00 00 4b 59 45 2d 47 42 2d 50        ....KYE-GB-P
30: 31 52 43 20 20 20 20 20 31 2e 30 20 00 00 00 57    1RC     1.0 ...W
40: 00 00 00 00 46 31 34 30 34 32 31 31 36 31 36 20    ....F1404211616
50: 20 20 20 20 31 34 30 34 32 31 20 20 00 00 00 4c        140421  ...L
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

i2c1 is for external CATV module, so there is no use

but, i still does not have any connection
switch is not working
and, what is the next step with SFP ?

ok, have eeprom definition in DTS

                sfp1_eeprom: sfp1eeprom@50 {
                       compatible = "atmel,24c02";
                       reg = <0x50>;
                       read-only;
                };

produce these:

dmesg:
at24 0-0050: 256 byte 24c02 EEPROM, read-only, 0 bytes/write

cat /sys/class/i2c-dev/i2c-0/device/0-0050/eeprom
dHuaWei          KYE-GB-P1RC     1.0 WF1404211616     140421  Lβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’

now, i am stuck with i2c-0 / 0x56,
read somewhere that this is mdio bus

                mdio0 {
                    compatible = "flx,i2c-mdio";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <0x56>;

but this is out of my knowledge
any help with this ?

well, i found this when compile kernel 5.4

kmod-phylink is not available in the kernel config - generating empty package
kmod-sfp is not available in the kernel config - generating empty package

so, if i get it right, kernel for broadcom does not support these modules ??

Hi

I have one of these switches as well. How far did you come in your development?
Can I test your image?

hi @mrhaav

it is abandoned project, so i have no left any old DTS / images
sry

Ok
Thanks for your response!

Not a bad idea to revive it. Perhaps some of the switch experts might have some useful pointers for the SFP stuff. @svanheule ?

well, if someone need it
i found
XG6846_4.12ITT01.83_20161115_consumer_release.tar.gz in my archive
it is tarball from manufacturer

Not sure I can help much, but have you looked at some of the DTS files in the realtek target? You'll need to have (define) an I2C bus, and connect that to an sfp node. See for example rtl8380_zyxel_gs1900-10hp.dts.

1 Like

Hi
I'd be happy to have a copy of XG6846_4.12ITT01.83_20161115_consumer_release.tar.gz.

ok, uploaded to Mega

1 Like

@mrhaav do you think you'd be able to get this going?

First challenge is to get a DTS fleshed out.

@NPeca75 are there any particular bits aside from above that were difficult or guessed? Or is everything there in the source?

Hi

I donΒ΄t know. But, I can summarize what I know.
Board: BCM96328avng
CPU: Broadcom BCM63281SKFBG Arch. BMIPS4350
Switch: Marvell 88E6352-TFJ2

COM port: 115200N8 (3.3V)

I have started on a dts file, but itΒ΄s not working.
The SFP is connected to i2c0.
I donΒ΄t know how the CPU is talking to the Marvell switch. It could be via the MDIO interface. But how do I define the BCM6328 MDIO?
I think the CPU is connected with the RGMII to the switch, all interfaces are 1G interfaces.

All help is appreciated.

dts file:

#include "bcm6328.dtsi"

#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>

/ {
        model = "Inteno XG6846";
        compatible = "inteno,xg6846", "brcm,bcm6328";

        aliases {
                led-boot = &led_upgrade;
                led-failsafe = &led_upgrade;
                led-running = &led_power;
                led-upgrade = &led_upgrade;
        };

        chosen {
                bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
                stdout-path = "serial0:115200n8";
        };

        eth0: eth0 {
                phy-mode = "rgmii-id";
                fixed-link {
                        speed = <1000>;
                        full-duplex;
                };
        };

        i2c0: i2c0 {
                compatible = "i2c-gpio";
                sda-gpios = <&pinctrl 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                scl-gpios = <&pinctrl 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
                i2c-gpio,delay-us = <10>;
                #address-cells = <1>;
                #size-cells = <0>;
        };

        sfp0: sfp0 {
                compatible = "sff,sfp";
                i2c-bus = <&i2c0>;
                los-gpio = <&pinctrl 29 GPIO_ACTIVE_HIGH>;
        };

        mdio0: mdio0 {

                switch@0 {
                        compatible = "marvell,mv88e6085";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0>;

                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;

                                port@0 {
                                        reg = <0>;
                                        label = "lan1";
                                };

                                port@1 {
                                        reg = <1>;
                                        label = "lan2";
                                };

                                port@2 {
                                        reg = <2>;
                                        label = "lan3";
                                };

                                port@3 {
                                        reg = <3>;
                                        label = "lan4";
                                };

                                port@4 {
                                        reg = <4>;
                                        label = "ext1";
                                };

                                port@5 {
                                        reg = <5>;
                                        phy-mode = "rgmii-id";
                                        label = "sfp";
                                        sfp = <&sfp0>;
                                        fixed-link {
                                                speed = <1000>;
                                                full-duplex;
                                        };
                                };

                                port@6 {
                                        reg = <6>;
                                        phy-mode = "rgmii-id";
                                        label = "cpu";
                                        ethernet = <&eth0>;
                                        fixed-link {
                                                speed = <1000>;
                                                full-duplex;
                                        };
                                };
                        };
                };
        };

        leds {
                compatible = "gpio-leds";

                led_power: power {
                        label = "led:green";
                        gpios = <&pinctrl 20 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };

                led_upgrade: upgrade {
                        label = "led:red";
                        gpios = <&pinctrl 18 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };
        };

        keys {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                #size-cells = <0>;
                poll-interval = <20>;

                reset {
                        label = "reset";
                        gpios = <&pinctrl 24 1>;
                        linux,code = <KEY_RESTART>;
                        debounce-interval = <60>;
                };
        };
};

&hsspi {
        status = "okay";

        flash@0 {
                compatible = "jedec,spi-nor";
                spi-max-frequency = <16666667>;
                spi-tx-bus-width = <2>;
                spi-rx-bus-width = <2>;
                reg = <0>;

                #address-cells = <1>;
                #size-cells = <1>;

                partitions {
                        compatible = "brcm,bcm963xx-cfe-nor-partitions";
                };
        };
};

&i2c0 {
        status = "okay";
};

&eth0 {
        status = "okay";
};

&mdio0 {
        status = "okay";
};

&pinctrl {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usb_port1_device>;
};

&uart0 {
        status = "okay";
};

Could you compile a consumer_release image?
When I run make PROFILE=XG6846_ITT it failes to download the toolchains_bcm963xx_4.06L.02.tgz.

Here is the toolchain mentioned in the consumer_install script. uclibc-crosstools-gcc-4.4.2-1

I've not tried that one. But somewhere on flashback forums, there's a guy claiming to have newer source drops, and being able to compile.

@NPeca75 could you compile the source?

Isn't it already defined in .../bmips/dts/bcm6328.dtsi?

1G capable - they're auto-sensing.

The above DTSI already defines a switch. But what does the make menuconfig present?

I think ./kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts has an example.

Try also ./qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts or ./mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts.

I think a grep for phy-mode = "rgmii"; should find some examples of how to connect things.

Here's an addition to target/linux/bcm63xx/image/bcm63xx.mk to get it to show up in make menuconfig.

diff --git a/target/linux/bcm63xx/image/bcm63xx.mk b/target/linux/bcm63xx/image/bcm63xx.mk
index 97959d7819..8cc8052d65 100644
--- a/target/linux/bcm63xx/image/bcm63xx.mk
+++ b/target/linux/bcm63xx/image/bcm63xx.mk
@@ -805,6 +805,19 @@ define Device/inteno_vg50
 endef
 TARGET_DEVICES += inteno_vg50

+### Inteno ###
+define Device/inteno_xg6846
+  $(Device/bcm63xx)
+  DEVICE_VENDOR := Inteno
+  DEVICE_MODEL := XG6846
+  IMAGES += sysupgrade.bin
+  CFE_BOARD_ID := 96328avng
+  CHIP_ID := 6328
+  FLASH_MB := 16
+  DEVICE_PACKAGES := $(USB2_PACKAGES)
+endef
+TARGET_DEVICES += inteno_xg6846
+
 ### Inventel ###
 define Device/inventel_livebox-1
   $(Device/bcm63xx_redboot)

Maybe this will give partitions in the DTS:

...
&hsspi {
        status = "okay";

        flash@0 {
                compatible = "jedec,spi-nor";
                spi-max-frequency = <16666667>;
                spi-tx-bus-width = <2>;
                spi-rx-bus-width = <2>;
                reg = <0>;

                #address-cells = <1>;
                #size-cells = <1>;

                partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;

                        cfe@0 {
                                reg = <0x000000 0x010000>;
                                label = "CFE";
                                read-only;
                        };

                        nvram@ff0000 {
                                reg = <0x0ff0000 0x1000000>;
                                label = "nvram";
                        };

                        linux@10000 {
                                reg = <0x10000 0xff0000>;
                                label = "linux";
                                compatible = "brcm,bcm963xx-imagetag";
                        };
                };

        };
};

Don't see any point in adding USB (can document it and comment it out) unless something is connected via USB, even though the hardware may have a controller. Just more init time and kernel memory.

Hi @systemcrash,

I'm trying to use the consumer_install source as well to create my own version of the 01.83 version of the firmware. I've already set up an old Fedora 16 VM with the dependencies needed and successfully compiled the firmware. The thing is when I later on test the firmware out on one of my XG6846's the firmware does not load completely and I get an CPU exception. Anyone else who successfully compiled it? And if, what dependencies och pre-requirements are you using?
I'm also looking for a newer version of the source that could be compiled.

As you mentioned, I think I'm "the guy" you are referring to that claimed have compiled it. I've managed to extract an old firmware and edit the file system in that file and then been able to reconstruct it and successfully loaded it into the XG6846. I've not been able to compile the firmware from source.

/B.R. csoM