[U-Boot] [PATCH 0/4] malta: IDE support, reset fix, config updates

This series includes a few assorted improvements to the MIPS Malta board support.
Paul Burton (4): malta: IDE support malta: delay after reset malta: enable HUSH parser malta: enable ELF loading
arch/mips/include/asm/malta.h | 5 +++++ board/imgtec/malta/malta.c | 20 ++++++++++++++++++++ include/configs/malta.h | 13 +++++++++++++ 3 files changed, 38 insertions(+)

This patch adds IDE support to the MIPS Malta board. The IDE controller is enabled after probing the PCI bus and otherwise just makes use of U-boot generic IDE support.
Signed-off-by: Paul Burton paul.burton@imgtec.com Cc: Daniel Schwierzeck daniel.schwierzeck@gmail.com --- arch/mips/include/asm/malta.h | 5 +++++ board/imgtec/malta/malta.c | 19 +++++++++++++++++++ include/configs/malta.h | 11 +++++++++++ 3 files changed, 35 insertions(+)
diff --git a/arch/mips/include/asm/malta.h b/arch/mips/include/asm/malta.h index 9e7c045..d9ffc15 100644 --- a/arch/mips/include/asm/malta.h +++ b/arch/mips/include/asm/malta.h @@ -64,4 +64,9 @@
#define PCI_CFG_PIIX4_GENCFG_SERIRQ (1 << 16)
+#define PCI_CFG_PIIX4_IDETIM_PRI 0x40 +#define PCI_CFG_PIIX4_IDETIM_SEC 0x42 + +#define PCI_CFG_PIIX4_IDETIM_IDE (1 << 15) + #endif /* _MIPS_ASM_MALTA_H */ diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index 78c4bd4..72b03ff 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -6,6 +6,7 @@ */
#include <common.h> +#include <ide.h> #include <netdev.h> #include <pci.h> #include <pci_gt64120.h> @@ -217,4 +218,22 @@ void pci_init_board(void) pci_read_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, &val8); val8 |= PCI_CFG_PIIX4_SERIRQC_EN | PCI_CFG_PIIX4_SERIRQC_CONT; pci_write_config_byte(bdf, PCI_CFG_PIIX4_SERIRQC, val8); + + bdf = pci_find_device(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82371AB, 0); + if (bdf == -1) + panic("Failed to find PIIX4 IDE controller\n"); + + /* enable bus master & IO access */ + val32 |= PCI_COMMAND_MASTER | PCI_COMMAND_IO; + pci_write_config_dword(bdf, PCI_COMMAND, val32); + + /* set latency */ + pci_write_config_byte(bdf, PCI_LATENCY_TIMER, 0x40); + + /* enable IDE/ATA */ + pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_PRI, + PCI_CFG_PIIX4_IDETIM_IDE); + pci_write_config_dword(bdf, PCI_CFG_PIIX4_IDETIM_SEC, + PCI_CFG_PIIX4_IDETIM_IDE); } diff --git a/include/configs/malta.h b/include/configs/malta.h index 684d249..ed5da6c 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -107,6 +107,16 @@ (CONFIG_SYS_FLASH_BASE + (4 << 20) - CONFIG_ENV_SIZE)
/* + * IDE/ATA + */ +#define CONFIG_SYS_IDE_MAXBUS 1 +#define CONFIG_SYS_IDE_MAXDEVICE 2 +#define CONFIG_SYS_ATA_BASE_ADDR CONFIG_SYS_ISA_IO_BASE_ADDRESS +#define CONFIG_SYS_ATA_IDE0_OFFSET 0x01f0 +#define CONFIG_SYS_ATA_DATA_OFFSET 0 +#define CONFIG_SYS_ATA_REG_OFFSET 0 + +/* * Commands */ #include <config_cmd_default.h> @@ -118,6 +128,7 @@
#define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP +#define CONFIG_CMD_IDE #define CONFIG_CMD_PCI #define CONFIG_CMD_PING

Reset isn't instant, so delay to give it a chance. Otherwise we go on to print a failure message before resetting anyway.
Signed-off-by: Paul Burton paul.burton@imgtec.com Cc: Daniel Schwierzeck daniel.schwierzeck@gmail.com --- board/imgtec/malta/malta.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c index 72b03ff..79562f7 100644 --- a/board/imgtec/malta/malta.c +++ b/board/imgtec/malta/malta.c @@ -124,6 +124,7 @@ void _machine_restart(void)
reset_base = (void __iomem *)CKSEG1ADDR(MALTA_RESET_BASE); __raw_writel(GORESET, reset_base); + mdelay(1000); }
int board_early_init_f(void)

The malta board is used for development and thus the shell is interacted with often. Enable HUSH to make the experience a little more pleasant.
Signed-off-by: Paul Burton paul.burton@imgtec.com Cc: Daniel Schwierzeck daniel.schwierzeck@gmail.com --- include/configs/malta.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/malta.h b/include/configs/malta.h index ed5da6c..4e64cc9 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -71,6 +71,7 @@ sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_SYS_MAXARGS 16
+#define CONFIG_SYS_HUSH_PARSER #define CONFIG_AUTO_COMPLETE #define CONFIG_CMDLINE_EDITING

The ability to load ELF files is sometimes useful on Malta boards, particularly for use with small embedded applications. Enable the loadelf command in the malta config.
Signed-off-by: Paul Burton paul.burton@imgtec.com Cc: Daniel Schwierzeck daniel.schwierzeck@gmail.com --- include/configs/malta.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/malta.h b/include/configs/malta.h index 4e64cc9..354672e 100644 --- a/include/configs/malta.h +++ b/include/configs/malta.h @@ -129,6 +129,7 @@
#define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP +#define CONFIG_CMD_ELF #define CONFIG_CMD_IDE #define CONFIG_CMD_PCI #define CONFIG_CMD_PING

2015-01-29 11:38 GMT+01:00 Paul Burton paul.burton@imgtec.com:
This series includes a few assorted improvements to the MIPS Malta board support.
Paul Burton (4): malta: IDE support malta: delay after reset malta: enable HUSH parser malta: enable ELF loading
all patches applied to u-boot-mips/master, thanks
participants (2)
-
Daniel Schwierzeck
-
Paul Burton