mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] disk_drive: fix x86 support
@ 2011-08-14 14:59 Jean-Christophe PLAGNIOL-VILLARD
  2011-08-14 14:59 ` [PATCH 2/2] x86/generic_pc: fix missing switch to resource Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-14 14:59 UTC (permalink / raw)
  To: barebox

switch to resource

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/ata/disk_drive.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/disk_drive.c b/drivers/ata/disk_drive.c
index 523edfd..14b5e66 100644
--- a/drivers/ata/disk_drive.c
+++ b/drivers/ata/disk_drive.c
@@ -190,11 +190,11 @@ static int disk_probe(struct device_d *dev)
 
 #ifdef CONFIG_ATA_BIOS
 	/* On x86, BIOS based disks are coming without a valid .size field */
-	if (dev->size == 0) {
+	if (dev->resource[0].size == 0) {
 		/* guess the size of this drive if not otherwise given */
-		dev->size = disk_guess_size(dev,
+		dev->resource[0].size = disk_guess_size(dev,
 			(struct partition_entry*)&sector[446]) * SECTOR_SIZE;
-		dev_info(dev, "Drive size guessed to %u kiB\n", dev->size / 1024);
+		dev_info(dev, "Drive size guessed to %u kiB\n", dev->resource[0].size / 1024);
 	}
 #endif
 	atablk->blk.num_blocks = dev->resource[0].size / SECTOR_SIZE;
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] x86/generic_pc: fix missing switch to resource
  2011-08-14 14:59 [PATCH 1/2] disk_drive: fix x86 support Jean-Christophe PLAGNIOL-VILLARD
@ 2011-08-14 14:59 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-14 14:59 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/x86/boards/x86_generic/generic_pc.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c
index 7a93d9b..0ddf883 100644
--- a/arch/x86/boards/x86_generic/generic_pc.c
+++ b/arch/x86/boards/x86_generic/generic_pc.c
@@ -30,12 +30,6 @@
 #include <asm/syslib.h>
 #include <ns16550.h>
 
-static struct device_d bios_disk_dev = {
-	.id		= -1,
-	.name		= "biosdrive",
-	.size		= 0,	/* auto guess */
-};
-
 /*
  * These datas are from the MBR, created by the linker and filled by the
  * setup tool while installing barebox on the disk drive
@@ -54,12 +48,10 @@ static int devices_init(void)
 {
 	int rc;
 
-	sdram_dev.size = bios_get_memsize();	/* extended memory only */
-	sdram_dev.size <<= 10;
-
-	add_mem_device("ram0", 0x0, 16 * 1024 * 1024,
+	/* extended memory only */
+	add_mem_device("ram0", 0x0, bios_get_memsize() << 10,
 		       IORESOURCE_MEM_WRITEABLE);
-	register_device(&bios_disk_dev);
+	add_generic_device("biosdrive", -1, NULL, 0, 0, IORESOURCE_MEM, NULL);
 
 	if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) {
 		rc = devfs_add_partition("biosdisk0",
-- 
1.7.5.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-14 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-14 14:59 [PATCH 1/2] disk_drive: fix x86 support Jean-Christophe PLAGNIOL-VILLARD
2011-08-14 14:59 ` [PATCH 2/2] x86/generic_pc: fix missing switch to resource Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox