修訂 | 484715e5ccc5fa2afc321ac2e2f52b9261ac4c8b (tree) |
---|---|
時間 | 2016-03-23 02:49:17 |
作者 | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
spl: Add IDE support.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
@@ -158,6 +158,9 @@ ifdef CONFIG_SPL_BUILD | ||
158 | 158 | ifdef CONFIG_SPL_SATA_SUPPORT |
159 | 159 | obj-$(CONFIG_CMD_SCSI) += scsi.o |
160 | 160 | endif |
161 | +ifdef CONFIG_SPL_IDE_SUPPORT | |
162 | +obj-$(CONFIG_CMD_IDE) += ide.o | |
163 | +endif | |
161 | 164 | endif # CONFIG_SPL_BUILD |
162 | 165 | |
163 | 166 | obj-$(CONFIG_CMD_BLOB) += blob.o |
@@ -103,9 +103,6 @@ ifdef CONFIG_SPL_ENV_SUPPORT | ||
103 | 103 | obj-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o |
104 | 104 | obj-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o |
105 | 105 | obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o |
106 | -ifdef CONFIG_SPL_IDE_SUPPORT | |
107 | -obj-$(CONFIG_CMD_IDE) += cmd_ide.o | |
108 | -endif | |
109 | 106 | obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o |
110 | 107 | obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o |
111 | 108 | obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o |
@@ -115,9 +112,8 @@ obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o | ||
115 | 112 | obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o |
116 | 113 | endif |
117 | 114 | endif |
118 | -obj-y += cmd_disk.o | |
119 | 115 | #environment |
120 | -obj-y += env_common.o env_flags.o env_attr.o env_callback.o | |
116 | +obj-y += env_common.o | |
121 | 117 | #others |
122 | 118 | obj-$(CONFIG_DDR_SPD) += ddr_spd.o |
123 | 119 | obj-$(CONFIG_SPD_EEPROM) += ddr_spd.o |
@@ -247,6 +247,9 @@ struct boot_device_name boot_name_table[] = { | ||
247 | 247 | #ifdef CONFIG_SPL_SATA_SUPPORT |
248 | 248 | { BOOT_DEVICE_SATA, "SATA" }, |
249 | 249 | #endif |
250 | +#ifdef CONFIG_SPL_IDE_SUPPORT | |
251 | + { BOOT_DEVICE_IDE, "IDE" }, | |
252 | +#endif | |
250 | 253 | /* Keep this entry last */ |
251 | 254 | { BOOT_DEVICE_NONE, "unknown boot device" }, |
252 | 255 | }; |
@@ -334,8 +337,7 @@ static int spl_load_image(u32 boot_device) | ||
334 | 337 | #endif |
335 | 338 | #ifdef CONFIG_SPL_IDE_SUPPORT |
336 | 339 | case BOOT_DEVICE_IDE: |
337 | - spl_ide_load_image(); | |
338 | - break; | |
340 | + return spl_ide_load_image(); | |
339 | 341 | #endif |
340 | 342 | default: |
341 | 343 | #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT) |
@@ -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 | +} |
@@ -47,6 +47,9 @@ const struct block_drvr block_drvr[] = { | ||
47 | 47 | #if defined(CONFIG_SANDBOX) |
48 | 48 | { .name = "host", .get_dev = host_get_dev, }, |
49 | 49 | #endif |
50 | +#if defined(CONFIG_CMD_IDE) | |
51 | + { .name = "ide", .get_dev = ide_get_dev, }, | |
52 | +#endif | |
50 | 53 | { }, |
51 | 54 | }; |
52 | 55 |
@@ -14,6 +14,7 @@ | ||
14 | 14 | * Do not change this file. Instead, convert your board to use CONFIG_DM_PCI |
15 | 15 | * and change pci-uclass.c. |
16 | 16 | */ |
17 | + | |
17 | 18 | #include <common.h> |
18 | 19 | |
19 | 20 | #include <command.h> |
@@ -188,12 +189,6 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index) | ||
188 | 189 | return -1; |
189 | 190 | } |
190 | 191 | |
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 | |
197 | 192 | int pci_hose_config_device(struct pci_controller *hose, |
198 | 193 | pci_dev_t dev, |
199 | 194 | unsigned long io, |
@@ -90,7 +90,7 @@ int spl_usb_load_image(void); | ||
90 | 90 | int spl_sata_load_image(void); |
91 | 91 | |
92 | 92 | /* IDE SPL functions */ |
93 | -void spl_ide_load_image(void); | |
93 | +int spl_ide_load_image(void); | |
94 | 94 | |
95 | 95 | /* SPL FAT image functions */ |
96 | 96 | int spl_load_image_fat(struct blk_desc *block_dev, int partition, |