summaryrefslogtreecommitdiffstats
path: root/platforms/astbmc/pnor.c
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/astbmc/pnor.c')
-rw-r--r--platforms/astbmc/pnor.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/platforms/astbmc/pnor.c b/platforms/astbmc/pnor.c
index c64f41e8..8e88edd7 100644
--- a/platforms/astbmc/pnor.c
+++ b/platforms/astbmc/pnor.c
@@ -30,8 +30,16 @@ int pnor_init(void)
struct flash_chip *pnor_chip;
int rc;
- /* Open controller and flash */
- rc = ast_sf_open(AST_SF_TYPE_PNOR, &pnor_ctrl);
+ /* Open controller and flash. If the LPC->AHB doesn't point to
+ * the PNOR flash base we assume we're booting from BMC system
+ * memory (or some other place setup by the BMC to support LPC
+ * FW reads & writes). */
+ if (ast_is_ahb_lpc_pnor())
+ rc = ast_sf_open(AST_SF_TYPE_PNOR, &pnor_ctrl);
+ else {
+ printf("PLAT: Memboot detected\n");
+ rc = ast_sf_open(AST_SF_TYPE_MEM, &pnor_ctrl);
+ }
if (rc) {
prerror("PLAT: Failed to open PNOR flash controller\n");
goto fail;
@@ -54,4 +62,3 @@ int pnor_init(void)
return rc;
}
-
OpenPOWER on IntegriCloud