Since I haven't received any reply in my old topic (forum.openwrt org/viewtopic.php?pid=348937 ) I thought I start here.
The issues I'm having so far:
- cannot break uboot default
- can't figure out GPIOs (maybe some of them are hardcoded), only found out about the red LED and the reset button
- the default image has 5 mtd blocks, not sure if I'm declaring them correctly, see below
- can't figure out how to load to SDRAM for testing since I cannot boot to uboot. Is there any way to do this from the normal boot environment?
- recommended naming conventions for new devices?
What was achieved so far:
- identified flash chip and added declaration into the DTS file
- dumped mtdblock 0 through 5
- know where the blocks above are situated in the SPI flash
- have the kernel config file from the factory firmware
- I think I know what devices and modules need to be included
- can flash individual blocks from factory firmware (mtdwrite)
# cat /proc/cpuinfo
system type : Ralink SoC
processor : 0
cpu model : MIPS 24Kc V4.12
BogoMIPS : 239.61
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0004, 0x0ec4, 0x0ff8, 0x0803]
ASEs implemented : mips16 dsp
shadow register sets : 1
core : 0
VCED exceptions : not available
VCEI exceptions : not available
# cat /proc/mtd
dev: size erasesize name
mtd0: 00800000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Factory"
mtd4: 001c0000 00010000 "MiniSystem"
mtd5: 005f0000 00010000 "Kernel"
Normal boot:
## Booting image at bc210000 ...
raspi_read: from:210000 len:40
. Image Name: Linux Kernel Image
Created: 2013-09-09 8:53:17 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 6025942 Bytes = 5.7 MB
Load Address: 80000000
Entry Point: 8000c310
raspi_read: from:210040 len:5bf2d6
Minisystem (failsafe) boot:
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: Linux Kernel Image
Created: 2013-03-11 6:20:33 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1649876 Bytes = 1.6 MB
Load Address: 80000000
Entry Point: 8000c310
raspi_read: from:50040 len:192cd4
Snippet from my dts file:
&spi0 {
status = "okay";
en25q64@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
linux,modalias = "m25p80", "en25q64";
spi-max-frequency = <10000000>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x1000>;
read-only;
};
partition@31000 {
label = "config";
reg = <0x31000 0xf000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
};
Do I need the u-boot-env partition?
Factory is the same as minisystem?
Edit: it seems that uboot-env is also used in the original firmware, or at least I assume so:
U-Boot 1.1.3 (Apr 19 2013 - 00:35:05)
Board: Ralink APSoC DRAM: 64 MB
relocate_code Pointer at: 83fb4000
spi_wait_nsec: 42
spi device id: 1c 30 17 1c 30 (30171c30)
find flash: EN25Q64
raspi_read: from:30000 len:1000
.*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 4.0.1.0
I have no idea why there are 2 config partitions (64kb each). The first one seems to store router settings while the second one is for WiFi register definitions? It only uses the first 0x12b (299) bytes.
I'm not looking for someone to solve the problems for me, just hints.
(Last edited by brainwash on 11 Jan 2017, 10:04)