HACK: arndale: deinit scsi before launching Linux
Subsystems (3)
PATCH 1/1 HACK: arndale: deinit scsi before launching Linux
From: Ian Campbell <[email protected]>
NOT TO BE APPLIED AS IS
Without this Linux fails to correctly init the phy (or something) and cannot detect the disk.
Even with this we can fail to detect the disk outselves on some fraction of boots, so something else is clearly up too.
--- arch/arm/cpu/armv7/exynos/sata.c | 11 +++++++++++ arch/arm/lib/bootm.c | 4 ++++ board/samsung/arndale/arndale.c | 5 +++++ drivers/block/ahci.c | 4 ++++ include/scsi.h | 1 + 5 files changed, 25 insertions(+)
arch/arm/cpu/armv7/exynos/sata.c +11 -0
@@ -310,6 +310,11 @@ static int exynos5_ahci_init(void __iomem *mmio)printf ("%s: already calibrated?\n" , __func__); } +/* Clear phy control enable. Seems to be necessary to +* reinitialise on a warm reboot, at least sometimes. */ +clrbits_le32 (EXYNOS5_SATA_PHY_CONTROL ,S5P_PMU_SATA_PHY_CONTROL_EN ); +udelay (1000 ); +setbits_le32 (EXYNOS5_SATA_PHY_CONTROL ,S5P_PMU_SATA_PHY_CONTROL_EN );__raw_writel (0 , phy_ctrl +SATA_RESET );
@@ -368,3 +373,9 @@ int exynos5_sata_init(void) }return -ENODEV ; } + +int exynos5_sata_deinit (void ) +{ +clrbits_le32 (EXYNOS5_SATA_PHY_CONTROL ,S5P_PMU_SATA_PHY_CONTROL_EN ); +return 0 ; +}
arch/arm/lib/bootm.c +4 -0
@@ -15,6 +15,7 @@#include <common.h> #include <command.h> #include <image.h> +#include <scsi.h> #include <u-boot/zlib.h> #include <asm/byteorder.h> #include <libfdt.h>
@@ -81,6 +82,9 @@ static void announce_and_cleanup(int fake)#ifdef CONFIG_USB_DEVICE udc_disconnect ();#endif +#ifdef CONFIG_SCSI_AHCI_PLAT +scsi_deinit (); +#endif cleanup_before_linux (); }
board/samsung/arndale/arndale.c +5 -0
@@ -36,6 +36,11 @@ int scsi_init(void)printf ("ARNDALE SCSI INIT\n" ); return exynos5_sata_init(); } + +int scsi_deinit (void ) +{ +return exynos5_sata_deinit (); +}#endif int board_init (void )
drivers/block/ahci.c +4 -0
@@ -959,6 +959,10 @@ void __weak scsi_init(void) { } +void __weak scsi_deinit (void ) +{ +} +#endif /*
include/scsi.h +1 -0
@@ -172,6 +172,7 @@ void scsi_low_level_init(int busdevfunc);* functions residing inside cmd_scsi.c */ void scsi_init (void ); +void scsi_deinit (void );void scsi_scan (int mode);/** @return the number of scsi disks */
Signature · 1 line
2.1.0
PATCH 1/1 HACK: arndale: deinit scsi before launching Linux
On Tue, 2014-10-07 at 14:36 +0100, Ian Campbell wrote:
Please ignore, I ran git send-email from the wrong branch, this isn't ready yet...
PATCH 1/1 HACK: arndale: deinit scsi before launching Linux
Hi Ian,
In any case, if a patch is not to be applied but only commented, please think of adding the [RFC] tag to it.
Quoted 4 lines · Ian Campbell
On Tue, 2014-10-07 at 14:36 +0100, Ian Campbell wrote:
Please ignore, I ran git send-email from the wrong branch, this isn't ready yet...
Amicalement,
Signature · 1 line
Albert.