From: Frieder Schrempf <frieder@fris.de>
To: Frieder Schrempf <frieder.schrempf@kontron.de>, u-boot@lists.denx.de
Cc: Fabio Estevam <festevam@denx.de>, Peng Fan <peng.fan@nxp.com>,
Stefano Babic <sbabic@denx.de>
Subject: [PATCH 13/14] imx: kontron-sl-mx8mm: Simplify code in spl.c
Date: Wed, 13 Jul 2022 11:52:24 +0200 [thread overview]
Message-ID: <20220713095229.43274-14-frieder@fris.de> (raw)
In-Reply-To: <20220713095229.43274-1-frieder@fris.de>
From: Frieder Schrempf <frieder.schrempf@kontron.de>
Refactor the code a bit without any functional changes.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
board/kontron/sl-mx8mm/spl.c | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c
index 212d712de6f..28211ae78f3 100644
--- a/board/kontron/sl-mx8mm/spl.c
+++ b/board/kontron/sl-mx8mm/spl.c
@@ -109,41 +109,26 @@ static void spl_dram_init(void)
size = 1;
}
- printf("Kontron SL i.MX8MM (N801X) module, %u GB RAM detected\n", size);
+ gd->ram_size = size;
writel(size, M4_BOOTROM_BASE_ADDR);
}
-static int i2c_detect(u8 bus, u16 addr)
-{
- struct udevice *udev;
- int ret;
-
- /*
- * Try to probe the touch controller to check if an LVDS panel is
- * connected.
- */
- ret = i2c_get_chip_for_busnum(bus, addr, 0, &udev);
- if (ret == 0)
- return 0;
-
- return 1;
-}
-
int do_board_detect(void)
{
+ gd->board_type = BOARD_TYPE_KTN_N801X;
+ printf("Kontron SL i.MX8MM (N801X) module, %u GB RAM detected\n", gd->ram_size);
+
/*
* Check the I2C PMIC to detect the deprecated SoM with DA9063.
*/
imx_iomux_v3_setup_multiple_pads(i2c1_pads, ARRAY_SIZE(i2c1_pads));
- if (i2c_detect(0, 0x58) == 0) {
+ if (i2c_get_chip_for_busnum(0, 0x58, 0, &udev) == 0) {
printf("### ATTENTION: DEPRECATED SOM REVISION (N8010 Rev0) DETECTED! ###\n");
printf("### THIS HW IS NOT SUPPORTED AND BOOTING WILL PROBABLY FAIL ###\n");
printf("### PLEASE UPGRADE TO LATEST MODULE ###\n");
}
- gd->board_type = BOARD_TYPE_KTN_N801X;
-
return 0;
}
--
2.37.0
next prev parent reply other threads:[~2022-07-13 9:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 9:52 [PATCH 00/14] imx: kontron-sl-mx8mm: Improvements and OSM board support Frieder Schrempf
2022-07-13 9:52 ` [PATCH 01/14] imx: kontron-sl-mx8mm: Remove LVDS board type and devicetrees Frieder Schrempf
2022-07-13 9:52 ` [PATCH 02/14] imx: kontron-sl-mx8mm: Add redundant environment Frieder Schrempf
2022-07-13 9:52 ` [PATCH 03/14] imx: kontron-sl-mx8mm: Enable environment in MMC Frieder Schrempf
2022-07-13 9:52 ` [PATCH 04/14] imx: kontron-sl-mx8mm: Migrate to use CONFIG_EXTRA_ENV_TEXT Frieder Schrempf
2022-07-13 9:52 ` [PATCH 05/14] imx: kontron-sl-mx8mm: Enable bootaux command Frieder Schrempf
2022-07-13 9:52 ` [PATCH 06/14] imx: kontron-sl-mx8mm: lpddr4_timing.c: Add spaces for proper alignment Frieder Schrempf
2022-07-13 9:52 ` [PATCH 07/14] imx: kontron-sl-mx8mm: Remove 100mt DDR setpoint Frieder Schrempf
2022-07-13 9:52 ` [PATCH 08/14] imx: kontron-sl-mx8mm: Use new LPDDR4 config parameters Frieder Schrempf
2022-07-13 9:52 ` [PATCH 09/14] imx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types Frieder Schrempf
2022-07-13 9:52 ` [PATCH 10/14] imx: kontron-sl-mx8mm: Adjust board and SoM model strings Frieder Schrempf
2022-07-13 9:52 ` [PATCH 11/14] imx: kontron-sl-mx8mm: Use the VSELECT signal to switch SD card IO voltage Frieder Schrempf
2022-07-14 15:23 ` Heiko Thiery
2022-07-13 9:52 ` [PATCH 12/14] imx: kontron-sl-mx8mm: Use voltage rail names from schematic for PMIC regulator-names Frieder Schrempf
2022-07-13 9:52 ` Frieder Schrempf [this message]
2022-07-13 9:52 ` [PATCH 14/14] imx: kontron-sl-mx8mm: Add support for Kontron Electronics SoM SL i.MX8MM OSM-S Frieder Schrempf
2022-07-25 13:03 ` [PATCH 00/14] imx: kontron-sl-mx8mm: Improvements and OSM board support Stefano Babic
2022-08-01 10:31 ` Frieder Schrempf
2022-08-01 11:23 ` Stefano Babic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220713095229.43274-14-frieder@fris.de \
--to=frieder@fris.de \
--cc=festevam@denx.de \
--cc=frieder.schrempf@kontron.de \
--cc=peng.fan@nxp.com \
--cc=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox