oraybox r300-1121g openwrt

参考

https://mirror.tuna.tsinghua.edu.cn/help/openwrt/
https://github.com/mhycy/openwrt-r300a
https://gitee.com/openwrt-mirror

dts

#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "oray,r300a", "ralink,mt7620a-soc";
	model = "Oray R300A";

	aliases {
		label-mac-device = &wmac;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	leds {
		compatible = "gpio-leds";

		red_sys {
			label = "red:sys";
			default-state = "on";
			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
		};

		blue_wifi {
			label = "blue:wifi";
			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
		};

		blue_sys {
			label = "blue:sys";
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
		};

		green_sys {
			label = "green:sys";
			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
		};
		
		blue_link1 {
			label = "blue:link1";
			gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
		};

		blue_siginal1 {
			label = "blue:siginal1";
			gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
		};

		blue_siginal2 {
			label = "blue:siginal2";
			gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
		};

		blue_siginal3 {
			label = "blue:siginal3";
			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
		};

		blue_link2 {
			label = "blue:link2";
			gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys";

		wps {
			label = "wps";
			gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WPS_BUTTON>;
		};

		reset {
			label = "reset";
			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_RESTART>;
		};
	};

	gpio_export {
		compatible = "gpio-export";
		#size-cells = <0>;
		
		cpe_pwr {
			gpio-export,name = "gpio13";
			gpio-export,output = <1>;
			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		};

		usb_pwr {
			gpio-export,name = "gpio14";
			gpio-export,output = <1>;
			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		};

		sim_sel {
			gpio-export,name = "gpio39";
			gpio-export,output = <1>;
			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
		};
	};
};

&gpio1 {
	status = "okay";
};

&gpio2 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

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

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

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

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

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0xf90000>;
			};

			bdinfo: partition@fe0000 {
				label = "bdinfo";
				reg = <0xfe0000 0x10000>;
				read-only;
			};

			partition@ff0000 {
				label = "reserve";
				reg = <0xff0000 0x10000>;
				read-only;
			};
		};
	};
};

&sdhci {
	status = "okay";
};

&ehci {
	status = "okay";
};

&ohci {
	status = "okay";
};

&ethernet {
	mtd-mac-address = <&bdinfo 0x9>;
	mediatek,portmap = "wllll";
};

&wmac {
	ralink,mtd-eeprom = <&factory 0x0>;
};

&state_default {
	gpio {
		groups = "ephy", "uartf", "spi refclk";
		function = "gpio";
	};
};

/etc/config/wireless

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/10180000.wmac'
        option channel 'auto'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option txpower '20'
        option country 'CN'

config wifi-iface 'wlan0'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'EH-LTE'
        option encryption 'openwrt'
        option key '1234567890'

/etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'


config interface 'lan'
	option ifname 'eth0.1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '172.17.2.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我在长沙玩技术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值