aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-06-02 10:51:02 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-09 16:37:33 +1000
commit39d9e14cdeef9a20e3da05d527b136de65e39904 (patch)
tree13246271b2b9fba1dbfc0a6729ca84223668e6cf /platforms
parent1fd9d5afc6aff3870695110c74a4a9daa88e5c81 (diff)
downloadskiboot-39d9e14cdeef9a20e3da05d527b136de65e39904.zip
skiboot-39d9e14cdeef9a20e3da05d527b136de65e39904.tar.gz
skiboot-39d9e14cdeef9a20e3da05d527b136de65e39904.tar.bz2
libflash: start using the blocklevel interface.
Converted all the libflash calls to use the blocklevel interface, modified all callers to libflash to use the blocklevel interface. This patch should introduce next to no functional change. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/astbmc/pnor.c12
-rw-r--r--platforms/rhesus/rhesus.c11
2 files changed, 13 insertions, 10 deletions
diff --git a/platforms/astbmc/pnor.c b/platforms/astbmc/pnor.c
index d294c1f..634cb86 100644
--- a/platforms/astbmc/pnor.c
+++ b/platforms/astbmc/pnor.c
@@ -20,6 +20,7 @@
#include <opal.h>
#include <libflash/libflash.h>
#include <libflash/libffs.h>
+#include <libflash/blocklevel.h>
#include <ast.h>
#include "astbmc.h"
@@ -27,7 +28,7 @@
int pnor_init(void)
{
struct spi_flash_ctrl *pnor_ctrl;
- struct flash_chip *pnor_chip = NULL;
+ struct blocklevel_device *bl;
int rc;
/* Open controller and flash. If the LPC->AHB doesn't point to
@@ -44,19 +45,20 @@ int pnor_init(void)
prerror("PLAT: Failed to open PNOR flash controller\n");
goto fail;
}
- rc = flash_init(pnor_ctrl, &pnor_chip);
+
+ rc = flash_init(pnor_ctrl, &bl);
if (rc) {
prerror("PLAT: Failed to open init PNOR driver\n");
goto fail;
}
- rc = flash_register(pnor_chip, true);
+ rc = flash_register(bl, true);
if (!rc)
return 0;
fail:
- if (pnor_chip)
- flash_exit(pnor_chip);
+ if (bl)
+ flash_exit(bl);
if (pnor_ctrl)
ast_sf_close(pnor_ctrl);
diff --git a/platforms/rhesus/rhesus.c b/platforms/rhesus/rhesus.c
index 27e1c91..855d0e4 100644
--- a/platforms/rhesus/rhesus.c
+++ b/platforms/rhesus/rhesus.c
@@ -22,6 +22,7 @@
#include <opal.h>
#include <libflash/libflash.h>
#include <libflash/libffs.h>
+#include <libflash/blocklevel.h>
#include <sfc-ctrl.h>
#include <ec/config.h>
#include <ec/gpio.h>
@@ -118,7 +119,7 @@ static int64_t rhesus_power_down(uint64_t request __unused)
static int rhesus_pnor_init(void)
{
struct spi_flash_ctrl *pnor_ctrl;
- struct flash_chip *pnor_chip = NULL;
+ struct blocklevel_device *bl;
int rc;
/* Open controller, flash and ffs */
@@ -127,19 +128,19 @@ static int rhesus_pnor_init(void)
prerror("PLAT: Failed to open PNOR flash controller\n");
goto fail;
}
- rc = flash_init(pnor_ctrl, &pnor_chip);
+ rc = flash_init(pnor_ctrl, &bl);
if (rc) {
prerror("PLAT: Failed to open init PNOR driver\n");
goto fail;
}
- rc = flash_register(pnor_chip, true);
+ rc = flash_register(bl, true);
if (!rc)
return 0;
fail:
- if (pnor_chip)
- flash_exit(pnor_chip);
+ if (bl)
+ flash_exit(bl);
if (pnor_ctrl)
sfc_close(pnor_ctrl);