Skip to content

Integrate meta-seco-imx/linux-seco-imx/davc/userspace_reg

Commit: edgehog/layers/seco/meta-seco-imx@5f8b0829

Integrate linux-seco-imx/davc/userspace_reg

--

Commit: edgehog/bsp/nxp/linux-seco-imx@55276fc3

Fix writing with AAI command

Fixed usage of command 0xAD, used to write to the SPI memory in AAI (Auto Address Increment programming). Until now this command doesn't work due to two reasons:

  1. a struct spi_mem_op op data is created and the wanted opcode is written into it. The issue is that the opcode filed is not propagated along the calls to the various functions and when the function that actually writes to the bus is called, the default opcode 0x02 (Byte-program) is used;
  2. Only the first AAI writing cycle requires the address to write (base address), instead the following cycles need only to the data. The issue is that this logic is not applied to the current implementation of the code (address replied to each cycle).

Solution:

  1. nor->dirmap.wdesc->info.op_tmpl.addr.nbytes = op.addr.nbytes; The dirma.wdesc data structure is propagated thrugh the stack of function calls, so the opcode to use is now stored into the right field inside that data structure.
  2. If a cycle that follow the first, the number of byte regarding the address is put to zero, otherwise this value is restored to the original value (3 or 4, depending to the size of the used memory).

Test procedure: tested on a SST25VF08 of size 1024 bytes, using AAI writing mode. The test concerns the comparation with a 1024 byte raw source after a wrire and read procudere. Test replied with different block size.

Script:

for i in 8 32 64 128 256 512 1024 ; do echo "###################################" echo "Block size = $i byte" echo "###################################" flash_erase /dev/mtd0 0 0 dd if=/dev/urandom of=source bs=1M count=1

dd if=source of=/dev/mtd0 bs=$i dd if=/dev/mtd0 of=dump bs=$i diff source dump ret=$? echo if [[ $ret -eq 0 ]]; then echo ">>>>>>>>>>>>>>> TEST PASS <<<<<<<<<<<<<<<" else echo ">>>>>>>>>>>>>>> TEST FAIL <<<<<<<<<<<<<<<" fi echo done

--

Commit: edgehog/bsp/nxp/linux-seco-imx@9d59e0d4

Add dt_node interface for usege through device-tree

Originally, the driver works only via the old platform-driver interface. Now it uses also the device tree interface. A possible node is:

rs232-consumer {
	compatible          = "reg-userspace-consumer";
	regulator-name      = "rs232-consumer";
	regulator-supplies  = "reg_rs232_en";
	reg_rs232_en-supply = <&reg_rs232_en>;
	regulator-boot-on;
};

Where:

  • regulator-name: name of the particular istance, used also to create the file descriptor at user-space level;
  • regulator0supplies : name of the regulator it uses as interface;
  • -supply = variable node name. It is the node of the regulator that the particular istance uses;
  • regulator-boot-on : (default state: off) used to turn on the regulator at boot.

Merge request reports