summaryrefslogtreecommitdiff
path: root/hw/nseries.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-07-29 16:35:25 +0100
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-07-30 06:42:03 +0200
commitaf5a75f41c2fd172ceaa1cabd4bec99de8dde83a (patch)
tree771b3adfe834fa5014cf82987f35717d68725118 /hw/nseries.c
parentd4220389ffcc1e6302e759d3b15f8605201d6369 (diff)
downloadqemu-af5a75f41c2fd172ceaa1cabd4bec99de8dde83a.tar.gz
qemu-af5a75f41c2fd172ceaa1cabd4bec99de8dde83a.tar.bz2
qemu-af5a75f41c2fd172ceaa1cabd4bec99de8dde83a.zip
onenand: Pass BlockDriverState to init function
Pass the BlockDriverState to the onenand init function so it doesn't need to look up the drive itself. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/nseries.c')
-rw-r--r--hw/nseries.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/nseries.c b/hw/nseries.c
index d12ed46461..be50a5cfc6 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -31,6 +31,7 @@
#include "hw.h"
#include "bt.h"
#include "loader.h"
+#include "blockdev.h"
/* Nokia N8x0 support */
struct n800_s {
@@ -163,13 +164,14 @@ static const uint8_t n8x0_cal_bt_id[] = {
static void n8x0_nand_setup(struct n800_s *s)
{
char *otp_region;
+ DriveInfo *dinfo;
+ dinfo = drive_get(IF_MTD, 0, 0);
/* Either ec40xx or ec48xx are OK for the ID */
+ s->nand = onenand_init(dinfo ? dinfo->bdrv : 0, 0xec4800, 1,
+ qdev_get_gpio_in(s->cpu->gpio, N8X0_ONENAND_GPIO));
omap_gpmc_attach(s->cpu->gpmc, N8X0_ONENAND_CS, 0, onenand_base_update,
- onenand_base_unmap,
- (s->nand = onenand_init(0xec4800, 1,
- qdev_get_gpio_in(s->cpu->gpio,
- N8X0_ONENAND_GPIO))));
+ onenand_base_unmap, s->nand);
otp_region = onenand_raw_otp(s->nand);
memcpy(otp_region + 0x000, n8x0_cal_wlan_mac, sizeof(n8x0_cal_wlan_mac));