Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTS: flash alignment description #860

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

nvlsianpu
Copy link
Collaborator

@nvlsianpu nvlsianpu commented Jul 20, 2017

Added property for description of
the flash alignment required by write operations.
Thanks to that l-value FLASH_WRITE_BLOCK_SIZE macro
will be generated. It is useful for any component uses
the flash.

Added such a description for nrf52840 SoC.

Signed-off-by: Andrzej Puzdrowski andrzej.puzdrowski@nordicsemi.no

Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we specifying alignment or the write/erase block size? Not sure what the compatible of 'arm' or 'intel' is getting you (and it seems wrong as the compatible should probably be to the flash type on the SoC).

@galak galak self-assigned this Jul 20, 2017
@nvlsianpu
Copy link
Collaborator Author

@galak
Copy link
Collaborator

galak commented Jul 20, 2017

As far as the compatible goes, that's probably should be removed. It should really be something like compatible = "atmel,sam-soc-flash".

@nvlsianpu
Copy link
Collaborator Author

Then in *.yaml is expected to have such a compatible property:

- compatible:
      (...)
      constraint: "nordic, nrf-soc-flash", "atmel, sam-soc-flash" (...) "vendor, vedor-soc-specific-flash"

Em I right?

@d3zd3z
Copy link
Collaborator

d3zd3z commented Jul 20, 2017

The compatible value in the yaml may need to be answered by Andy, but it definitely shouldn't be "arm" or "intel". Generally, the flash device hasn't had a compatible value, but lives as a child of the flash controller, and contains a reg field to describe the mapping of the actual flash device. Other devices just have it at the top level, and I guess it is found by name.

I think Andy added a way to find nodes by where they are in the tree, but I don't remember how that happens.

The description should probably be changed to all match write-block-size. At least to me, the block size would include the alignment that the writes need to happen, but also captures that it is the minimum size that the writes must be done at. I think "alignment" was a poor name choice by the mynewt/mcuboot code.

@galak
Copy link
Collaborator

galak commented Jul 20, 2017

As David said, we probably should move flash nodes under a flash controller. The NXP dts I think already do this.

Wonder if 'erase-size' as spec in the linux kernel Documentation/devicetree/bindings/mtd/mtd-physmap.txt makes sense for the property name.

@mbolivar
Copy link
Contributor

Wonder if 'erase-size' as spec in the linux kernel Documentation/devicetree/bindings/mtd/mtd-physmap.txt makes sense for the property name.

Usually write size (1B-8B) << erase size (sector size), no? The meaning of "alignment" in this context is "write size".

@galak
Copy link
Collaborator

galak commented Jul 21, 2017

Should we have both write-size & erase-size as part of the flash node?

@mbolivar
Copy link
Contributor

mbolivar commented Jul 21, 2017

Erase-size is sector size. Not all flash parts have uniform sector sizes. This is being addressed in a separate PR, #816

Edit: the reason for doing it as in 816 is that, if done by hand as nodes, then you'd end up with .dtsi files with hundreds of identical 4K sectors on some parts, which seems unnecessary and doesn't really help with what the user will likely want, which is to query sector information around a given flash offset

@galak
Copy link
Collaborator

galak commented Aug 3, 2017

So what's the plan here, are we going to update this or is it needed anymore?

@nvlsianpu
Copy link
Collaborator Author

This is still needed (I was on holiday).

@galak wrote:

As David said, we probably should move flash nodes under a flash controller. The NXP dts I think already do this.

Following nxp description I propose similar for nordic:

flash-controller@0x4001E000 {
			compatible = "nxp,nrf52-flash-controller";
			reg = <0x4001E000 0x550>;

			#address-cells = <1>;
			#size-cells = <1>;

			flash0: flash@0 {
				reg = <0x00000000 DT_FLASH_SIZE>;
                                write-block-size = <4>;
			};
		};

@d3zd3z, @galak Do you expect to have such description in nrf52840.dtsi file?

@carlescufi carlescufi requested a review from agross-oss August 8, 2017 10:38
@carlescufi
Copy link
Member

Adding @agross-linaro here

@carlescufi
Copy link
Member

@galak, I think @nvlsianpu's latest proposal based on the NXP looks reasonable?

@agross-oss
Copy link
Collaborator

I am ok with it being inside or outside the flash controller. I don't think we should absolutely mandate it be inside. The main thing is that there is a label that can be used to point to the flash node or partition.

@galak
Copy link
Collaborator

galak commented Aug 8, 2017

placing the flash node inside the controller has issues with addressing. Since the flash controller addresses would be for the MMIO register space to program/adjust the controller and the flash itself is at a different location. So its best to have some link instead.

@nvlsianpu
Copy link
Collaborator Author

flash0: flash@0 {
				reg = <0x00000000 DT_FLASH_SIZE>;
                                write-block-size = <4>;
			};

flash-controller@0x4001E000 {
			compatible = "nxp,nrf52-flash-controller";
			reg = <0x4001E000 0x550>;

			#address-cells = <1>;
			#size-cells = <1>;

                       flash = <&flash0>;
		};

