002-0004-board-mediatek-add-MT7981-reference-boards.patch 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. From 89a31bfa05c384a2b4e56ddb9814633325b7feab Mon Sep 17 00:00:00 2001
  2. From: Weijie Gao <[email protected]>
  3. Date: Fri, 29 Jul 2022 16:02:37 +0800
  4. Subject: [PATCH 04/31] board: mediatek: add MT7981 reference boards
  5. This patch adds general board files based on MT7981 SoCs.
  6. MT7981 uses one mmc controller for booting from both SD and eMMC, and the
  7. pins of mmc controller are also shared with spi controller.
  8. So three configs are need for these boot types:
  9. 1. mt7981_rfb_defconfig - SPI-NOR and SPI-NAND
  10. 2. mt7981_emmc_rfb_defconfig - eMMC only
  11. 3. mt7981_sd_rfb_defconfig - SD only
  12. Signed-off-by: Weijie Gao <[email protected]>
  13. ---
  14. arch/arm/dts/Makefile | 3 +
  15. arch/arm/dts/mt7981-emmc-rfb.dts | 139 +++++++++++++++++++++++
  16. arch/arm/dts/mt7981-rfb.dts | 173 +++++++++++++++++++++++++++++
  17. arch/arm/dts/mt7981-sd-rfb.dts | 139 +++++++++++++++++++++++
  18. board/mediatek/mt7981/MAINTAINERS | 10 ++
  19. board/mediatek/mt7981/Makefile | 3 +
  20. board/mediatek/mt7981/mt7981_rfb.c | 10 ++
  21. configs/mt7981_emmc_rfb_defconfig | 64 +++++++++++
  22. configs/mt7981_rfb_defconfig | 69 ++++++++++++
  23. configs/mt7981_sd_rfb_defconfig | 64 +++++++++++
  24. include/configs/mt7981.h | 26 +++++
  25. 11 files changed, 700 insertions(+)
  26. create mode 100644 arch/arm/dts/mt7981-emmc-rfb.dts
  27. create mode 100644 arch/arm/dts/mt7981-rfb.dts
  28. create mode 100644 arch/arm/dts/mt7981-sd-rfb.dts
  29. create mode 100644 board/mediatek/mt7981/MAINTAINERS
  30. create mode 100644 board/mediatek/mt7981/Makefile
  31. create mode 100644 board/mediatek/mt7981/mt7981_rfb.c
  32. create mode 100644 configs/mt7981_emmc_rfb_defconfig
  33. create mode 100644 configs/mt7981_rfb_defconfig
  34. create mode 100644 configs/mt7981_sd_rfb_defconfig
  35. create mode 100644 include/configs/mt7981.h
  36. --- a/arch/arm/dts/Makefile
  37. +++ b/arch/arm/dts/Makefile
  38. @@ -1205,6 +1205,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
  39. mt7622-bananapi-bpi-r64.dtb \
  40. mt7623n-bananapi-bpi-r2.dtb \
  41. mt7629-rfb.dtb \
  42. + mt7981-rfb.dtb \
  43. + mt7981-emmc-rfb.dtb \
  44. + mt7981-sd-rfb.dtb \
  45. mt7986a-rfb.dtb \
  46. mt7986b-rfb.dtb \
  47. mt7986a-sd-rfb.dtb \
  48. --- /dev/null
  49. +++ b/arch/arm/dts/mt7981-emmc-rfb.dts
  50. @@ -0,0 +1,139 @@
  51. +// SPDX-License-Identifier: GPL-2.0
  52. +/*
  53. + * Copyright (c) 2022 MediaTek Inc.
  54. + * Author: Sam Shih <[email protected]>
  55. + */
  56. +
  57. +/dts-v1/;
  58. +#include "mt7981.dtsi"
  59. +#include <dt-bindings/gpio/gpio.h>
  60. +
  61. +/ {
  62. + #address-cells = <1>;
  63. + #size-cells = <1>;
  64. + model = "mt7981-rfb";
  65. + compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
  66. + chosen {
  67. + stdout-path = &uart0;
  68. + tick-timer = &timer0;
  69. + };
  70. +
  71. + reg_3p3v: regulator-3p3v {
  72. + compatible = "regulator-fixed";
  73. + regulator-name = "fixed-3.3V";
  74. + regulator-min-microvolt = <3300000>;
  75. + regulator-max-microvolt = <3300000>;
  76. + regulator-boot-on;
  77. + regulator-always-on;
  78. + };
  79. +};
  80. +
  81. +&uart0 {
  82. + status = "okay";
  83. +};
  84. +
  85. +&uart1 {
  86. + pinctrl-names = "default";
  87. + pinctrl-0 = <&uart1_pins>;
  88. + status = "disabled";
  89. +};
  90. +
  91. +&eth {
  92. + status = "okay";
  93. + mediatek,gmac-id = <0>;
  94. + phy-mode = "sgmii";
  95. + mediatek,switch = "mt7531";
  96. + reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
  97. +
  98. + fixed-link {
  99. + speed = <1000>;
  100. + full-duplex;
  101. + };
  102. +};
  103. +
  104. +&pinctrl {
  105. + spic_pins: spi1-pins-func-1 {
  106. + mux {
  107. + function = "spi";
  108. + groups = "spi1_1";
  109. + };
  110. + };
  111. +
  112. + uart1_pins: spi1-pins-func-3 {
  113. + mux {
  114. + function = "uart";
  115. + groups = "uart1_2";
  116. + };
  117. + };
  118. +
  119. + /* pin15 as pwm0 */
  120. + one_pwm_pins: one-pwm-pins {
  121. + mux {
  122. + function = "pwm";
  123. + groups = "pwm0_1";
  124. + };
  125. + };
  126. +
  127. + /* pin15 as pwm0 and pin14 as pwm1 */
  128. + two_pwm_pins: two-pwm-pins {
  129. + mux {
  130. + function = "pwm";
  131. + groups = "pwm0_1", "pwm1_0";
  132. + };
  133. + };
  134. +
  135. + /* pin15 as pwm0, pin14 as pwm1, pin7 as pwm2 */
  136. + three_pwm_pins: three-pwm-pins {
  137. + mux {
  138. + function = "pwm";
  139. + groups = "pwm0_1", "pwm1_0", "pwm2";
  140. + };
  141. + };
  142. +
  143. + mmc0_pins_default: mmc0default {
  144. + mux {
  145. + function = "flash";
  146. + groups = "emmc_45";
  147. + };
  148. + conf-cmd-dat {
  149. + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO",
  150. + "SPI0_CS", "SPI0_HOLD", "SPI0_WP",
  151. + "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO";
  152. + input-enable;
  153. + drive-strength = <MTK_DRIVE_4mA>;
  154. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  155. + };
  156. + conf-clk {
  157. + pins = "SPI1_CS";
  158. + drive-strength = <MTK_DRIVE_6mA>;
  159. + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
  160. + };
  161. + conf-rst {
  162. + pins = "PWM0";
  163. + drive-strength = <MTK_DRIVE_4mA>;
  164. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  165. + };
  166. + };
  167. +};
  168. +
  169. +&pwm {
  170. + pinctrl-names = "default";
  171. + pinctrl-0 = <&two_pwm_pins>;
  172. + status = "okay";
  173. +};
  174. +
  175. +&watchdog {
  176. + status = "disabled";
  177. +};
  178. +
  179. +&mmc0 {
  180. + pinctrl-names = "default";
  181. + pinctrl-0 = <&mmc0_pins_default>;
  182. + bus-width = <8>;
  183. + max-frequency = <52000000>;
  184. + cap-mmc-highspeed;
  185. + cap-mmc-hw-reset;
  186. + vmmc-supply = <&reg_3p3v>;
  187. + non-removable;
  188. + status = "okay";
  189. +};
  190. --- /dev/null
  191. +++ b/arch/arm/dts/mt7981-rfb.dts
  192. @@ -0,0 +1,173 @@
  193. +// SPDX-License-Identifier: GPL-2.0
  194. +/*
  195. + * Copyright (c) 2022 MediaTek Inc.
  196. + * Author: Sam Shih <[email protected]>
  197. + */
  198. +
  199. +/dts-v1/;
  200. +#include "mt7981.dtsi"
  201. +#include <dt-bindings/gpio/gpio.h>
  202. +
  203. +/ {
  204. + #address-cells = <1>;
  205. + #size-cells = <1>;
  206. + model = "mt7981-rfb";
  207. + compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
  208. + chosen {
  209. + stdout-path = &uart0;
  210. + tick-timer = &timer0;
  211. + };
  212. +};
  213. +
  214. +&uart0 {
  215. + status = "okay";
  216. +};
  217. +
  218. +&uart1 {
  219. + pinctrl-names = "default";
  220. + pinctrl-0 = <&uart1_pins>;
  221. + status = "disabled";
  222. +};
  223. +
  224. +&eth {
  225. + status = "okay";
  226. + mediatek,gmac-id = <0>;
  227. + phy-mode = "sgmii";
  228. + mediatek,switch = "mt7531";
  229. + reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
  230. +
  231. + fixed-link {
  232. + speed = <1000>;
  233. + full-duplex;
  234. + };
  235. +};
  236. +
  237. +&pinctrl {
  238. + spi_flash_pins: spi0-pins-func-1 {
  239. + mux {
  240. + function = "flash";
  241. + groups = "spi0", "spi0_wp_hold";
  242. + };
  243. +
  244. + conf-pu {
  245. + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
  246. + drive-strength = <MTK_DRIVE_8mA>;
  247. + bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
  248. + };
  249. +
  250. + conf-pd {
  251. + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
  252. + drive-strength = <MTK_DRIVE_8mA>;
  253. + bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
  254. + };
  255. + };
  256. +
  257. + spi2_flash_pins: spi2-spi2-pins {
  258. + mux {
  259. + function = "spi";
  260. + groups = "spi2", "spi2_wp_hold";
  261. + };
  262. +
  263. + conf-pu {
  264. + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
  265. + drive-strength = <MTK_DRIVE_8mA>;
  266. + bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
  267. + };
  268. +
  269. + conf-pd {
  270. + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
  271. + drive-strength = <MTK_DRIVE_8mA>;
  272. + bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
  273. + };
  274. + };
  275. +
  276. + spic_pins: spi1-pins-func-1 {
  277. + mux {
  278. + function = "spi";
  279. + groups = "spi1_1";
  280. + };
  281. + };
  282. +
  283. + uart1_pins: spi1-pins-func-3 {
  284. + mux {
  285. + function = "uart";
  286. + groups = "uart1_2";
  287. + };
  288. + };
  289. +
  290. + /* pin15 as pwm0 */
  291. + one_pwm_pins: one-pwm-pins {
  292. + mux {
  293. + function = "pwm";
  294. + groups = "pwm0_1";
  295. + };
  296. + };
  297. +
  298. + /* pin15 as pwm0 and pin14 as pwm1 */
  299. + two_pwm_pins: two-pwm-pins {
  300. + mux {
  301. + function = "pwm";
  302. + groups = "pwm0_1", "pwm1_0";
  303. + };
  304. + };
  305. +
  306. + /* pin15 as pwm0, pin14 as pwm1, pin7 as pwm2 */
  307. + three_pwm_pins: three-pwm-pins {
  308. + mux {
  309. + function = "pwm";
  310. + groups = "pwm0_1", "pwm1_0", "pwm2";
  311. + };
  312. + };
  313. +};
  314. +
  315. +&spi0 {
  316. + #address-cells = <1>;
  317. + #size-cells = <0>;
  318. + pinctrl-names = "default";
  319. + pinctrl-0 = <&spi_flash_pins>;
  320. + status = "okay";
  321. + must_tx;
  322. + enhance_timing;
  323. + dma_ext;
  324. + ipm_design;
  325. + support_quad;
  326. + tick_dly = <2>;
  327. + sample_sel = <0>;
  328. +
  329. + spi_nand@0 {
  330. + compatible = "spi-nand";
  331. + reg = <0>;
  332. + spi-max-frequency = <52000000>;
  333. + };
  334. +};
  335. +
  336. +&spi2 {
  337. + #address-cells = <1>;
  338. + #size-cells = <0>;
  339. + pinctrl-names = "default";
  340. + pinctrl-0 = <&spi2_flash_pins>;
  341. + status = "okay";
  342. + must_tx;
  343. + enhance_timing;
  344. + dma_ext;
  345. + ipm_design;
  346. + support_quad;
  347. + tick_dly = <2>;
  348. + sample_sel = <0>;
  349. +
  350. + spi_nor@0 {
  351. + compatible = "jedec,spi-nor";
  352. + reg = <0>;
  353. + spi-max-frequency = <52000000>;
  354. + };
  355. +};
  356. +
  357. +&pwm {
  358. + pinctrl-names = "default";
  359. + pinctrl-0 = <&two_pwm_pins>;
  360. + status = "okay";
  361. +};
  362. +
  363. +&watchdog {
  364. + status = "disabled";
  365. +};
  366. --- /dev/null
  367. +++ b/arch/arm/dts/mt7981-sd-rfb.dts
  368. @@ -0,0 +1,139 @@
  369. +// SPDX-License-Identifier: GPL-2.0
  370. +/*
  371. + * Copyright (c) 2022 MediaTek Inc.
  372. + * Author: Sam Shih <[email protected]>
  373. + */
  374. +
  375. +/dts-v1/;
  376. +#include "mt7981.dtsi"
  377. +#include <dt-bindings/gpio/gpio.h>
  378. +
  379. +/ {
  380. + #address-cells = <1>;
  381. + #size-cells = <1>;
  382. + model = "mt7981-rfb";
  383. + compatible = "mediatek,mt7981", "mediatek,mt7981-sd-rfb";
  384. + chosen {
  385. + stdout-path = &uart0;
  386. + tick-timer = &timer0;
  387. + };
  388. +
  389. + reg_3p3v: regulator-3p3v {
  390. + compatible = "regulator-fixed";
  391. + regulator-name = "fixed-3.3V";
  392. + regulator-min-microvolt = <3300000>;
  393. + regulator-max-microvolt = <3300000>;
  394. + regulator-boot-on;
  395. + regulator-always-on;
  396. + };
  397. +};
  398. +
  399. +&uart0 {
  400. + status = "okay";
  401. +};
  402. +
  403. +&uart1 {
  404. + pinctrl-names = "default";
  405. + pinctrl-0 = <&uart1_pins>;
  406. + status = "disabled";
  407. +};
  408. +
  409. +&eth {
  410. + status = "okay";
  411. + mediatek,gmac-id = <0>;
  412. + phy-mode = "sgmii";
  413. + mediatek,switch = "mt7531";
  414. + reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
  415. +
  416. + fixed-link {
  417. + speed = <1000>;
  418. + full-duplex;
  419. + };
  420. +};
  421. +
  422. +&pinctrl {
  423. + spic_pins: spi1-pins-func-1 {
  424. + mux {
  425. + function = "spi";
  426. + groups = "spi1_1";
  427. + };
  428. + };
  429. +
  430. + uart1_pins: spi1-pins-func-3 {
  431. + mux {
  432. + function = "uart";
  433. + groups = "uart1_2";
  434. + };
  435. + };
  436. +
  437. + /* pin15 as pwm0 */
  438. + one_pwm_pins: one-pwm-pins {
  439. + mux {
  440. + function = "pwm";
  441. + groups = "pwm0_1";
  442. + };
  443. + };
  444. +
  445. + /* pin15 as pwm0 and pin14 as pwm1 */
  446. + two_pwm_pins: two-pwm-pins {
  447. + mux {
  448. + function = "pwm";
  449. + groups = "pwm0_1", "pwm1_0";
  450. + };
  451. + };
  452. +
  453. + /* pin15 as pwm0, pin14 as pwm1, pin7 as pwm2 */
  454. + three_pwm_pins: three-pwm-pins {
  455. + mux {
  456. + function = "pwm";
  457. + groups = "pwm0_1", "pwm1_0", "pwm2";
  458. + };
  459. + };
  460. +
  461. + mmc0_pins_default: mmc0default {
  462. + mux {
  463. + function = "flash";
  464. + groups = "emmc_45";
  465. + };
  466. + conf-cmd-dat {
  467. + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO",
  468. + "SPI0_CS", "SPI0_HOLD", "SPI0_WP",
  469. + "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO";
  470. + input-enable;
  471. + drive-strength = <MTK_DRIVE_4mA>;
  472. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  473. + };
  474. + conf-clk {
  475. + pins = "SPI1_CS";
  476. + drive-strength = <MTK_DRIVE_6mA>;
  477. + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
  478. + };
  479. + conf-rst {
  480. + pins = "PWM0";
  481. + drive-strength = <MTK_DRIVE_4mA>;
  482. + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
  483. + };
  484. + };
  485. +};
  486. +
  487. +&pwm {
  488. + pinctrl-names = "default";
  489. + pinctrl-0 = <&two_pwm_pins>;
  490. + status = "okay";
  491. +};
  492. +
  493. +&watchdog {
  494. + status = "disabled";
  495. +};
  496. +
  497. +&mmc0 {
  498. + pinctrl-names = "default";
  499. + pinctrl-0 = <&mmc0_pins_default>;
  500. + bus-width = <4>;
  501. + max-frequency = <52000000>;
  502. + cap-sd-highspeed;
  503. + r_smpl = <0>;
  504. + vmmc-supply = <&reg_3p3v>;
  505. + vqmmc-supply = <&reg_3p3v>;
  506. + status = "okay";
  507. +};
  508. --- /dev/null
  509. +++ b/board/mediatek/mt7981/MAINTAINERS
  510. @@ -0,0 +1,10 @@
  511. +MT7981
  512. +M: Sam Shih <[email protected]>
  513. +S: Maintained
  514. +F: board/mediatek/mt7981
  515. +F: include/configs/mt7981.h
  516. +F: configs/mt7981_emmc_rfb_defconfig
  517. +F: configs/mt7981_rfb_defconfig
  518. +F: configs/mt7981_sd_rfb_defconfig
  519. +F: configs/mt7981_spim_nand_rfb_defconfig
  520. +F: configs/mt7981_spim_nor_rfb_defconfig
  521. --- /dev/null
  522. +++ b/board/mediatek/mt7981/Makefile
  523. @@ -0,0 +1,3 @@
  524. +# SPDX-License-Identifier: GPL-2.0
  525. +
  526. +obj-y += mt7981_rfb.o
  527. --- /dev/null
  528. +++ b/board/mediatek/mt7981/mt7981_rfb.c
  529. @@ -0,0 +1,10 @@
  530. +// SPDX-License-Identifier: GPL-2.0
  531. +/*
  532. + * Copyright (C) 2022 MediaTek Inc.
  533. + * Author: Sam Shih <[email protected]>
  534. + */
  535. +
  536. +int board_init(void)
  537. +{
  538. + return 0;
  539. +}
  540. --- /dev/null
  541. +++ b/configs/mt7981_emmc_rfb_defconfig
  542. @@ -0,0 +1,64 @@
  543. +CONFIG_ARM=y
  544. +CONFIG_POSITION_INDEPENDENT=y
  545. +CONFIG_ARCH_MEDIATEK=y
  546. +CONFIG_SYS_TEXT_BASE=0x41e00000
  547. +CONFIG_SYS_MALLOC_F_LEN=0x4000
  548. +CONFIG_NR_DRAM_BANKS=1
  549. +CONFIG_ENV_SIZE=0x80000
  550. +CONFIG_ENV_OFFSET=0x300000
  551. +CONFIG_DEFAULT_DEVICE_TREE="mt7981-emmc-rfb"
  552. +CONFIG_TARGET_MT7981=y
  553. +CONFIG_DEBUG_UART_BASE=0x11002000
  554. +CONFIG_DEBUG_UART_CLOCK=40000000
  555. +CONFIG_SYS_LOAD_ADDR=0x46000000
  556. +CONFIG_DEBUG_UART=y
  557. +# CONFIG_AUTOBOOT is not set
  558. +CONFIG_DEFAULT_FDT_FILE="mt7981-emmc-rfb"
  559. +CONFIG_LOGLEVEL=7
  560. +CONFIG_LOG=y
  561. +CONFIG_SYS_PROMPT="MT7981> "
  562. +CONFIG_SYS_CBSIZE=512
  563. +CONFIG_SYS_PBSIZE=1049
  564. +# CONFIG_BOOTM_NETBSD is not set
  565. +# CONFIG_BOOTM_PLAN9 is not set
  566. +# CONFIG_BOOTM_RTEMS is not set
  567. +# CONFIG_BOOTM_VXWORKS is not set
  568. +# CONFIG_CMD_ELF is not set
  569. +# CONFIG_CMD_UNLZ4 is not set
  570. +# CONFIG_CMD_UNZIP is not set
  571. +CONFIG_CMD_GPIO=y
  572. +CONFIG_CMD_GPT=y
  573. +CONFIG_CMD_GPT_RENAME=y
  574. +CONFIG_CMD_LSBLK=y
  575. +CONFIG_CMD_MMC=y
  576. +CONFIG_CMD_PART=y
  577. +CONFIG_CMD_READ=y
  578. +CONFIG_CMD_PING=y
  579. +CONFIG_CMD_SMC=y
  580. +CONFIG_CMD_FAT=y
  581. +CONFIG_CMD_FS_GENERIC=y
  582. +CONFIG_PARTITION_TYPE_GUID=y
  583. +CONFIG_ENV_OVERWRITE=y
  584. +CONFIG_ENV_IS_IN_MMC=y
  585. +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
  586. +CONFIG_NET_RANDOM_ETHADDR=y
  587. +CONFIG_REGMAP=y
  588. +CONFIG_SYSCON=y
  589. +CONFIG_CLK=y
  590. +CONFIG_MMC_HS200_SUPPORT=y
  591. +CONFIG_MMC_MTK=y
  592. +CONFIG_PHY_FIXED=y
  593. +CONFIG_DM_ETH=y
  594. +CONFIG_MEDIATEK_ETH=y
  595. +CONFIG_PINCTRL=y
  596. +CONFIG_PINCONF=y
  597. +CONFIG_PINCTRL_MT7981=y
  598. +CONFIG_POWER_DOMAIN=y
  599. +CONFIG_MTK_POWER_DOMAIN=y
  600. +CONFIG_DM_REGULATOR=y
  601. +CONFIG_DM_REGULATOR_FIXED=y
  602. +CONFIG_DM_SERIAL=y
  603. +CONFIG_MTK_SERIAL=y
  604. +CONFIG_FAT_WRITE=y
  605. +CONFIG_HEXDUMP=y
  606. +# CONFIG_EFI_LOADER is not set
  607. --- /dev/null
  608. +++ b/configs/mt7981_rfb_defconfig
  609. @@ -0,0 +1,69 @@
  610. +CONFIG_ARM=y
  611. +CONFIG_POSITION_INDEPENDENT=y
  612. +CONFIG_ARCH_MEDIATEK=y
  613. +CONFIG_SYS_TEXT_BASE=0x41e00000
  614. +CONFIG_SYS_MALLOC_F_LEN=0x4000
  615. +CONFIG_NR_DRAM_BANKS=1
  616. +CONFIG_DEFAULT_DEVICE_TREE="mt7981-rfb"
  617. +CONFIG_TARGET_MT7981=y
  618. +CONFIG_DEBUG_UART_BASE=0x11002000
  619. +CONFIG_DEBUG_UART_CLOCK=40000000
  620. +CONFIG_SYS_LOAD_ADDR=0x46000000
  621. +CONFIG_DEBUG_UART=y
  622. +# CONFIG_AUTOBOOT is not set
  623. +CONFIG_DEFAULT_FDT_FILE="mt7981-rfb"
  624. +CONFIG_LOGLEVEL=7
  625. +CONFIG_LOG=y
  626. +CONFIG_SYS_PROMPT="MT7981> "
  627. +CONFIG_SYS_CBSIZE=512
  628. +CONFIG_SYS_PBSIZE=1049
  629. +# CONFIG_BOOTM_NETBSD is not set
  630. +# CONFIG_BOOTM_PLAN9 is not set
  631. +# CONFIG_BOOTM_RTEMS is not set
  632. +# CONFIG_BOOTM_VXWORKS is not set
  633. +# CONFIG_CMD_ELF is not set
  634. +# CONFIG_CMD_UNLZ4 is not set
  635. +# CONFIG_CMD_UNZIP is not set
  636. +CONFIG_CMD_GPIO=y
  637. +CONFIG_CMD_MTD=y
  638. +CONFIG_CMD_SF_TEST=y
  639. +CONFIG_CMD_PING=y
  640. +CONFIG_CMD_SMC=y
  641. +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
  642. +CONFIG_NET_RANDOM_ETHADDR=y
  643. +CONFIG_REGMAP=y
  644. +CONFIG_SYSCON=y
  645. +CONFIG_BLK=y
  646. +CONFIG_HAVE_BLOCK_DEVICE=y
  647. +CONFIG_CLK=y
  648. +# CONFIG_MMC is not set
  649. +CONFIG_MTD=y
  650. +CONFIG_DM_MTD=y
  651. +CONFIG_MTD_SPI_NAND=y
  652. +CONFIG_DM_SPI_FLASH=y
  653. +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
  654. +CONFIG_SPI_FLASH_EON=y
  655. +CONFIG_SPI_FLASH_GIGADEVICE=y
  656. +CONFIG_SPI_FLASH_ISSI=y
  657. +CONFIG_SPI_FLASH_MACRONIX=y
  658. +CONFIG_SPI_FLASH_SPANSION=y
  659. +CONFIG_SPI_FLASH_STMICRO=y
  660. +CONFIG_SPI_FLASH_WINBOND=y
  661. +CONFIG_SPI_FLASH_XMC=y
  662. +CONFIG_SPI_FLASH_XTX=y
  663. +CONFIG_SPI_FLASH_MTD=y
  664. +CONFIG_PHY_FIXED=y
  665. +CONFIG_DM_ETH=y
  666. +CONFIG_MEDIATEK_ETH=y
  667. +CONFIG_PINCTRL=y
  668. +CONFIG_PINCONF=y
  669. +CONFIG_PINCTRL_MT7981=y
  670. +CONFIG_POWER_DOMAIN=y
  671. +CONFIG_MTK_POWER_DOMAIN=y
  672. +CONFIG_DM_SERIAL=y
  673. +CONFIG_MTK_SERIAL=y
  674. +CONFIG_SPI=y
  675. +CONFIG_DM_SPI=y
  676. +CONFIG_MTK_SPIM=y
  677. +CONFIG_HEXDUMP=y
  678. +# CONFIG_EFI_LOADER is not set
  679. --- /dev/null
  680. +++ b/configs/mt7981_sd_rfb_defconfig
  681. @@ -0,0 +1,64 @@
  682. +CONFIG_ARM=y
  683. +CONFIG_POSITION_INDEPENDENT=y
  684. +CONFIG_ARCH_MEDIATEK=y
  685. +CONFIG_SYS_TEXT_BASE=0x41e00000
  686. +CONFIG_SYS_MALLOC_F_LEN=0x4000
  687. +CONFIG_NR_DRAM_BANKS=1
  688. +CONFIG_ENV_SIZE=0x80000
  689. +CONFIG_ENV_OFFSET=0x300000
  690. +CONFIG_DEFAULT_DEVICE_TREE="mt7981-sd-rfb"
  691. +CONFIG_TARGET_MT7981=y
  692. +CONFIG_DEBUG_UART_BASE=0x11002000
  693. +CONFIG_DEBUG_UART_CLOCK=40000000
  694. +CONFIG_SYS_LOAD_ADDR=0x46000000
  695. +CONFIG_DEBUG_UART=y
  696. +# CONFIG_AUTOBOOT is not set
  697. +CONFIG_DEFAULT_FDT_FILE="mt7981-sd-rfb"
  698. +CONFIG_LOGLEVEL=7
  699. +CONFIG_LOG=y
  700. +CONFIG_SYS_PROMPT="MT7981> "
  701. +CONFIG_SYS_CBSIZE=512
  702. +CONFIG_SYS_PBSIZE=1049
  703. +# CONFIG_BOOTM_NETBSD is not set
  704. +# CONFIG_BOOTM_PLAN9 is not set
  705. +# CONFIG_BOOTM_RTEMS is not set
  706. +# CONFIG_BOOTM_VXWORKS is not set
  707. +# CONFIG_CMD_ELF is not set
  708. +# CONFIG_CMD_UNLZ4 is not set
  709. +# CONFIG_CMD_UNZIP is not set
  710. +CONFIG_CMD_GPIO=y
  711. +CONFIG_CMD_GPT=y
  712. +CONFIG_CMD_GPT_RENAME=y
  713. +CONFIG_CMD_LSBLK=y
  714. +CONFIG_CMD_MMC=y
  715. +CONFIG_CMD_PART=y
  716. +CONFIG_CMD_READ=y
  717. +CONFIG_CMD_PING=y
  718. +CONFIG_CMD_SMC=y
  719. +CONFIG_CMD_FAT=y
  720. +CONFIG_CMD_FS_GENERIC=y
  721. +CONFIG_PARTITION_TYPE_GUID=y
  722. +CONFIG_ENV_OVERWRITE=y
  723. +CONFIG_ENV_IS_IN_MMC=y
  724. +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
  725. +CONFIG_NET_RANDOM_ETHADDR=y
  726. +CONFIG_REGMAP=y
  727. +CONFIG_SYSCON=y
  728. +CONFIG_CLK=y
  729. +CONFIG_MMC_HS200_SUPPORT=y
  730. +CONFIG_MMC_MTK=y
  731. +CONFIG_PHY_FIXED=y
  732. +CONFIG_DM_ETH=y
  733. +CONFIG_MEDIATEK_ETH=y
  734. +CONFIG_PINCTRL=y
  735. +CONFIG_PINCONF=y
  736. +CONFIG_PINCTRL_MT7981=y
  737. +CONFIG_POWER_DOMAIN=y
  738. +CONFIG_MTK_POWER_DOMAIN=y
  739. +CONFIG_DM_REGULATOR=y
  740. +CONFIG_DM_REGULATOR_FIXED=y
  741. +CONFIG_DM_SERIAL=y
  742. +CONFIG_MTK_SERIAL=y
  743. +CONFIG_FAT_WRITE=y
  744. +CONFIG_HEXDUMP=y
  745. +# CONFIG_EFI_LOADER is not set
  746. --- /dev/null
  747. +++ b/include/configs/mt7981.h
  748. @@ -0,0 +1,26 @@
  749. +/* SPDX-License-Identifier: GPL-2.0 */
  750. +/*
  751. + * Configuration for MediaTek MT7981 SoC
  752. + *
  753. + * Copyright (C) 2022 MediaTek Inc.
  754. + * Author: Sam Shih <[email protected]>
  755. + */
  756. +
  757. +#ifndef __MT7981_H
  758. +#define __MT7981_H
  759. +
  760. +#include <linux/sizes.h>
  761. +
  762. +#define CONFIG_SYS_NONCACHED_MEMORY SZ_1M
  763. +#define CONFIG_SYS_MMC_ENV_DEV 0
  764. +
  765. +/* Uboot definition */
  766. +#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
  767. +
  768. +/* SPL -> Uboot */
  769. +#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
  770. +
  771. +/* DRAM */
  772. +#define CONFIG_SYS_SDRAM_BASE 0x40000000
  773. +
  774. +#endif