From: Marek Vasut Date: Wed, 8 Apr 2020 15:49:02 +0200 Subject: [PATCH 2/4] [RFC] ram: stm32mp1: Add support for multiple configs In-Reply-To: References: <20200331234807.432637-1-marex@denx.de> <20200331234807.432637-2-marex@denx.de> <3cbcd09e97994373a9305887dc895e59@SFHDAG6NODE3.st.com> <1473bd8e-effb-5dfc-7207-be78689cf937@denx.de> Message-ID: <26705199-4f73-1df3-abbf-e3b0b88efaa3@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 4/8/20 12:17 PM, Patrick DELAUNAY wrote: > Hi Marek, Hi, >> From: Marek Vasut >> Sent: mardi 7 avril 2020 21:58 >> >> On 4/7/20 3:04 PM, Patrick DELAUNAY wrote: >>> Hi Marek, >> >> Hi, >> >> [...] >> >>>> +__weak int board_stm32mp1_ddr_config_name_match(struct udevice *dev, >>>> + const char *name) >>>> +{ >>>> + return 0; /* Always match */ >>>> +} >>>> + >>>> +static ofnode stm32mp1_ddr_get_ofnode(struct udevice *dev) { >>>> + const char *name; >>>> + ofnode node; >>>> + >>>> + node = dev_ofnode(dev); >>>> + name = ofnode_get_name(node); >>>> + if (!board_stm32mp1_ddr_config_name_match(dev, name)) >>>> + return node; >>> >>> Compare with name of the node or with name of DDR configuration ? >>> >>> For me " st,mem-name" is same than "description" in FIT config. >>> >>> name = ofnode_read_string(node, "st,mem-name"); >>> >>> if (name && !board_stm32mp1_ddr_config_name_match(dev, name)) >>> return node; >> >> st,mem-name contains the version string, which makes it not very usable, >> see: >> >> arch/arm/dts/stm32mp15-ddr3-1x4Gb-1066-binG.dtsi:#define DDR_MEM_NAME >> "DDR3-1066/888 bin G 1x4Gb 533MHz v1.45" >> arch/arm/dts/stm32mp15-ddr3-2x4Gb-1066-binG.dtsi:#define DDR_MEM_NAME >> "DDR3-1066/888 bin G 2x4Gb 533MHz v1.45" >> >> That "v1.45" part. > > It is the version of first internal tools used to generated the ddr file , which define register > values according type, timing , size, frequency. > I kept it with when I upstream the file (for U-Boot and TF-A) but it was a bad idea. No, that's a good idea, at least we know which version is used. That could be important. > I align these 2 files with the files generated by the official tools = CubeMX > and this version indication disappear (but DDR_MEM_NAME change) > in http://patchwork.ozlabs.org/patch/1264835/ > > [14/16] ARM: dts: stm32mp15: use DDR3 files generated by STM32CubeMX > > NB: You can also compare reg if you are OK with my proposal (config at 2 / config at 3) That is absolutely error-prone. We need some unique unambiguous identifier, maybe a compatible string for the memory config ?