SWRT-dev / swrt-gpl

support bcm470x ipq40xx ipq807x mt7621 mt798x

Home Page:https://swrt.site/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to boot this with stock bootloader and u-boot (sercomm) or should I switch to BREED?

romanovj opened this issue · comments

My device is the same as RM-AC2100(128MB NAND, 128MB RAM, MT7621/MT7603/MT7615/MT7530) partition table for openwrt

	ubi-concat {
		compatible = "mtd-concat";
		devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2>;

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

			partition@0 {
				label = "ubi";
				reg = <0x0 0x4f80000>;
			};
		};
	};
};

&nand {
	status = "okay";

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

		partition@0 {
			label = "u-boot";
			reg = <0x0 0x100000>;
			sercomm,scpart-id = <0>;
			read-only;
		};

		partition@100000 {
			label = "dynamic partition map";
			reg = <0x100000 0x100000>;
			sercomm,scpart-id = <1>;
			read-only;
		};

		factory: partition@200000 {
			label = "Factory";
			reg = <0x200000 0x100000>;
			sercomm,scpart-id = <2>;
			read-only;

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

				eeprom_factory_0: eeprom@0 {
					reg = <0x0 0x400>;
				};

				eeprom_factory_8000: eeprom@8000 {
					reg = <0x8000 0x4da8>;
				};

				macaddr_factory_21000: macaddr@21000 {
					compatible = "mac-base";
					reg = <0x21000 0x6>;
					#nvmem-cell-cells = <1>;
				};
			};
		};

		partition@300000 {
			label = "Boot Flag";
			reg = <0x300000 0x100000>;
			sercomm,scpart-id = <3>;
		};

		partition@400000 {
			label = "kernel";
			reg = <0x400000 0x600000>;
			sercomm,scpart-id = <4>;
		};

		partition@a00000 {
			label = "Kernel 2";
			reg = <0xa00000 0x600000>;
			sercomm,scpart-id = <5>;
			read-only;
		};

		ubiconcat0: partition@1000000 {
			label = "File System 1";
			reg = <0x1000000 0x2000000>;
			sercomm,scpart-id = <6>;
		};

		partition@3000000 {
			label = "File System 2";
			reg = <0x3000000 0x2000000>;
			sercomm,scpart-id = <7>;
			read-only;
		};

		ubiconcat1: partition@5000000 {
			label = "Configuration/log";
			reg = <0x5000000 0x1400000>;
			sercomm,scpart-id = <8>;
		};

		ubiconcat2: partition@6400000 {
			label = "application tmp buffer (Ftool)";
			reg = <0x6400000 0x1b80000>;
			sercomm,scpart-id = <9>;
		};
	};
};

Currently I'm using LEDE with 5.4 kernel with mtk_eth driver + hwnat 1.1 SW version and I have no problems with loading my own compiled mt7615e driver from this repo. So I'm thinking about creating dts for my device and compiling swrt. But I want to keep stock BL.

I don't have your device so I'm not sure, if you want to add support for your device, you can creating a pull request and I'll check if it's correct(partition table, gpio, etc.).

@paldier which partitions should I have?
Factory
Kernel (6MB is enough?)
jffs2

Openwrt is using:
Factory -1MB
Kernel - 6MB
Ubi - mtd-concat ~80MB

So I don't need to change partition table for openwrt.

Actually one thing is to compile kernel, dtb and rootfs, but another is to load these with stock bootloader. In theory after compiling kernel, dtb, rootfs I can pack it with scripts from openwrt, just need to change ubifs to jffs2.

KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma -a0 | \
        uImage lzma
IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \
        append-ubi | sercomm-factory-cqr | sercomm-mkhash

I'm closing for now. Creating dts isn't a problem, currently I have no time for experiments with booting.