summaryrefslogtreecommitdiff
path: root/src/soc/marvell/mvmap2315/include
diff options
context:
space:
mode:
authorHakim Giydan <hgiydan@marvell.com>2016-09-08 10:44:40 -0700
committerMartin Roth <martinroth@google.com>2016-09-13 16:57:04 +0200
commit6a1a36f7e9afc9a9dbdee813613243805e829a85 (patch)
tree631604c9e91a7cec3f9fb9afb2552c06d2d45dde /src/soc/marvell/mvmap2315/include
parent03d10ea29ce015797bbb257f2cc890a1abb7837b (diff)
soc/marvell/mvmap2315: Add flash driver
Testing: booted successfully. Change-Id: Iaeff9f01dbfad7f313aa237e8c71c36c4ed1e06f Signed-off-by: Hakim Giydan <hgiydan@marvell.com> Reviewed-on: https://review.coreboot.org/15509 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/marvell/mvmap2315/include')
-rw-r--r--src/soc/marvell/mvmap2315/include/soc/flash.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/soc/marvell/mvmap2315/include/soc/flash.h b/src/soc/marvell/mvmap2315/include/soc/flash.h
new file mode 100644
index 0000000000..fc33096a02
--- /dev/null
+++ b/src/soc/marvell/mvmap2315/include/soc/flash.h
@@ -0,0 +1,57 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __SOC_MARVELL_MVMAP2315_FLASH_H__
+#define __SOC_MARVELL_MVMAP2315_FLASH_H__
+
+#include <stdint.h>
+
+#define MVMAP2315_FLASH_INIT 0xFFE00084
+#define MVMAP2315_FLASH_READ 0xFFE00088
+#define MVMAP2315_FLASH_WRITE 0xFFE0008C
+#define MVMAP2315_FLASH_SHUTDOWN 0xFFE00098
+#define MVMAP2315_FLASH_SET_PARTITION 0xFFE00094
+
+#define MVMAP2315_MMC_CLK_MHZ 0x00000019
+
+enum {
+ MVMAP2315_SD = 7,
+ MVMAP2315_EMMC = 8,
+ MVMAP2315_EEPROM = 27,
+};
+
+struct flash_params {
+ u32 offset;
+ u32 buff;
+ u32 size;
+ u32 id;
+ u32 partition;
+};
+
+struct flash_ops {
+ u32 (*init)(u32 media, u32 context, u32 clock_input_mhz);
+ u32 (*read)(u32 media, u32 context, struct flash_params *);
+ u32 (*write)(u32 media, u32 context, struct flash_params *);
+ u32 (*shutdown)(u32 media, u32 context, struct flash_params *);
+ u32 (*set_partition)(u32 media, u32 context, struct flash_params *);
+};
+
+u32 flash_init(u32 media, u32 clock_input_mhz);
+u32 flash_read(u32 media, struct flash_params *flash_image_info);
+u32 flash_write(u32 media, struct flash_params *flash_image_info);
+u32 flash_shutdown(u32 media);
+u32 flash_partition(u32 media, struct flash_params *flash_image_info);
+
+#endif /* __SOC_MARVELL_MVMAP2315_FLASH_H__ */