ATA/DISK: The BIOS based disk driver is not an interface
Using the BIOS to access attached hard disks means a full disk driver, not only an interface to the drives. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
bda834847d
commit
0084116bcc
|
@ -20,9 +20,7 @@ config DISK_DRIVE
|
||||||
of devices is using a partition table in the first sector. Say Y here
|
of devices is using a partition table in the first sector. Say Y here
|
||||||
if you intend to work with disk drives (also CF cards and SD cards).
|
if you intend to work with disk drives (also CF cards and SD cards).
|
||||||
|
|
||||||
comment "interface types"
|
config DISK_BIOS
|
||||||
|
|
||||||
config ATA_BIOS
|
|
||||||
bool "BIOS based"
|
bool "BIOS based"
|
||||||
select DISK_DRIVE
|
select DISK_DRIVE
|
||||||
depends on X86_BIOS_BRINGUP
|
depends on X86_BIOS_BRINGUP
|
||||||
|
@ -32,4 +30,6 @@ config ATA_BIOS
|
||||||
media to work on. Disadvantage is: Due to its 16 bit nature it is
|
media to work on. Disadvantage is: Due to its 16 bit nature it is
|
||||||
slow.
|
slow.
|
||||||
|
|
||||||
|
comment "interface types"
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# drive types
|
# drive types
|
||||||
|
|
||||||
obj-$(CONFIG_DISK_DRIVE) += disk_drive.o
|
obj-$(CONFIG_DISK_DRIVE) += disk_drive.o
|
||||||
|
obj-$(CONFIG_DISK_BIOS) += disk_bios_drive.o
|
||||||
|
|
||||||
# interface types
|
# interface types
|
||||||
|
|
||||||
obj-$(CONFIG_ATA_BIOS) += bios.o
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct partition_entry {
|
||||||
* @param table partition table
|
* @param table partition table
|
||||||
* @return size in sectors
|
* @return size in sectors
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_ATA_BIOS
|
#ifdef CONFIG_DISK_BIOS
|
||||||
static unsigned long disk_guess_size(struct device_d *dev, struct partition_entry *table)
|
static unsigned long disk_guess_size(struct device_d *dev, struct partition_entry *table)
|
||||||
{
|
{
|
||||||
int part_order[4] = {0, 1, 2, 3};
|
int part_order[4] = {0, 1, 2, 3};
|
||||||
|
@ -186,14 +186,14 @@ static int disk_probe(struct device_d *dev)
|
||||||
* the drive ordering must not correspond to the Linux drive order,
|
* the drive ordering must not correspond to the Linux drive order,
|
||||||
* use the 'biosdisk' name instead.
|
* use the 'biosdisk' name instead.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_ATA_BIOS
|
#ifdef CONFIG_DISK_BIOS
|
||||||
if (strcmp(dev->driver->name, "biosdisk") == 0)
|
if (strcmp(dev->driver->name, "biosdisk") == 0)
|
||||||
atablk->blk.cdev.name = asprintf("biosdisk%d", dev->id);
|
atablk->blk.cdev.name = asprintf("biosdisk%d", dev->id);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
atablk->blk.cdev.name = asprintf("disk%d", dev->id);
|
atablk->blk.cdev.name = asprintf("disk%d", dev->id);
|
||||||
|
|
||||||
#ifdef CONFIG_ATA_BIOS
|
#ifdef CONFIG_DISK_BIOS
|
||||||
/* On x86, BIOS based disks are coming without a valid .size field */
|
/* On x86, BIOS based disks are coming without a valid .size field */
|
||||||
if (dev->resource[0].size == 0) {
|
if (dev->resource[0].size == 0) {
|
||||||
/* guess the size of this drive if not otherwise given */
|
/* guess the size of this drive if not otherwise given */
|
||||||
|
@ -223,7 +223,7 @@ on_error:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ATA_BIOS
|
#ifdef CONFIG_DISK_BIOS
|
||||||
static struct driver_d biosdisk_driver = {
|
static struct driver_d biosdisk_driver = {
|
||||||
.name = "biosdisk",
|
.name = "biosdisk",
|
||||||
.probe = disk_probe,
|
.probe = disk_probe,
|
||||||
|
@ -237,7 +237,7 @@ static struct driver_d disk_driver = {
|
||||||
|
|
||||||
static int disk_init(void)
|
static int disk_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ATA_BIOS
|
#ifdef CONFIG_DISK_BIOS
|
||||||
register_driver(&biosdisk_driver);
|
register_driver(&biosdisk_driver);
|
||||||
#endif
|
#endif
|
||||||
register_driver(&disk_driver);
|
register_driver(&disk_driver);
|
||||||
|
|
Loading…
Reference in New Issue