summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-06-23 15:07:17 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-27 08:44:36 +0200
commiteb5102a9635d7be8e8a8617a88d169ff19c73d1e (patch)
tree725c3d7a768e8e1745edd60d1748ead920d6486d /include
parent3e98eb88e3f99c9a5c71bcd934134decc8ccc2a8 (diff)
downloadbarebox-eb5102a9635d7be8e8a8617a88d169ff19c73d1e.tar.gz
barebox-eb5102a9635d7be8e8a8617a88d169ff19c73d1e.tar.xz
ddr: imx8m: workaround old spreadsheets not initializing ADDRMAP7
Older NXP DDR spreadsheets don't initialize ADDRMAP7, leaving it at its POR default of zero. Now that barebox looks at ADDRMAP7 to be able to correctly detect bigger memory sizes, barebox proper on out-of-tree boards with older spreadsheets may read back 4x times as much RAM as actually fitted. Work around this by writing a trailing 0xf0f (the neutral ignore-me value for the register) if the register wasn't written through dram_timing_info::ddrc_cfg. We consider this safe to do, because the DDRC is held in reset while these values are programmed. Fixes: dad2b5636bd8 ("ARM: imx: Add imx8 support for 18 bit SDRAM row size handle") Fixes: 6cf197fa61f9 ("arm: imx: mmdc_size: Increase row_max for imx8m") Tested-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220623130717.1447999-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/soc/imx8m/ddr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/soc/imx8m/ddr.h b/include/soc/imx8m/ddr.h
index 9ae7cb8776..147a7d499a 100644
--- a/include/soc/imx8m/ddr.h
+++ b/include/soc/imx8m/ddr.h
@@ -407,6 +407,7 @@ static inline void reg32setbit(unsigned long addr, u32 bit)
#define dwc_ddrphy_apb_rd(addr) \
reg32_read(IOMEM(IP2APB_DDRPHY_IPS_BASE_ADDR(0)) + 4 * (addr))
+extern bool imx8m_ddr_old_spreadsheet;
extern struct dram_cfg_param ddrphy_trained_csr[];
extern uint32_t ddrphy_trained_csr_num;