linux/arch/arm64/boot/dts/amlogic/amlogic-c3-c308l-aw419.dts

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2024 Amlogic, Inc. All rights reserved.
 */

/dts-v1/;

#include "amlogic-c3.dtsi"

/ {
	model = "Amlogic C308l aw419 Development Board";
	compatible = "amlogic,aw419", "amlogic,c3";
	interrupt-parent = <&gic>;
	#address-cells = <2>;
	#size-cells = <2>;

	aliases {
		serial0 = &uart_b;
		spi0 = &spifc;
	};

	memory@0 {
		device_type = "memory";
		reg = <0x0 0x0 0x0 0x80000000>;
	};

	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		/* 9 MiB reserved for ARM Trusted Firmware */
		secmon_reserved: secmon@7f00000 {
			compatible = "shared-dma-pool";
			reg = <0x0 0x07f00000 0x0 0x900000>;
			no-map;
		};
	};

	main_12v: regulator-main-12v {
		compatible = "regulator-fixed";
		regulator-name = "12V";
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
		regulator-boot-on;
		regulator-always-on;
	};

	vcc_5v: regulator-vcc-5v {
		compatible = "regulator-fixed";
		regulator-name = "VCC5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&main_12v>;
		regulator-boot-on;
		regulator-always-on;
	};

	vddq: regulator-vddq {
		compatible = "regulator-fixed";
		regulator-name = "VDDQ";
		regulator-min-microvolt = <1200000>;
		regulator-max-microvolt = <1200000>;
		vin-supply = <&main_12v>;
		regulator-boot-on;
		regulator-always-on;
	};

	vddao_3v3: regulator-vddao-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VDDAO3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&main_12v>;
		regulator-boot-on;
		regulator-always-on;
	};

	vddao_1v8: regulator-vddao-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VDDAO1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vddao_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	ddr4_2v5: regulator-ddr4-2v5 {
		compatible = "regulator-fixed";
		regulator-name = "DDR4_2V5";
		regulator-min-microvolt = <2500000>;
		regulator-max-microvolt = <2500000>;
		vin-supply = <&vddao_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	vcc_3v3: regulator-vcc-3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VCC3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vddao_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	vcc_1v8: regulator-vcc-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VCC1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vcc_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	vdd_1v8: regulator-vdd-1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VDD1V8_BOOT";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vcc_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	vddio_b: regulator-vddio-3v3-b {
		compatible = "regulator-fixed";
		regulator-name = "VDDIO_B";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_3v3>;
		regulator-boot-on;
		regulator-always-on;
	};

	sdcard: regulator-sdcard {
		compatible = "regulator-fixed";
		regulator-name = "SDCARD_POWER";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vddao_3v3>;
		gpio = <&gpio GPIOA_4 GPIO_ACTIVE_LOW>;
		regulator-boot-on;
		regulator-always-on;
	};
};

&uart_b {
	status = "okay";
};

&nand {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	pinctrl-0 = <&nand_pins>;
	pinctrl-names = "default";

	nand@0 {
		reg = <0>;
		#address-cells = <1>;
		#size-cells = <1>;
		nand-on-flash-bbt;

		partition@0 {
			label = "boot";
			reg = <0x0 0x00200000>;
		};
		partition@200000 {
			label = "env";
			reg = <0x00200000 0x00400000>;
		};
		partition@600000 {
			label = "system";
			reg = <0x00600000 0x00a00000>;
		};
		partition@1000000 {
			label = "rootfs";
			reg = <0x01000000 0x03000000>;
		};
		partition@4000000 {
			label = "media";
			reg = <0x04000000 0x8000000>;
		};
	};
};

&ethmac {
	status = "okay";
	phy-handle = <&internal_ephy>;
	phy-mode = "rmii";
};

&spifc {
	#address-cells = <1>;
	#size-cells = <0>;

	pinctrl-0 = <&spifc_pins>;
	pinctrl-names = "default";

	nand@0 {
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <83000000>;
		spi-tx-bus-width = <4>;
		spi-rx-bus-width = <4>;
		status = "disabled";

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

			partition@0 {
				label = "boot";
				reg = <0 0x200000>;
			};

			partition@200000 {
				label = "env";
				reg = <0x200000 0x400000>;
			};

			partition@600000 {
				label = "system";
				reg = <0x600000 0xa00000>;
			};

			partition@1000000 {
				label = "rootfs";
				reg = <0x1000000 0x3000000>;
			};

			partition@4000000 {
				label = "data";
				reg = <0x4000000 0x8000000>;
			};
		};
	};
};

&sd {
	status = "okay";
	pinctrl-0 = <&sdcard_pins>;
	pinctrl-1 = <&sdcard_clk_gate_pins>;
	pinctrl-names = "default","clk-gate";

	bus-width = <4>;
	cap-sd-highspeed;
	max-frequency = <50000000>;
	disable-wp;

	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
	vmmc-supply = <&sdcard>;
	vqmmc-supply = <&sdcard>;
};