Re: QSPI for ATSAME51 #flash


Bolivar, Marti
 

Hi Theo,

"Theo Hussey via lists.zephyrproject.org"
<theo=open-cosmos.com@lists.zephyrproject.org> writes:

Hi,

I am trying to develop an out of tree QSPI driver for the ATSAME51 micro controller.

I have added my entries to the device tree:

soc {
qspi0 : qspi@42003400 {
compatible = "atmel,sam0-qspi" ;
reg = < 0x42003400 0x40 >;
interrupts = < 134 0 >;
status = "okay" ;
label = "QSPI_0" ;
clocks = < &mclk 0x10 13 >, < &mclk 0x10 21 >, < &mclk 0x1C 13 >;
clock-names = "QSPI_AHB_Clock" , "QSPI_2X_AHB_Clock" , "QSPI_APB_Clock" ;
#address-cells = < 1 >;
#size-cells = < 0 >;
};
};
};
There is an extra unmatched "};" here. I'm assuming that is just a
copy/paste issue in this email? It looks like a syntax error.


&qspi0 {
gd25q16 : gd25q16c@0 {
compatible = "jedec,spi-nor" ;
label = "GD25Q16C" ;
reg = < 0 >;
spi-max-frequency = < 80000000 >;
size = < 0x200000 >;
has-be32k;
has-dpd;
t-enter-dpd = < 20000 >;
t-exit-dpd = < 100000 >;
jedec-id = [c8 40 15] ;
};
};

But I receive the following errors when trying to build, in comparison if I add the nor flash as an child of a sercom spi peripheral it builds fine. Does anyone have any suggestions on what could be causing this?
[snip]

zephyr/include/generated/devicetree_unfixed.h:4014:35: error: 'DT_N_S_soc_S_qspi_42003400_S_gd25q16c_0_BUS_P_label' undeclared (first use in this function); did you mean 'DT_N_S_soc_S_qspi_42003400_S_gd25q16c_0_P_label'?
I'm going to explain what this mess means for the sake of the list
archives before getting to what I am guessing the problem is.

'DT_N_S_soc_S_qspi_42003400_S_gd25q16c_0_BUS_P_label'

The 'DT_N_S_soc_S_qspi_42003400_S_gd25q16c_0' part is the 'node
identifier' for the gd25q16c@0 node.

'Node identifiers' are introduced here:

https://docs.zephyrproject.org/latest/guides/dts/api-usage.html#node-identifiers

The secret decoder ring for unpacking node identifiers is:

- 'DT_N' -> 'devicetree node'
- '_S_' -> '/'
- all special characters become '_'

So that:

DT_N_S_soc_S_qspi_42003400_S_gd25q16c_0_BUS_P_label

becomes:

devicetree node /soc/qspi@42003400/gd25q16c@0 _BUS_P_label

The trailing '_BUS_P_label' is just the devicetree API trying to figure
out what the 'label' property of the bus node for
/soc/qspi@42003400/gd25q16c@0 is.

I also see:

- 'qspi@42003400' does have a label property in your DTS, "QSPI_0"
- its compatible, 'atmel,sam0-qspi', is not upstream

So I'm guessing that the problem is:

- you've got a custom binding for 'atmel,sam0-qspi',
- it is a missing a 'bus: qspi' line

Example binding with a 'bus: qspi' line:

https://github.com/zephyrproject-rtos/zephyr/blob/master/dts/bindings/qspi/st%2Cstm32-qspi.yaml#L23

If that line is missing, please add it and try again.

Otherwise please provide more details on your binding.

Thanks and HTH,
Martí

Join devel@lists.zephyrproject.org to automatically receive all group messages.