向OpenWRT中添加新设备支持

这里还是向OpenWRT中添加对小度路由的支持

向 target/linux/ramips/image/makefile中写入新设备


image/build/profile/mt7620a_CLZ=$(call buildFirmware/Default8M/$(1),$(1),mt7620a_clz,MT7620a_CLZ)
$(call image/Build/Profile/MT7620a_CLZ,$(1))
base-files中的一些可用配置:



base-files/etc/diag.sh  控制LED在OpenWRT启动时是否闪烁
base-files/lib/upgrade/platform.sh  允许sysupgrade工作
base-files/etc/uci-defaults/network to configure(安装) default network interface(界面) settings, particularly MAC addresses
base-files/etc/uci-defaults/leds if you have configurable(可配置的) LEDs which should default to a behavior(行为), like a WLAN activity LED
base-files/etc/hotplug.d/firmware(固件)/10-rt2x00-eeprom to extract(提取) the firmware image for the wireless(无线的) module
base-files/lib/preinit/06_set_iface_mac to set the MAC addresses of any other interfaces(界面)




编写的小度路由用的dts文件

/dts-v1/;

/include/ "mt7620a.dtsi"

/ {
	compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
	model = "Ralink MT7620A xiaodu board";

	palmbus@10000000 {
		sysc@0 {
			ralink,gpiomux = "i2c";
			ralink,uartmux = "gpio";
			ralink,wdtmux = <1>;
		};

		gpio0: gpio@600 {
			status = "okay";
		};

		spi@b00 {
			status = "okay";

			w25q64bv@0 {
				#address-cells = <1>;
				#size-cells = <1>;
				compatible = "w25q64bv";
				reg = <0 0>;
				linux,modalias = "w25q64bv";
				spi-max-frequency = <1000000>;

				partition@0 {
					label = "u-boot";
					reg = <0x0 0x30000>;
					read-only;
				};

				partition@30000 {
					label = "u-boot-env";
					reg = <0x30000 0x10000>;
					read-only;
				};

				factory: partition@40000 {
					label = "factory";
					reg = <0x40000 0x10000>;
					read-only;
				};

				partition@50000 {
					label = "firmware";
					reg = <0x50000 0x6b0000>;
				};

				partition@700000 {
					label = "usercfg";
					reg = <0x700000 0x100000>;
				};
			};
		};
	};

	ethernet@10100000 {
		status = "okay";

		pinctrl-names = "default";
		pinctrl-0 = <&ephy_pins>;

		ralink,port-map = "llllw";
	};

	gsw@10110000 {
		ralink,port4 = "ephy";
	};

	sdhci@10130000 {
		status = "okay";
	};

	pcie@10140000 {
		status = "okay";
	};

	gpio-keys-polled {
		compatible = "gpio-keys";
		#address-cells = <1>;
		#size-cells = <0>;
		poll-interval = <20>;
		wps {
			label = "wps";
			gpios = <&gpio0 12 1>;
			linux,code = <0x100>;
		};
		reset {
			label = "reset";
			gpios = <&gpio0 13 1>;
			linux,code = <0x101>;
		};
	};
};

添加设备后,最好需要将之前编译产生的临时文件删除,语句如下

 cd trunk
 rm -rf tmp
 make menuconfig


本文章由作者:佐须之男 整理编辑,原文地址: 向OpenWRT中添加新设备支持
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资 源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。
分享到:更多

相关推荐

网友评论(0)