@galak Is this comply with what you suggested?

@galak
Copy link
Collaborator

galak commented Aug 9, 2017

@nvlsianpu looking at this some more and feeling like we should just support ranges properly and place the flash node under the controller.

@nvlsianpu nvlsianpu force-pushed the flash_alignment_desc branch 3 times, most recently from e6f560e to 03f2f23 Compare August 23, 2017 08:33
@nvlsianpu
Copy link
Collaborator Author

@galak I've updated the patch. I used flash constrain for bind dtsi description to yaml script.

@carlescufi
Copy link
Member

@agross-linaro mind taking a look at the updated patch? Thanks!

@@ -13,8 +13,18 @@
};
};

flash0: flash@0 {
reg = <0x00000000 DT_FLASH_SIZE>;
flash-controller@0x4001E000 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, remove the 0x in the node name. Should be: flash-controller@4001E000

#address-cells = <1>;
#size-cells = <1>;

flash0: flash {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flash0: flash@0 {

Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits on the dts changes. We need more description on what 'write-block-size' means.


- write-block-size:
type: int
description: flash write alignment
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more descriptive here.

flash0: flash {
compatible = "flash";
reg = <0x00000000 DT_FLASH_SIZE>;
write-block-size = <4>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious where you expect to end up using write-block-size in actual code. I wonder if such properties belong up with the flash-controller node instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. mcuboot, and mcuboot interface (#747) needs to know this value. For me It doesn't mater whether this is flash-controller's property value or flash memory's property (anyway these entities always existing together). But in my opinion flash is right node for this property.

#size-cells = <1>;

flash0: flash {
compatible = "flash";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a better compatible to describe this class of flash device.

@nvlsianpu nvlsianpu force-pushed the flash_alignment_desc branch from 03f2f23 to bcf9058 Compare August 23, 2017 15:07
@@ -0,0 +1,26 @@
---
title: Flash base node description
id: soc-nv-flash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the file from flash.yaml to 'soc-nv-flash.yaml'

Added flash-controller description and moved flash description to
it (for coherence). Added property for description of
the flash alignment required by write operations.
Thanks to that l-value FLASH_WRITE_BLOCK_SIZE macro
will be generated. It is useful for any component uses
the flash.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
@nvlsianpu
Copy link
Collaborator Author

@galak , @d3zd3z poke

@carlescufi
Copy link
Member

@galak @d3zd3z could you take a look at your convenience?

@carlescufi carlescufi added the Feature A planned feature with a milestone label Sep 5, 2017
@carlescufi carlescufi added this to the v1.10 milestone Sep 5, 2017
@carlescufi
Copy link
Member

@galak this has been in review for a while, can you take a look?

@nashif nashif merged commit d868a0b into zephyrproject-rtos:master Sep 11, 2017
@nashif nashif modified the milestones: v1.10, v1.10.0 Oct 3, 2017
LukaszMrugala pushed a commit to LukaszMrugala/zephyr that referenced this pull request Sep 23, 2024
The `--rimage-tool=...` parameter was added in March 2022 by the very
first map.yml commit (rebased f6d6f1e15022)

But `west sign` has been invoked by `west build` (through CMake) since
commit fad2da3, almost one year ago. At the time, the ability to
sign from west flash was preserved for backwards compatibility.

Today, `west flash` does not invoke `west sign` any more which means
this `--rimage-tool=...` parameter is now ignored.  The CI for more
recent, ACE platforms (MTL, LNL, etc.) does not pass any
`--rimage-tool=...` at all, see evidence in CI runs of zephyrproject-rtos#860

Removing `--rimage-tool=...` from `.github/data/map.yml` will allow
blocking that option in `west flash` (zephyrproject-rtos#860)

Now that Zephyr 3.5 has been released, we need to reduce the number of
rimage use cases and the corresponding validation complexity and
maintenance workload to simplify and accelerate new features like
splitting rimage configuration
files (zephyrproject-rtos#65411)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
LukaszMrugala pushed a commit to LukaszMrugala/zephyr that referenced this pull request Sep 24, 2024
The `--rimage-tool=...` parameter was added in March 2022 by the very
first map.yml commit (rebased f6d6f1e15022)

But `west sign` has been invoked by `west build` (through CMake) since
commit fad2da3, almost one year ago. At the time, the ability to
sign from west flash was preserved for backwards compatibility.

Today, `west flash` does not invoke `west sign` any more which means
this `--rimage-tool=...` parameter is now ignored.  The CI for more
recent, ACE platforms (MTL, LNL, etc.) does not pass any
`--rimage-tool=...` at all, see evidence in CI runs of zephyrproject-rtos#860

Removing `--rimage-tool=...` from `.github/data/map.yml` will allow
blocking that option in `west flash` (zephyrproject-rtos#860)

Now that Zephyr 3.5 has been released, we need to reduce the number of
rimage use cases and the corresponding validation complexity and
maintenance workload to simplify and accelerate new features like
splitting rimage configuration
files (zephyrproject-rtos#65411)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A planned feature with a milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants