Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions devices/Sub-Gen1/docs/mdputil.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
mdp[0x19] | HAS_HWFEATURES | CONSOLE_ENABLE | KERNEL_PRINTK_ENABLE

-B
do something with MD5, RSA to mdp and loaded key in mtdblock0

-F
Set flags(0x19)
(perform and/or operations to 0x19 bytes of mdp)


-I
reset mdp buf to default.

-L
?

-M
?

-s
set new serial number

-w
write

-f
force write, usually used with -w to force upgrade device info when a valid one already exists.
Binary file not shown.
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock0.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock1.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock2.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock3.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock4.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock5.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock7.gz
Binary file not shown.
Binary file added devices/Sub-Gen1/dumps/mtdblocks/mtdblock8.gz
Binary file not shown.
74 changes: 74 additions & 0 deletions devices/Sub-Gen1/scripts/dumpfs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import serial
import time
ser = serial.Serial(
port='/dev/cu.usbserial-AB0KG6J0',
baudrate=115200,
)

def hexstring2bin(hs):
# print("".join([chr(c) for c in hs]))
if len(hs) % 2 != 0: hs = hs[:-1]
raw = [int(chr(hs[i*2]) + chr(hs[i*2+1]), 16) for i in range(len(hs) // 2)]
return bytes(raw)


print(ser.isOpen())

#mkdir /tmp/rm; mount --bind / /tmp/rm
#mkdir /ramdisk/text; echo "hello" > /ramdisk/text/hello; echo "world" > /ramdisk/text/world

# ser.write("tar -c /ramdisk/tmp/rootmount 2>/dev/null | gzip -c\r\n".encode('ascii'))
# ser.write("tar -c /ramdisk/text 2>/dev/null | hexdump -ve '1/1 \"%.2x\"' \r\n".encode('ascii'))
# ser.write("tar -c /ramdisk/tmp/rm 2>/dev/null | gzip -c | hexdump -ve '1/1 \"%.2x\"' \r\n".encode('ascii'))
ser.write("cat /dev/mtdblock8 2>/dev/null | gzip -c | hexdump -ve '1/1 \"%.2x\"' \r\n".encode('ascii'))
# ser.write("ls\r\n".encode('ascii'))

# time.sleep(2)
data = bytes()
bytes_cnt = 0
last_rep = 0
cp_cnt = 1
last_cp = 0

while True:
if ser.read(1).decode('ascii') == '\n': break


while True:
if ser.inWaiting() <= 0:
empty_cnt = 200
while empty_cnt > 0:
time.sleep(0.05)
if ser.inWaiting() > 0: break
empty_cnt -= 1

if empty_cnt <= 0: break

chunk = ser.read(ser.inWaiting())
data += chunk
bytes_cnt += len(chunk)
if bytes_cnt - last_rep > 1024:
print(f"got {bytes_cnt / 1024 : .2f}KB, actual size {bytes_cnt / 1024 / 2 : .2f}KB", end="\r")
last_rep = bytes_cnt


# if bytes_cnt - last_cp > 1024 * 1024:
# print("\ncheck point saved")
# f = open(f"cps/checkpoint{cp_cnt}.tar.gz",'wb')
# cp_cnt += 1
# f.write(hexstring2bin(data))
# f.flush()
# f.close()
# last_cp = bytes_cnt
# print(d.__class__)
# data.append()

while True:
if chr(data[-1]) in ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']: break
data = data[:-1]

open("raw.bin", 'wb').write(data)

open("mtdblocks/mtdblock8.gz", 'wb').write(hexstring2bin(data))
print()
print(len(data))
81 changes: 81 additions & 0 deletions devices/Sub-Gen1/scripts/uboot_dump_nand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#dump nand with md command from uboot

import os
import serial
import time

START = 0x00
END = 0x4000000

PER_DUMP_SIZE = 1024 * 2048
FILE_PATH = "nand.bin"

f = open(FILE_PATH, 'ab')

dumped = os.fstat(f.fileno()).st_size
if dumped > 0:
print(f"found {dumped} bytes dumped, continuing")


ser = serial.Serial(
port='/dev/cu.usbserial-AB0KG6J0',
baudrate=115200,
bytesize=serial.EIGHTBITS,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
)
print(f"serial port good? {ser.isOpen()}")
ptr = dumped

def hexstring2bin(hs):
# print("".join([chr(c) for c in hs]))
if len(hs) % 2 != 0: hs = hs[:-1]
raw = [int(hs[i*2] + hs[i*2+1], 16) for i in range(len(hs) // 2)]
return bytes(raw)

def skip2prompt(ser):
ss = ''
while(True):
s = ser.readline().decode('ascii')
ss += s
if '=>' in s: return ss

f.close()

while ptr < END:
chunk = PER_DUMP_SIZE
print(f"Reading 0x{ptr:x} into mem...")
time.sleep(0.01)
ser.write(f"nand read 0x200000 0x{ptr:x} 0x{chunk:x}\n".encode('ascii'))
ser.flush()

ser.readline().decode('ascii')
ser.readline().decode('ascii')
ser.readline().decode('ascii')
ser.readline().decode('ascii')



ser.write(f"md 0x200000 0x{chunk:x}\n".encode('ascii'))
ser.flush()
ser.readline().decode('ascii')
data_chunk = bytes(0)
cnt = 0
while chunk > 0:
o = ser.readline().decode('ascii')
raw = hexstring2bin(''.join(o.strip().split(' ')[1:5]))
data_chunk += raw
chunk -= len(raw)

cnt += len(raw)
print(f"got {cnt / 1024 : .2f}KB, actual size {cnt / 1024 / 2 : .2f}KB", end="\r")

assert(len(data_chunk) == PER_DUMP_SIZE)
ptr += len(data_chunk)
f = open(FILE_PATH, 'ab')
f.write(data_chunk)
f.flush()
f.close()
print("chunk saved to dump file")


31 changes: 31 additions & 0 deletions devices/ZP120/UBOOT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Serial console output without NAND flash

```
U-Boot 1.1.1(1-16-3-0.9), Build: 0.9

MPC8272 Reset Status: External Soft, External Hard

MPC8272 Clock Configuration
- Bus-to-Core Mult 3x, VCO Div 4, 60x Bus Freq 16-50 , Core Freq 50-150
- dfbrg 1, corecnf 0x10, busdf 3, cpmdf 1, plldf 0, pllmf 3
- vco_out 400000000, scc_clk 100000000, brg_clk 25000000
- cpu_clk 300000000, cpm_clk 200000000, bus_clk 100000000
- pci_clk 33333333

CPU: MPC8272 (HiP7 Rev 14, Mask unknown [immr=0x0d10,k=0x00e1]) at 300 MHz
Board: Sonos Wembley
DRAM: 32 MB
DRAM test
Test complete - 0 errors, error pattern 00000000
Using default environment

In: serial
Out: serial
Err: serial
Net: FCC2 ETHERNET
Hit any key to stop autoboot: 0
NAND ID is 00:4e
Unknown or defective NAND flash device
bootfail 401
=>
```
Binary file added devices/ZP120/dumps/flash/EN29LV512.BIN
Binary file not shown.
Binary file added devices/ZP120/dumps/flash/NAND256W3A2B.BIN
Binary file not shown.
Binary file added devices/ZP120/filesystems/diagfs.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/LEGACYCOMPATVER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
36.0-00000
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/MINCOMPATVER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
53.0-00000
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
54.2-72160
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/ash
Binary file added devices/ZP120/filesystems/diagfs/bin/busybox
Binary file not shown.
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/cat
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/chmod
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/cp
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/date
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/dd
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/df
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/dmesg
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/dnsdomainname
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/echo
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/false
Binary file added devices/ZP120/filesystems/diagfs/bin/formatjffs
Binary file not shown.
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/grep
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/hostname
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/kill
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/ln
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/login
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/ls
Binary file added devices/ZP120/filesystems/diagfs/bin/mdputil
Binary file not shown.
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/mkdir
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/more
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/mount
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/mv
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/netstat
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/pidof
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/ping
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/ps
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/pwd
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/rm
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/rmdir
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/sh
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/sleep
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/sync
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/touch
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/true
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/umount
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/uname
Binary file added devices/ZP120/filesystems/diagfs/bin/upgrade
Binary file not shown.
Binary file added devices/ZP120/filesystems/diagfs/bin/upgrade_mgr
Binary file not shown.
1 change: 1 addition & 0 deletions devices/ZP120/filesystems/diagfs/bin/vi
8 changes: 8 additions & 0 deletions devices/ZP120/filesystems/diagfs/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build.date = 2019-12-16 21:07:18.154376
build.sysinfo = Linux LIN-200 4.4.0-128-generic #154-Ubuntu SMP Fri May 25 14:15:18 UTC 2018 x86_64 x86_64
build.arch.type = ppc
build.scm.version = 660463
build.scm.path = //depot/branches/2019_r7_release
build.type = release
build.host = LIN-200
build.version = 54.2-72160
Loading