/*
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

/ {
	chosen {
		nordic,pm-ext-flash = &eeprom_m95p32;
	};
};

&spi3 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	pinctrl-0 = <&spi3_default>;
	pinctrl-1 = <&spi3_sleep>;
	pinctrl-names = "default", "sleep";
	cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
	eeprom_m95p32:eeprom_m95p32@0 {
		compatible = "atmel,at25";
		reg = <0>;
		size = <DT_SIZE_M(4)>;
		pagesize = <512>;
		address-width = <24>;
		spi-max-frequency = <8000000>;
		timeout = <5>;
        wp-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH)>;
	};
};

&pinctrl
{
    spi3_default: spi3_default {
		group1 {
			psels = <NRF_PSEL(SPIM_SCK, 0, 17)>,
				<NRF_PSEL(SPIM_MOSI, 0, 13)>,
				<NRF_PSEL(SPIM_MISO, 0, 14)>;
		};
	};

	spi3_sleep: spi3_sleep {
		group1 {
			psels = <NRF_PSEL(SPIM_SCK, 0, 17)>,
				<NRF_PSEL(SPIM_MOSI, 0, 13)>,
				<NRF_PSEL(SPIM_MISO, 0, 14)>;
			low-power-enable;
		};
	};
};
