以RT5350芯片为例
修改target/linux/ramips/image/makefile文件
修改base-files/lib/ramips.sh文件
target/linux/ramips/dts/ 目录下新增文件
target/linux/ramips/rt305x/profiles/ 目录下新增文件
….大概7.8个文件,具体修改方式参照里面已经有的设备几个,复制查找替换而已
可以参考 http://heffer.fedorapeople.org/openwrt/old/0002-ramips-add-Poray-M4.patch
如果使用了mkporayfw之类的firmware生成工具, tools/firmware-utils/ 也需要新增相关内容
1 2 3 |
cd trunk rm -rf tmp make menuconfig |
http://wiki.openwrt.org/doc/devel/add.new.device 官方说明,新版本变动较大。
—————————————————————————————————————————-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
From 3ed1990677952a7c2f1aab046cfd9f13208c25d8 Mon Sep 17 00:00:00 2001 From: Felix Kaechele <felix@fetzig.org> Date: Fri, 5 Apr 2013 01:24:16 +0200 Subject: [PATCH 2/2] [ramips] add Poray M4 Signed-off-by: Felix Kaechele <felix@fetzig.org> Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr> Signed-off-by: Luis Soltero <lsoltero@globalmarinenet.com> --- target/linux/ramips/base-files/etc/diag.sh | 3 + .../ramips/base-files/etc/uci-defaults/02_network | 6 +- .../ramips/base-files/lib/preinit/06_set_iface_mac | 3 +- target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/M4-4M.dts | 103 +++++++++++++++++++++ target/linux/ramips/dts/M4-8M.dts | 103 +++++++++++++++++++++ target/linux/ramips/image/Makefile | 3 + target/linux/ramips/rt305x/profiles/poray.mk | 10 ++ 9 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 target/linux/ramips/dts/M4-4M.dts create mode 100644 target/linux/ramips/dts/M4-8M.dts diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index c699695..f1ec82f 100755 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -52,6 +52,9 @@ get_status_led() { m3) status_led="m3:blue:status" ;; + m4) + status_led="m4:blue:status" + ;; mofi3500-3gn) status_led="mofi3500-3gn:green:status" ;; diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network index 4b6978b..db65b63 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/02_network +++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network @@ -131,7 +131,8 @@ ramips_setup_interfaces() wli-tx4-ag300n) ucidef_set_interface_lan "eth0" ;; - m3) + m3 | + m4) swconfig dev rt305x set reset 1 ucidef_set_interface_lan "eth0" ;; @@ -214,7 +215,8 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) ;; - m3) + m3 | + m4) lan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(macaddr_add "$lan_mac" -1) ;; diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac index 3c4951e..f46a123 100644 --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac @@ -68,7 +68,8 @@ preinit_set_mac_address() { mac=$(mtd_get_mac_binary factory 40) ifconfig eth0 hw ether $mac 2>/dev/null ;; - m3) + m3 | + m4) mac=$(mtd_get_mac_binary factory 4) mac=$(macaddr_add "$mac" -1) ifconfig eth0 hw ether $mac 2>/dev/null diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index ba409e9..b6609cd 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -141,6 +141,9 @@ ramips_board_detect() { *"Poray M3") name="m3" ;; + *"Poray M4") + name="m4" + ;; *"PWH2004") name="pwh2004" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 4833c5f..de6fcec 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -39,6 +39,7 @@ platform_check_image() { freestation5 | hw550-3g | m3 | + m4 | mofi3500-3gn | mzk-w300nh2 | nbg-419n | diff --git a/target/linux/ramips/dts/M4-4M.dts b/target/linux/ramips/dts/M4-4M.dts new file mode 100644 index 0000000..a428bda --- /dev/null +++ b/target/linux/ramips/dts/M4-4M.dts @@ -0,0 +1,103 @@ +/dts-v1/; + +/include/ "rt5350.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "M4", "ralink,rt5350-soc"; + model = "Poray M4"; + + memorydetect { + ralink,memory = <0x0 0x200000 0x4000000>; + }; + + palmbus@10000000 { + sysc@0 { + ralink,pinmmux = "i2c", "spi", "uartlite", "jtag", "mdio", "sdram", "rgmii"; + ralink,uartmux = "gpio"; + ralink,wdtmux = <1>; + }; + + gpio0: gpio@600 { + status = "okay"; + }; + + spi@b00 { + status = "okay"; + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "pm25lq032"; + reg = <0 0>; + linux,modalias = "m25p80", "pm25lq032"; + spi-max-frequency = <10000000>; + + partition@0 { + reg = <0x0 0x30000>; + label = "u-boot"; + read-only; + }; + + partition@30000 { + reg = <0x30000 0x10000>; + label = "u-boot-env"; + read-only; + }; + + factory: partition@40000 { + reg = <0x40000 0x10000>; + label = "factory"; + read-only; + }; + + partition@50000 { + reg = <0x50000 0x3b0000>; + label = "firmware"; + }; + }; + }; + }; + + ethernet@10100000 { + status = "okay"; + }; + + esw@10110000 { + status = "okay"; + ralink,portmap = <0x2f>; + }; + + gpio-leds { + compatible = "gpio-leds"; + status { + label = "m4:blue:status"; + gpios = <&gpio0 9 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 10 1>; + linux,code = <0x198>; + }; + }; + + wmac@10180000 { + status = "okay"; + ralink,mtd-eeprom = <&factory 0>; + }; + + ehci@101c0000 { + status = "okay"; + }; + + ohci@101c1000 { + status = "okay"; + }; +}; diff --git a/target/linux/ramips/dts/M4-8M.dts b/target/linux/ramips/dts/M4-8M.dts new file mode 100644 index 0000000..6e5b1f5 --- /dev/null +++ b/target/linux/ramips/dts/M4-8M.dts @@ -0,0 +1,103 @@ +/dts-v1/; + +/include/ "rt5350.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "M4", "ralink,rt5350-soc"; + model = "Poray M4"; + + memorydetect { + ralink,memory = <0x0 0x200000 0x4000000>; + }; + + palmbus@10000000 { + sysc@0 { + ralink,pinmmux = "i2c", "spi", "uartlite", "jtag", "mdio", "sdram", "rgmii"; + ralink,uartmux = "gpio"; + ralink,wdtmux = <1>; + }; + + gpio0: gpio@600 { + status = "okay"; + }; + + spi@b00 { + status = "okay"; + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "gd25q64"; + reg = <0 0>; + linux,modalias = "m25p80", "gd25q64"; + spi-max-frequency = <10000000>; + + partition@0 { + reg = <0x0 0x30000>; + label = "u-boot"; + read-only; + }; + + partition@30000 { + reg = <0x30000 0x10000>; + label = "u-boot-env"; + read-only; + }; + + factory: partition@40000 { + reg = <0x40000 0x10000>; + label = "factory"; + read-only; + }; + + partition@50000 { + reg = <0x50000 0x7b0000>; + label = "firmware"; + }; + }; + }; + }; + + ethernet@10100000 { + status = "okay"; + }; + + esw@10110000 { + status = "okay"; + ralink,portmap = <0x2f>; + }; + + gpio-leds { + compatible = "gpio-leds"; + status { + label = "m4:blue:status"; + gpios = <&gpio0 9 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 10 1>; + linux,code = <0x198>; + }; + }; + + wmac@10180000 { + status = "okay"; + ralink,mtd-eeprom = <&factory 0>; + }; + + ehci@101c0000 { + status = "okay"; + }; + + ohci@101c1000 { + status = "okay"; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index c44a150..7bec7fb 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -319,6 +319,8 @@ Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freest Image/Build/Profile/M3=$(call BuildFirmware/Default4M/$(1),$(1),m3,M3) +Image/Build/Profile/M4=$(call BuildFirmware/DefaultDualSize/$(1),$(1),m4,M4) + Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN) Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N) @@ -432,6 +434,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/FREESTATION5,$(1)) $(call Image/Build/Profile/HW550-3G,$(1)) $(call Image/Build/Profile/M3,$(1)) + $(call Image/Build/Profile/M4,$(1)) $(call Image/Build/Profile/MOFI3500-3GN,$(1)) $(call Image/Build/Profile/MZKW300NH2,$(1)) $(call Image/Build/Profile/NBG-419N,$(1)) diff --git a/target/linux/ramips/rt305x/profiles/poray.mk b/target/linux/ramips/rt305x/profiles/poray.mk index 9c76c78..8774a2b 100644 --- a/target/linux/ramips/rt305x/profiles/poray.mk +++ b/target/linux/ramips/rt305x/profiles/poray.mk @@ -15,3 +15,13 @@ define Profile/M3/Description endef $(eval $(call Profile,M3)) + +define Profile/M4 + NAME:=Poray M4 + PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-netdev kmod-ledtrig-timer +endef +define Profile/M4/Description + Package set for Poray M4 board +endef + +$(eval $(call Profile,M4)) -- 1.8.1.4 |
更多信息参考 http://80465.diandian.com/post/2013-09-04/40052660324