diff options
author | Sam Leffler <sam@FreeBSD.org> | 2009-03-10 22:29:42 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2009-03-10 22:29:42 +0000 |
commit | 7bed4560f32f2b3b42e1c1b920d1a793e03c6d85 (patch) | |
tree | ea92f18007d22e43e61f149002893113ef9d47bf /sys/dev/cfi/cfi_disk.c | |
parent | 41f0c915177801f8dc3eea634382b883cc54ec65 (diff) | |
download | src-7bed4560f32f2b3b42e1c1b920d1a793e03c6d85.tar.gz src-7bed4560f32f2b3b42e1c1b920d1a793e03c6d85.zip |
choose the size of the last region for d_stripsize instead of the first;
this fixes geom_redboot on boards that have multiple parts/regions as it
uses the value to locate the FIS directory which is in the last erase
region of flash
Notes
Notes:
svn path=/head/; revision=189654
Diffstat (limited to 'sys/dev/cfi/cfi_disk.c')
-rw-r--r-- | sys/dev/cfi/cfi_disk.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/cfi/cfi_disk.c b/sys/dev/cfi/cfi_disk.c index eaa03fdb5014..20f422b19d5c 100644 --- a/sys/dev/cfi/cfi_disk.c +++ b/sys/dev/cfi/cfi_disk.c @@ -99,9 +99,16 @@ cfi_disk_attach(device_t dev) sc->disk->d_mediasize = sc->parent->sc_size; sc->disk->d_maxsize = CFI_DISK_MAXIOSIZE; /* NB: use stripesize to hold the erase/region size */ - if (sc->parent->sc_regions) - sc->disk->d_stripesize = sc->parent->sc_region->r_blksz; - else + if (sc->parent->sc_regions) { + /* + * Multiple regions, use the last one. This is a + * total hack as it's (presently) used only by + * geom_redboot to locate the FIS directory which + * lies at the start of the last erase region. + */ + sc->disk->d_stripesize = + sc->parent->sc_region[sc->parent->sc_regions-1].r_blksz; + } else sc->disk->d_stripesize = sc->disk->d_mediasize; sc->disk->d_drv1 = sc; disk_create(sc->disk, DISK_VERSION); |