Mikrotik SPI-NOR flash not reading partitions
Mark Ter Morshuizen
mark at honingklip.co.za
Thu Jun 25 07:58:29 PDT 2026
Hi,
I'm trying to get 25.12.4 going on a Mikrotik SXT2nD r2.
The hardware is very similar to the supported SXT5nD r2 but the SPI NOR
flash chips seem to be different.
Under 19.10.7 ar71xx both devices worked fine with the image for the
SXT5nD r2.
The flash chip on the SXT2nD r2 is a Macronix MX25L512E which seems to
be detected but not read.
[ 0.680690] 1 fixed-partitions partitions found on MTD device spi0.0
[ 0.687811] Creating 1 MTD partitions on "spi0.0":
[ 0.692795] 0x000000000000-0x000000020000 : "RouterBoot"
[ 0.698334] mtd: partition "RouterBoot" extends beyond the end of
device "spi0.0" -- size truncated to 0x10000
[ 0.711227] RouterBoot: routerboot partition
/ahb/spi at 1f000000/flash at 0/partitions/partition at 0/partition at 10000
(/ahb/spi at 1f000000/flash at 0/partitions/partition at 0) "bootloader2" extends
past end of segment.
[ 0.730089] RouterBoot: error parsing routerboot partition
/ahb/spi at 1f000000/flash at 0/partitions/partition at 0/partition at 10000
(/ahb/spi at 1f000000/flash at 0/partitions/partition at 0)
[ 0.746245] Failed to parse subpartitions: -22
[ 0.750853] Deleting MTD partitions on "spi0.0":
[ 0.755622] Deleting RouterBoot MTD partition
[ 0.760138] ------------[ cut here ]------------
[ 0.764913] WARNING: CPU: 0 PID: 1 at block/genhd.c:668
del_mtd_blktrans_dev+0x34/0x128
[ 0.773235] Modules linked in:
[ 0.776419] CPU: 0 UID: 0 PID: 1 Comm: swapper Not tainted 6.12.92 #0
[ 0.783084] Hardware name: MikroTik RouterBOARD SXT 2nD r2 (SXT Lite2)
[ 0.789832] Stack : 00000000 00000004 00000000 ffffffff 81837824
00000000 00000001 00000100
[ 0.798512] 81838368 808c2c88 80a3c00f 80b733d0 00000000
00000001 818377d0 1a894f80
[ 0.807185] 00000000 00000000 808c2c88 81837700 ffffefff
00000000 ffffffea 00000057
[ 0.815859] 8183770c 00000057 809b9670 ffffffff 00000001
00000000 808c2c88 00000000
[ 0.824532] 00000000 0000029c 81a6ba18 81a6a6b8 00000018
804bbe34 00000000 80b70000
[ 0.833206] ...
[ 0.835742] Call Trace:
[ 0.838269] [<80066870>] show_stack+0x28/0xf0
[ 0.842805] [<807c9364>] dump_stack_lvl+0x48/0x7c
[ 0.847705] [<80084c80>] __warn+0x9c/0x118
[ 0.851962] [<80084d58>] warn_slowpath_fmt+0x5c/0xac
[ 0.857104] [<804faa74>] del_mtd_blktrans_dev+0x34/0x128
[ 0.862614] [<804fa5e8>] blktrans_notify_remove+0x80/0xc0
[ 0.868205] [<804f0d04>] del_mtd_device+0x5c/0xe8
[ 0.873080] [<804f35cc>] __del_mtd_partitions+0xb8/0xf4
[ 0.878492] [<804f45f0>] del_mtd_partitions+0x48/0x6c
[ 0.883724] [<804f4c0c>] add_mtd_partitions+0xc4/0x24c
[ 0.889046] [<804f4984>] parse_mtd_partitions+0x370/0x534
[ 0.894637] [<804f0f2c>] mtd_device_parse_register+0x19c/0x424
[ 0.900677] [<805250a4>] spi_nor_probe+0x268/0x2f8
[ 0.905659] [<804d1a38>] really_probe+0xd4/0x34c
[ 0.910453] [<804d1fc0>] driver_probe_device+0x48/0x110
[ 0.915864] [<804d2158>] __device_attach_driver+0xd0/0x118
[ 0.921545] [<804cf510>] bus_for_each_drv+0x7c/0xc8
[ 0.926598] [<804d24ec>] __device_attach+0x114/0x180
[ 0.931741] [<804d0774>] bus_probe_device+0xb0/0xd8
[ 0.936794] [<804cd1d0>] device_add+0x55c/0x790
[ 0.941517] [<80543dac>] __spi_add_device+0x134/0x22c
[ 0.946749] [<80545c30>] spi_register_controller+0x880/0xbf0
[ 0.952609] [<804d4618>] platform_probe+0x50/0xb0
[ 0.957492] [<804d1a38>] really_probe+0xd4/0x34c
[ 0.962277] [<804d1fc0>] driver_probe_device+0x48/0x110
[ 0.967689] [<804d2250>] __driver_attach+0xb0/0x180
[ 0.972742] [<804cf314>] bus_for_each_dev+0x70/0xb8
[ 0.977795] [<804d0abc>] bus_add_driver+0x17c/0x228
[ 0.982849] [<804d2e34>] driver_register+0x88/0x154
[ 0.987902] [<80060638>] do_one_initcall+0x50/0x2bc
[ 0.992955] [<80a3f1f0>] kernel_init_freeable+0x1f4/0x284
[ 0.998556] [<807f5790>] kernel_init+0x20/0x10c
[ 1.003259] [<80061b58>] ret_from_kernel_thread+0x14/0x1c
[ 1.008852]
[ 1.010440] ---[ end trace 0000000000000000 ]---
My .dts has:
&spi {
status = "okay";
flash at 0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition at 0 {
label = "RouterBoot";
reg = <0x0 0x20000>;
compatible = "mikrotik,routerboot-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition at 0 {
label = "bootloader1";
reg = <0x0 0x0>;
read-only;
};
hard_config {
read-only;
};
bios {
size = <0x1000>;
read-only;
};
soft_config {
};
partition at 10000 {
label = "bootloader2";
reg = <0x10000 0x10000>;
read-only;
};
};
};
};
};
I've tried updating the firmware in Mikrotik Winbox. That made no
difference.
Dumping mtd3 results in a 64 kb file.
How do I go about figuring out why this does not work?
--
Mark Ter Morshuizen
More information about the openwrt-devel
mailing list