// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2023 Luckfox Electronics Co., Ltd.
 */

/dts-v1/;

#include "rv1103.dtsi"
#include "rv1106-evb.dtsi"
#include "rv1103-luckfox-pico-ipc.dtsi"

/ {
	model = "Luckfox Pico Mini B";
	compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1103";
};

/**********SFC**********/
&sfc {
	status = "okay";
	flash@0 {
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <75000000>;
		spi-rx-bus-width = <4>;
		spi-tx-bus-width = <1>;
	};
};

/**********SDMMC**********/
&sdmmc {
	max-frequency = <50000000>;
	no-sdio;
	no-mmc;
	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	disable-wp;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
	status = "okay";
};

/**********ETH**********/
&gmac {
	status = "disabled";
};

/**********USB**********/
&usbdrd_dwc3 {
	status = "okay";
	dr_mode = "peripheral";
};

/**********SPI**********/
/* SPI0_M0 */
&spi0 {
	status = "okay";
	pinctrl-0 = <&spi0m0_clk &spi0m0_mosi &spi0m0_cs0>;
	spidev@0 {
    status = "disabled";
		spi-max-frequency = <50000000>;
	};
	fbtft@0{
		compatible = "sitronix,st7789v";
		reg = <0>;
		spi-max-frequency = <20000000>;
		fps = <30>;
		buswidth = <8>;
		debug = <0x7>;
		led-gpios = <&gpio1 RK_PC3 GPIO_ACTIVE_LOW>;//BL
		dc = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>;      //DC
		reset = <&gpio1 RK_PC5 GPIO_ACTIVE_LOW>;    //RES
  };
};

/**********I2C**********/
/* I2C3_M1 */
&i2c3 {
	status = "disabled";
	clock-frequency = <100000>;
};

/**********UART**********/
/* UART3_M1 */
&uart3 {
	status = "disabled";
};

/* UART4_M1 */
&uart4 {
	status = "disabled";
};

/**********PWM**********/
/* PWM1_M0 */
&pwm1 {
	status = "disabled";
};
