Linux Audio

Check our new training course

Embedded Linux Audio

Check our new training course
with Creative Commons CC-BY-SA
lecture materials

Bootlin logo

Elixir Cross Referencer

Loading...
/*
 * Copyright (c) 2019 Benjamin Valentin
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/dts-v1/;
#include <atmel/samr21.dtsi>

/ {
	model = "SAM R21 Xplained Pro";
	compatible = "atsamr21,xpro", "atmel,samr21g18a", "atmel,samr21";

	chosen {
		zephyr,console = &sercom0;
		zephyr,shell-uart = &sercom0;
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
	};

	/* These aliases are provided for compatibility with samples */
	aliases {
		led0 = &led0;
		pwm-led0 = &pwm_led0;
		sw0 = &user_button;
		i2c-0 = &sercom1;
	};

	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <&porta 19 GPIO_ACTIVE_LOW>;
			label = "Yellow LED";
		};
	};

	pwmleds {
		compatible = "pwm-leds";
		pwm_led0: pwm_led_0 {
			pwms = <&tcc0 3>;
		};
	};

	buttons {
		compatible = "gpio-keys";
		user_button: button_0 {
			gpios = <&porta 28 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
			label = "SW0";
		};
	};

	ext1_header: xplained-pro-connector1 {
		compatible = "atmel-xplained-pro-header";
		#gpio-cells = <2>;
		gpio-map-mask = <0xffffffff 0xffffffc0>;
		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
		gpio-map =	<0  0 &porta  6 0>,	/* ADC6             */
				<1  0 &porta  7 0>,	/* ADC7             */
				<2  0 &porta 13 0>,	/* GPIO             */
				<3  0 &porta 28 0>,	/* GPIO             */
				<4  0 &porta 18 0>,	/* PWM_T0_W2        */
				<5  0 &porta 19 0>,	/* PWM_T0_W3        */
				<6  0 &porta 22 0>,	/* GPIO             */
				<7  0 &porta 23 0>,	/* GPIO             */
				<8  0 &porta 16 0>,	/* TWD1        EXT2 */
				<9  0 &porta 17 0>,	/* TWCK1       EXT2 */
				<10 0 &porta  5 0>,	/* RXD0             */
				<11 0 &porta  4 0>,	/* TXD0             */
				<12 0 &portb  3 0>,	/* SPI5(SS)         */
				<13 0 &portb 22 0>,	/* SPI5(MOSI)  EXTx */
				<14 0 &portb  2 0>,	/* SPI5(MISO)  EXTx */
				<15 0 &portb 23 0>;	/* SPI5(SCK)   EXTx */
	};

	ext2_header: xplained-pro-connector2 {
		compatible = "atmel-xplained-pro-header";
		#gpio-cells = <2>;
		gpio-map-mask = <0xffffffff 0xffffffc0>;
		gpio-map-pass-thru = <0 0x3f>;		/*           Shared */
		gpio-map =    /*<0  0 -      - 0>,	   -                */
			      /*<1  0 -      - 0>,	   -                */
				<2  0 &porta 15 0>,	/* GPIO             */
			      /*<3  0 -      - 0>,	   -                */
			      /*<4  0 -      - 0>,	   -                */
			      /*<5  0 -      - 0>,	   -                */
			      /*<6  0 -      - 0>,	   -                */
				<7  0 &porta  8 0>,	/* GPIO             */
				<8  0 &porta 16 0>,	/* TWD1        EXT1 */
				<9  0 &porta 17 0>,	/* TWCK1       EXT1 */
			      /*<11 0 -      - 0>,	   -                */
			      /*<12 0 -      - 0>,	   -                */
				<12 0 &porta 14 0>,	/* GPIO             */
				<13 0 &portb 22 0>,	/* SPI5(MOSI)  EXTx */
				<14 0 &portb  2 0>,	/* SPI5(MISO)  EXTx */
				<15 0 &portb 23 0>;	/* SPI5(SCK)   EXTx */
	};
};

&cpu0 {
	clock-frequency = <48000000>;
};

&tcc0 {
	status = "okay";
	compatible = "atmel,sam0-tcc-pwm";
	prescaler = <4>;
	#pwm-cells = <1>;
};

&sercom0 {
	status = "okay";
	compatible = "atmel,sam0-uart";
	current-speed = <115200>;
	rxpo = <1>;
	txpo = <0>;
};

&sercom1 {
	status = "okay";
	compatible = "atmel,sam0-i2c";
	clock-frequency = <I2C_BITRATE_FAST>;
	label = "I2C_0";
	#address-cells = <1>;
	#size-cells = <0>;
};

&sercom4 {
	status = "okay";
	compatible = "atmel,sam0-spi";
	/*
	 *	CS-PB31; MOSI-PB30; MISO-PC19; SCLK-PC18
	 *	PAD[1]; PAD[2]; PAD[0]; PAD[3]
	 */
	dipo = <0>;
	dopo = <1>;
	label = "SPI_RF2XX";
	#address-cells = <1>;
	#size-cells = <0>;

	cs-gpios = <&portb 31 GPIO_ACTIVE_LOW>;

	rf2xx@0 {
		compatible = "atmel,rf2xx";
		reg = <0x0>;
		label = "RF2XX_0";
		spi-max-frequency = <6000000>;
		irq-gpios = <&portb 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
		reset-gpios = <&portb 15 GPIO_ACTIVE_LOW>;
		slptr-gpios = <&porta 20 GPIO_ACTIVE_HIGH>;
		dig2-gpios = <&portb 17 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
		status = "okay";
	};
};

&sercom5 {
	status = "okay";
	compatible = "atmel,sam0-spi";
	dipo = <0>;
	dopo = <2>;
	label = "SPI_0";
	#address-cells = <1>;
	#size-cells = <0>;
};

&usb0 {
	status = "okay";
};

&rtc {
	status = "okay";
};

ext1_spi: &sercom5 {
};

ext1_i2c: &sercom1 {
};

ext1_serial: &sercom0 {
};

ext2_spi: &sercom5 {
};

ext2_i2c: &sercom1 {
};