Skip to content

Commit

Permalink
u-boot features and fixes, more kernel modules
Browse files Browse the repository at this point in the history
1. Manually edited patch 0018-lx... to fix atheros phy related config.
2. Just before booting the kernel toggle back the fan full speed signal
to enable the kernel driver to initialize the AMC6821 device
3. Add u-boot poweroff command that set S5# (GPIO3 7) signal to low;
thus turning off the HoneyComb / ClearFog CX boards.

Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
  • Loading branch information
rabeeh committed Jul 6, 2020
1 parent 8b208b3 commit 5c7bf24
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configs/linux/lx2k_additions.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
CONFIG_BLK_DEV_RAM_SIZE=524288
CONFIG_POWER_RESET_GPIO=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
CONFIG_CRYPTO_USER_API_AEAD=y
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ index 2a3441d263..d2e62a6e91 100644
CONFIG_DM_PCI=y
CONFIG_DM_PCI_COMPAT=y
CONFIG_PCIE_LAYERSCAPE_GEN4=y
CONFIG_PHY_ATHEROS=y
CONFIG_PCIE_LAYERSCAPE=y
-CONFIG_E1000=y
+CONFIG_DM_RTC=y
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
From 1adcdbbe9eb3995e909d1925370163bf5a017e0d Mon Sep 17 00:00:00 2001
From: Rabeeh Khoury <rabeeh@solid-run.com>
Date: Mon, 6 Jul 2020 16:45:43 +0300
Subject: [PATCH] lx2160acex7: add poweroff and disable fan full speed

1. Add poweroff command; when using Clearfog CX or HoneyComb carrier
boards, the S5# signal is connected to the power button controller that
cuts off the '12v' supply from the COM module.

2. In board_fix_fdt, just before booting the kernel the fan full speed
signal becomes inactive so that the kernel AMC6821 driver would take
over and enable the auto thermal and pwm adjustments.

Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
---
.../asm/arch-fsl-layerscape/immap_lsch3.h | 3 +++
board/solidrun/lx2160a/lx2160a.c | 21 +++++++++++++++++++
configs/lx2160acex7_tfa_defconfig | 2 +-
3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
index 299201b157..32cc5ebd35 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
@@ -65,6 +65,9 @@
#define I2C7_BASE_ADDR (CONFIG_SYS_IMMR + 0x01060000)
#define I2C8_BASE_ADDR (CONFIG_SYS_IMMR + 0x01070000)
#endif
+#define GPIO3_BASE_ADDR (CONFIG_SYS_IMMR + 0x01320000)
+#define GPIO3_GPDIR_ADDR (GPIO3_BASE_ADDR + 0x0)
+#define GPIO3_GPDAT_ADDR (GPIO3_BASE_ADDR + 0x8)
#define GPIO4_BASE_ADDR (CONFIG_SYS_IMMR + 0x01330000)
#define GPIO4_GPDIR_ADDR (GPIO4_BASE_ADDR + 0x0)
#define GPIO4_GPDAT_ADDR (GPIO4_BASE_ADDR + 0x8)
diff --git a/board/solidrun/lx2160a/lx2160a.c b/board/solidrun/lx2160a/lx2160a.c
index 975431fd53..8c42d63acc 100644
--- a/board/solidrun/lx2160a/lx2160a.c
+++ b/board/solidrun/lx2160a/lx2160a.c
@@ -357,8 +357,29 @@ int ft_board_setup(void *blob, bd_t *bd)
#ifdef CONFIG_FSL_MC_ENET
fdt_fsl_mc_fixup_iommu_map_entry(blob);
fdt_fixup_board_enet(blob);
+#endif
+ printf ("Releasing fan controller full speed gpio\n");
+ /*
+ * Set the GPIO to be input; the on-COM pullup will disable the full speed
+ * signal.
+ */
+ out_le32(GPIO3_GPDIR_ADDR, (~(1 << 29) &
+ in_le32(GPIO3_GPDIR_ADDR)));
+ return 0;
+}
#endif

+#ifdef CONFIG_CMD_POWEROFF
+int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ printf ("Powering off by setting S5# to low\n");
+ out_le32(GPIO3_GPDAT_ADDR, (~(1 << 24) &
+ in_le32(GPIO3_GPDAT_ADDR)));
+ out_le32(GPIO3_GPDIR_ADDR, (1 << 24 |
+ in_le32(GPIO3_GPDIR_ADDR)));
+ while (1) {}
+
+ /* not reached */
return 0;
}
#endif
diff --git a/configs/lx2160acex7_tfa_defconfig b/configs/lx2160acex7_tfa_defconfig
index 8e96265843..837d6070dd 100644
--- a/configs/lx2160acex7_tfa_defconfig
+++ b/configs/lx2160acex7_tfa_defconfig
@@ -68,7 +68,7 @@ CONFIG_PHY_ATHEROS=y
CONFIG_PCIE_LAYERSCAPE=y
CONFIG_DM_RTC=y
CONFIG_RTC_PCF2127=y
-
+CONFIG_CMD_POWEROFF=y
CONFIG_DM_SCSI=y
CONFIG_DM_SERIAL=y
CONFIG_SPI=y
--
2.17.1

0 comments on commit 5c7bf24

Please sign in to comment.