• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂484715e5ccc5fa2afc321ac2e2f52b9261ac4c8b (tree)
時間2016-03-23 02:49:17
作者Yoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

spl: Add IDE support.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>

Change Summary

差異

--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -158,6 +158,9 @@ ifdef CONFIG_SPL_BUILD
158158 ifdef CONFIG_SPL_SATA_SUPPORT
159159 obj-$(CONFIG_CMD_SCSI) += scsi.o
160160 endif
161+ifdef CONFIG_SPL_IDE_SUPPORT
162+obj-$(CONFIG_CMD_IDE) += ide.o
163+endif
161164 endif # CONFIG_SPL_BUILD
162165
163166 obj-$(CONFIG_CMD_BLOB) += blob.o
--- a/common/Makefile
+++ b/common/Makefile
@@ -103,9 +103,6 @@ ifdef CONFIG_SPL_ENV_SUPPORT
103103 obj-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
104104 obj-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
105105 obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
106-ifdef CONFIG_SPL_IDE_SUPPORT
107-obj-$(CONFIG_CMD_IDE) += cmd_ide.o
108-endif
109106 obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
110107 obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
111108 obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
@@ -115,9 +112,8 @@ obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
115112 obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
116113 endif
117114 endif
118-obj-y += cmd_disk.o
119115 #environment
120-obj-y += env_common.o env_flags.o env_attr.o env_callback.o
116+obj-y += env_common.o
121117 #others
122118 obj-$(CONFIG_DDR_SPD) += ddr_spd.o
123119 obj-$(CONFIG_SPD_EEPROM) += ddr_spd.o
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -247,6 +247,9 @@ struct boot_device_name boot_name_table[] = {
247247 #ifdef CONFIG_SPL_SATA_SUPPORT
248248 { BOOT_DEVICE_SATA, "SATA" },
249249 #endif
250+#ifdef CONFIG_SPL_IDE_SUPPORT
251+ { BOOT_DEVICE_IDE, "IDE" },
252+#endif
250253 /* Keep this entry last */
251254 { BOOT_DEVICE_NONE, "unknown boot device" },
252255 };
@@ -334,8 +337,7 @@ static int spl_load_image(u32 boot_device)
334337 #endif
335338 #ifdef CONFIG_SPL_IDE_SUPPORT
336339 case BOOT_DEVICE_IDE:
337- spl_ide_load_image();
338- break;
340+ return spl_ide_load_image();
339341 #endif
340342 default:
341343 #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
--- /dev/null
+++ b/common/spl/spl_ide.c
@@ -0,0 +1,39 @@
1+/*
2+ * (C) Copyright 2016 Yoshinori Sato <ysato@users.sourceforge.jp>
3+ *
4+ * SPDX-License-Identifier: GPL-2.0+
5+ *
6+ * Derived work from spl_sata.c
7+ */
8+
9+#include <common.h>
10+#include <spl.h>
11+#include <asm/u-boot.h>
12+#include <ide.h>
13+#include <fat.h>
14+#include <version.h>
15+#include <image.h>
16+
17+DECLARE_GLOBAL_DATA_PTR;
18+
19+int spl_ide_load_image(void)
20+{
21+ int err;
22+ struct blk_desc *stor_dev;
23+
24+ /* try to recognize storage devices immediately */
25+ stor_dev = ide_get_dev(0);
26+
27+#ifdef CONFIG_SPL_OS_BOOT
28+ if (spl_start_uboot() || spl_load_image_fat_os(stor_dev,
29+ CONFIG_SYS_IDE_FAT_BOOT_PARTITION))
30+#endif
31+ err = spl_load_image_fat(stor_dev,
32+ CONFIG_SYS_IDE_FAT_BOOT_PARTITION,
33+ CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
34+ if (err) {
35+ puts("Error loading IDE device\n");
36+ return err;
37+ }
38+ return 0;
39+}
--- a/disk/part.c
+++ b/disk/part.c
@@ -47,6 +47,9 @@ const struct block_drvr block_drvr[] = {
4747 #if defined(CONFIG_SANDBOX)
4848 { .name = "host", .get_dev = host_get_dev, },
4949 #endif
50+#if defined(CONFIG_CMD_IDE)
51+ { .name = "ide", .get_dev = ide_get_dev, },
52+#endif
5053 { },
5154 };
5255
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -14,6 +14,7 @@
1414 * Do not change this file. Instead, convert your board to use CONFIG_DM_PCI
1515 * and change pci-uclass.c.
1616 */
17+
1718 #include <common.h>
1819
1920 #include <command.h>
@@ -188,12 +189,6 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
188189 return -1;
189190 }
190191
191-
192-#if defined(CONFIG_SH4_PCI)
193- /* from Logic address to Physical address */
194- if( (phys_addr & 0xF0000000) == 0x80000000)
195- phys_addr &= ~0x80000000;
196-#endif
197192 int pci_hose_config_device(struct pci_controller *hose,
198193 pci_dev_t dev,
199194 unsigned long io,
--- a/include/spl.h
+++ b/include/spl.h
@@ -90,7 +90,7 @@ int spl_usb_load_image(void);
9090 int spl_sata_load_image(void);
9191
9292 /* IDE SPL functions */
93-void spl_ide_load_image(void);
93+int spl_ide_load_image(void);
9494
9595 /* SPL FAT image functions */
9696 int spl_load_image_fat(struct blk_desc *block_dev, int partition,