jh7110-common.dtsi 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. // SPDX-License-Identifier: GPL-2.0 OR MIT
  2. /*
  3. * Copyright (C) 2022 StarFive Technology Co., Ltd.
  4. * Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk>
  5. */
  6. /dts-v1/;
  7. #include "jh7110.dtsi"
  8. #include "jh7110-pinfunc.h"
  9. #include <dt-bindings/gpio/gpio.h>
  10. / {
  11. aliases {
  12. ethernet0 = &gmac0;
  13. i2c0 = &i2c0;
  14. i2c2 = &i2c2;
  15. i2c5 = &i2c5;
  16. i2c6 = &i2c6;
  17. mmc0 = &mmc0;
  18. mmc1 = &mmc1;
  19. serial0 = &uart0;
  20. };
  21. chosen {
  22. stdout-path = "serial0:115200n8";
  23. };
  24. memory@40000000 {
  25. device_type = "memory";
  26. reg = <0x0 0x40000000 0x1 0x0>;
  27. };
  28. gpio-restart {
  29. compatible = "gpio-restart";
  30. gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
  31. priority = <224>;
  32. };
  33. pwmdac_codec: audio-codec {
  34. compatible = "linux,spdif-dit";
  35. #sound-dai-cells = <0>;
  36. };
  37. sound {
  38. compatible = "simple-audio-card";
  39. simple-audio-card,name = "StarFive-PWMDAC-Sound-Card";
  40. #address-cells = <1>;
  41. #size-cells = <0>;
  42. simple-audio-card,dai-link@0 {
  43. reg = <0>;
  44. format = "left_j";
  45. bitclock-master = <&sndcpu0>;
  46. frame-master = <&sndcpu0>;
  47. sndcpu0: cpu {
  48. sound-dai = <&pwmdac>;
  49. };
  50. codec {
  51. sound-dai = <&pwmdac_codec>;
  52. };
  53. };
  54. };
  55. };
  56. &cpus {
  57. timebase-frequency = <4000000>;
  58. };
  59. &dvp_clk {
  60. clock-frequency = <74250000>;
  61. };
  62. &gmac0_rgmii_rxin {
  63. clock-frequency = <125000000>;
  64. };
  65. &gmac0_rmii_refin {
  66. clock-frequency = <50000000>;
  67. };
  68. &gmac1_rgmii_rxin {
  69. clock-frequency = <125000000>;
  70. };
  71. &gmac1_rmii_refin {
  72. clock-frequency = <50000000>;
  73. };
  74. &hdmitx0_pixelclk {
  75. clock-frequency = <297000000>;
  76. };
  77. &i2srx_bclk_ext {
  78. clock-frequency = <12288000>;
  79. };
  80. &i2srx_lrck_ext {
  81. clock-frequency = <192000>;
  82. };
  83. &i2stx_bclk_ext {
  84. clock-frequency = <12288000>;
  85. };
  86. &i2stx_lrck_ext {
  87. clock-frequency = <192000>;
  88. };
  89. &mclk_ext {
  90. clock-frequency = <12288000>;
  91. };
  92. &osc {
  93. clock-frequency = <24000000>;
  94. };
  95. &rtc_osc {
  96. clock-frequency = <32768>;
  97. };
  98. &tdm_ext {
  99. clock-frequency = <49152000>;
  100. };
  101. &camss {
  102. assigned-clocks = <&ispcrg JH7110_ISPCLK_DOM4_APB_FUNC>,
  103. <&ispcrg JH7110_ISPCLK_MIPI_RX0_PXL>;
  104. assigned-clock-rates = <49500000>, <198000000>;
  105. ports {
  106. #address-cells = <1>;
  107. #size-cells = <0>;
  108. port@0 {
  109. reg = <0>;
  110. };
  111. port@1 {
  112. reg = <1>;
  113. camss_from_csi2rx: endpoint {
  114. remote-endpoint = <&csi2rx_to_camss>;
  115. };
  116. };
  117. };
  118. };
  119. &csi2rx {
  120. assigned-clocks = <&ispcrg JH7110_ISPCLK_VIN_SYS>;
  121. assigned-clock-rates = <297000000>;
  122. ports {
  123. #address-cells = <1>;
  124. #size-cells = <0>;
  125. port@0 {
  126. reg = <0>;
  127. /* remote MIPI sensor endpoint */
  128. };
  129. port@1 {
  130. reg = <1>;
  131. csi2rx_to_camss: endpoint {
  132. remote-endpoint = <&camss_from_csi2rx>;
  133. };
  134. };
  135. };
  136. };
  137. &gmac0 {
  138. phy-handle = <&phy0>;
  139. phy-mode = "rgmii-id";
  140. status = "okay";
  141. mdio {
  142. #address-cells = <1>;
  143. #size-cells = <0>;
  144. compatible = "snps,dwmac-mdio";
  145. phy0: ethernet-phy@0 {
  146. reg = <0>;
  147. };
  148. };
  149. };
  150. &i2c0 {
  151. clock-frequency = <100000>;
  152. i2c-sda-hold-time-ns = <300>;
  153. i2c-sda-falling-time-ns = <510>;
  154. i2c-scl-falling-time-ns = <510>;
  155. pinctrl-names = "default";
  156. pinctrl-0 = <&i2c0_pins>;
  157. status = "okay";
  158. };
  159. &i2c2 {
  160. clock-frequency = <100000>;
  161. i2c-sda-hold-time-ns = <300>;
  162. i2c-sda-falling-time-ns = <510>;
  163. i2c-scl-falling-time-ns = <510>;
  164. pinctrl-names = "default";
  165. pinctrl-0 = <&i2c2_pins>;
  166. status = "okay";
  167. };
  168. &i2c5 {
  169. clock-frequency = <100000>;
  170. i2c-sda-hold-time-ns = <300>;
  171. i2c-sda-falling-time-ns = <510>;
  172. i2c-scl-falling-time-ns = <510>;
  173. pinctrl-names = "default";
  174. pinctrl-0 = <&i2c5_pins>;
  175. status = "okay";
  176. axp15060: pmic@36 {
  177. compatible = "x-powers,axp15060";
  178. reg = <0x36>;
  179. interrupt-controller;
  180. #interrupt-cells = <1>;
  181. regulators {
  182. vcc_3v3: dcdc1 {
  183. regulator-boot-on;
  184. regulator-always-on;
  185. regulator-min-microvolt = <3300000>;
  186. regulator-max-microvolt = <3300000>;
  187. regulator-name = "vcc_3v3";
  188. };
  189. vdd_cpu: dcdc2 {
  190. regulator-always-on;
  191. regulator-min-microvolt = <500000>;
  192. regulator-max-microvolt = <1540000>;
  193. regulator-name = "vdd-cpu";
  194. };
  195. emmc_vdd: aldo4 {
  196. regulator-boot-on;
  197. regulator-always-on;
  198. regulator-min-microvolt = <1800000>;
  199. regulator-max-microvolt = <3300000>;
  200. regulator-name = "emmc_vdd";
  201. };
  202. };
  203. };
  204. };
  205. &i2c6 {
  206. clock-frequency = <100000>;
  207. i2c-sda-hold-time-ns = <300>;
  208. i2c-sda-falling-time-ns = <510>;
  209. i2c-scl-falling-time-ns = <510>;
  210. pinctrl-names = "default";
  211. pinctrl-0 = <&i2c6_pins>;
  212. status = "okay";
  213. };
  214. &mmc0 {
  215. max-frequency = <100000000>;
  216. assigned-clocks = <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>;
  217. assigned-clock-rates = <50000000>;
  218. bus-width = <8>;
  219. cap-mmc-highspeed;
  220. mmc-ddr-1_8v;
  221. mmc-hs200-1_8v;
  222. cap-mmc-hw-reset;
  223. post-power-on-delay-ms = <200>;
  224. pinctrl-names = "default";
  225. pinctrl-0 = <&mmc0_pins>;
  226. vmmc-supply = <&vcc_3v3>;
  227. vqmmc-supply = <&emmc_vdd>;
  228. status = "okay";
  229. };
  230. &mmc1 {
  231. max-frequency = <100000000>;
  232. assigned-clocks = <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;
  233. assigned-clock-rates = <50000000>;
  234. bus-width = <4>;
  235. no-sdio;
  236. no-mmc;
  237. cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
  238. disable-wp;
  239. cap-sd-highspeed;
  240. post-power-on-delay-ms = <200>;
  241. pinctrl-names = "default";
  242. pinctrl-0 = <&mmc1_pins>;
  243. status = "okay";
  244. };
  245. &pcie0 {
  246. perst-gpios = <&sysgpio 26 GPIO_ACTIVE_LOW>;
  247. phys = <&pciephy0>;
  248. pinctrl-names = "default";
  249. pinctrl-0 = <&pcie0_pins>;
  250. };
  251. &pcie1 {
  252. perst-gpios = <&sysgpio 28 GPIO_ACTIVE_LOW>;
  253. phys = <&pciephy1>;
  254. pinctrl-names = "default";
  255. pinctrl-0 = <&pcie1_pins>;
  256. };
  257. &pwmdac {
  258. pinctrl-names = "default";
  259. pinctrl-0 = <&pwmdac_pins>;
  260. status = "okay";
  261. };
  262. &qspi {
  263. #address-cells = <1>;
  264. #size-cells = <0>;
  265. status = "okay";
  266. nor_flash: flash@0 {
  267. compatible = "jedec,spi-nor";
  268. reg = <0>;
  269. cdns,read-delay = <5>;
  270. spi-max-frequency = <12000000>;
  271. cdns,tshsl-ns = <1>;
  272. cdns,tsd2d-ns = <1>;
  273. cdns,tchsh-ns = <1>;
  274. cdns,tslch-ns = <1>;
  275. partitions {
  276. compatible = "fixed-partitions";
  277. #address-cells = <1>;
  278. #size-cells = <1>;
  279. spl@0 {
  280. reg = <0x0 0xf0000>;
  281. };
  282. uboot-env@f0000 {
  283. reg = <0xf0000 0x10000>;
  284. };
  285. uboot@100000 {
  286. reg = <0x100000 0xf00000>;
  287. };
  288. };
  289. };
  290. };
  291. &pwm {
  292. pinctrl-names = "default";
  293. pinctrl-0 = <&pwm_pins>;
  294. status = "okay";
  295. };
  296. &spi0 {
  297. pinctrl-names = "default";
  298. pinctrl-0 = <&spi0_pins>;
  299. status = "okay";
  300. spi_dev0: spi@0 {
  301. compatible = "rohm,dh2228fv";
  302. reg = <0>;
  303. spi-max-frequency = <10000000>;
  304. };
  305. };
  306. &syscrg {
  307. assigned-clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>,
  308. <&pllclk JH7110_PLLCLK_PLL0_OUT>;
  309. assigned-clock-rates = <500000000>, <1500000000>;
  310. };
  311. &sysgpio {
  312. i2c0_pins: i2c0-0 {
  313. i2c-pins {
  314. pinmux = <GPIOMUX(57, GPOUT_LOW,
  315. GPOEN_SYS_I2C0_CLK,
  316. GPI_SYS_I2C0_CLK)>,
  317. <GPIOMUX(58, GPOUT_LOW,
  318. GPOEN_SYS_I2C0_DATA,
  319. GPI_SYS_I2C0_DATA)>;
  320. bias-disable; /* external pull-up */
  321. input-enable;
  322. input-schmitt-enable;
  323. };
  324. };
  325. i2c2_pins: i2c2-0 {
  326. i2c-pins {
  327. pinmux = <GPIOMUX(3, GPOUT_LOW,
  328. GPOEN_SYS_I2C2_CLK,
  329. GPI_SYS_I2C2_CLK)>,
  330. <GPIOMUX(2, GPOUT_LOW,
  331. GPOEN_SYS_I2C2_DATA,
  332. GPI_SYS_I2C2_DATA)>;
  333. bias-disable; /* external pull-up */
  334. input-enable;
  335. input-schmitt-enable;
  336. };
  337. };
  338. i2c5_pins: i2c5-0 {
  339. i2c-pins {
  340. pinmux = <GPIOMUX(19, GPOUT_LOW,
  341. GPOEN_SYS_I2C5_CLK,
  342. GPI_SYS_I2C5_CLK)>,
  343. <GPIOMUX(20, GPOUT_LOW,
  344. GPOEN_SYS_I2C5_DATA,
  345. GPI_SYS_I2C5_DATA)>;
  346. bias-disable; /* external pull-up */
  347. input-enable;
  348. input-schmitt-enable;
  349. };
  350. };
  351. i2c6_pins: i2c6-0 {
  352. i2c-pins {
  353. pinmux = <GPIOMUX(16, GPOUT_LOW,
  354. GPOEN_SYS_I2C6_CLK,
  355. GPI_SYS_I2C6_CLK)>,
  356. <GPIOMUX(17, GPOUT_LOW,
  357. GPOEN_SYS_I2C6_DATA,
  358. GPI_SYS_I2C6_DATA)>;
  359. bias-disable; /* external pull-up */
  360. input-enable;
  361. input-schmitt-enable;
  362. };
  363. };
  364. mmc0_pins: mmc0-0 {
  365. rst-pins {
  366. pinmux = <GPIOMUX(62, GPOUT_SYS_SDIO0_RST,
  367. GPOEN_ENABLE,
  368. GPI_NONE)>;
  369. bias-pull-up;
  370. drive-strength = <12>;
  371. input-disable;
  372. input-schmitt-disable;
  373. slew-rate = <0>;
  374. };
  375. mmc-pins {
  376. pinmux = <PINMUX(64, 0)>,
  377. <PINMUX(65, 0)>,
  378. <PINMUX(66, 0)>,
  379. <PINMUX(67, 0)>,
  380. <PINMUX(68, 0)>,
  381. <PINMUX(69, 0)>,
  382. <PINMUX(70, 0)>,
  383. <PINMUX(71, 0)>,
  384. <PINMUX(72, 0)>,
  385. <PINMUX(73, 0)>;
  386. bias-pull-up;
  387. drive-strength = <12>;
  388. input-enable;
  389. };
  390. };
  391. mmc1_pins: mmc1-0 {
  392. clk-pins {
  393. pinmux = <GPIOMUX(10, GPOUT_SYS_SDIO1_CLK,
  394. GPOEN_ENABLE,
  395. GPI_NONE)>;
  396. bias-pull-up;
  397. drive-strength = <12>;
  398. input-disable;
  399. input-schmitt-disable;
  400. slew-rate = <0>;
  401. };
  402. mmc-pins {
  403. pinmux = <GPIOMUX(9, GPOUT_SYS_SDIO1_CMD,
  404. GPOEN_SYS_SDIO1_CMD,
  405. GPI_SYS_SDIO1_CMD)>,
  406. <GPIOMUX(11, GPOUT_SYS_SDIO1_DATA0,
  407. GPOEN_SYS_SDIO1_DATA0,
  408. GPI_SYS_SDIO1_DATA0)>,
  409. <GPIOMUX(12, GPOUT_SYS_SDIO1_DATA1,
  410. GPOEN_SYS_SDIO1_DATA1,
  411. GPI_SYS_SDIO1_DATA1)>,
  412. <GPIOMUX(7, GPOUT_SYS_SDIO1_DATA2,
  413. GPOEN_SYS_SDIO1_DATA2,
  414. GPI_SYS_SDIO1_DATA2)>,
  415. <GPIOMUX(8, GPOUT_SYS_SDIO1_DATA3,
  416. GPOEN_SYS_SDIO1_DATA3,
  417. GPI_SYS_SDIO1_DATA3)>;
  418. bias-pull-up;
  419. drive-strength = <12>;
  420. input-enable;
  421. input-schmitt-enable;
  422. slew-rate = <0>;
  423. };
  424. };
  425. pcie0_pins: pcie0-0 {
  426. clkreq-pins {
  427. pinmux = <GPIOMUX(27, GPOUT_LOW,
  428. GPOEN_DISABLE,
  429. GPI_NONE)>;
  430. bias-pull-down;
  431. drive-strength = <2>;
  432. input-enable;
  433. input-schmitt-disable;
  434. slew-rate = <0>;
  435. };
  436. wake-pins {
  437. pinmux = <GPIOMUX(32, GPOUT_LOW,
  438. GPOEN_DISABLE,
  439. GPI_NONE)>;
  440. bias-pull-up;
  441. drive-strength = <2>;
  442. input-enable;
  443. input-schmitt-disable;
  444. slew-rate = <0>;
  445. };
  446. };
  447. pcie1_pins: pcie1-0 {
  448. clkreq-pins {
  449. pinmux = <GPIOMUX(29, GPOUT_LOW,
  450. GPOEN_DISABLE,
  451. GPI_NONE)>;
  452. bias-pull-down;
  453. drive-strength = <2>;
  454. input-enable;
  455. input-schmitt-disable;
  456. slew-rate = <0>;
  457. };
  458. wake-pins {
  459. pinmux = <GPIOMUX(21, GPOUT_LOW,
  460. GPOEN_DISABLE,
  461. GPI_NONE)>;
  462. bias-pull-up;
  463. drive-strength = <2>;
  464. input-enable;
  465. input-schmitt-disable;
  466. slew-rate = <0>;
  467. };
  468. };
  469. pwmdac_pins: pwmdac-0 {
  470. pwmdac-pins {
  471. pinmux = <GPIOMUX(33, GPOUT_SYS_PWMDAC_LEFT,
  472. GPOEN_ENABLE,
  473. GPI_NONE)>,
  474. <GPIOMUX(34, GPOUT_SYS_PWMDAC_RIGHT,
  475. GPOEN_ENABLE,
  476. GPI_NONE)>;
  477. bias-disable;
  478. drive-strength = <2>;
  479. input-disable;
  480. input-schmitt-disable;
  481. slew-rate = <0>;
  482. };
  483. };
  484. pwm_pins: pwm-0 {
  485. pwm-pins {
  486. pinmux = <GPIOMUX(46, GPOUT_SYS_PWM_CHANNEL0,
  487. GPOEN_SYS_PWM0_CHANNEL0,
  488. GPI_NONE)>,
  489. <GPIOMUX(59, GPOUT_SYS_PWM_CHANNEL1,
  490. GPOEN_SYS_PWM0_CHANNEL1,
  491. GPI_NONE)>;
  492. bias-disable;
  493. drive-strength = <12>;
  494. input-disable;
  495. input-schmitt-disable;
  496. slew-rate = <0>;
  497. };
  498. };
  499. spi0_pins: spi0-0 {
  500. mosi-pins {
  501. pinmux = <GPIOMUX(52, GPOUT_SYS_SPI0_TXD,
  502. GPOEN_ENABLE,
  503. GPI_NONE)>;
  504. bias-disable;
  505. input-disable;
  506. input-schmitt-disable;
  507. };
  508. miso-pins {
  509. pinmux = <GPIOMUX(53, GPOUT_LOW,
  510. GPOEN_DISABLE,
  511. GPI_SYS_SPI0_RXD)>;
  512. bias-pull-up;
  513. input-enable;
  514. input-schmitt-enable;
  515. };
  516. sck-pins {
  517. pinmux = <GPIOMUX(48, GPOUT_SYS_SPI0_CLK,
  518. GPOEN_ENABLE,
  519. GPI_SYS_SPI0_CLK)>;
  520. bias-disable;
  521. input-disable;
  522. input-schmitt-disable;
  523. };
  524. ss-pins {
  525. pinmux = <GPIOMUX(49, GPOUT_SYS_SPI0_FSS,
  526. GPOEN_ENABLE,
  527. GPI_SYS_SPI0_FSS)>;
  528. bias-disable;
  529. input-disable;
  530. input-schmitt-disable;
  531. };
  532. };
  533. uart0_pins: uart0-0 {
  534. tx-pins {
  535. pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
  536. GPOEN_ENABLE,
  537. GPI_NONE)>;
  538. bias-disable;
  539. drive-strength = <12>;
  540. input-disable;
  541. input-schmitt-disable;
  542. slew-rate = <0>;
  543. };
  544. rx-pins {
  545. pinmux = <GPIOMUX(6, GPOUT_LOW,
  546. GPOEN_DISABLE,
  547. GPI_SYS_UART0_RX)>;
  548. bias-disable; /* external pull-up */
  549. drive-strength = <2>;
  550. input-enable;
  551. input-schmitt-enable;
  552. slew-rate = <0>;
  553. };
  554. };
  555. };
  556. &uart0 {
  557. pinctrl-names = "default";
  558. pinctrl-0 = <&uart0_pins>;
  559. status = "okay";
  560. };
  561. &usb0 {
  562. dr_mode = "peripheral";
  563. status = "okay";
  564. };
  565. &U74_1 {
  566. cpu-supply = <&vdd_cpu>;
  567. };
  568. &U74_2 {
  569. cpu-supply = <&vdd_cpu>;
  570. };
  571. &U74_3 {
  572. cpu-supply = <&vdd_cpu>;
  573. };
  574. &U74_4 {
  575. cpu-supply = <&vdd_cpu>;
  576. };