Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/12502


Change subject: add code to initialize flash
......................................................................

add code to initialize flash

Change-Id: I2a208abb39a9da8796e2a4bcb803ce32686cb95f
---
M driver_init.c
M driver_init.h
2 files changed, 21 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/02/12502/1

diff --git a/driver_init.c b/driver_init.c
index 920593a..b324be8 100644
--- a/driver_init.c
+++ b/driver_init.c
@@ -126,9 +126,23 @@
        USB_DEVICE_INSTANCE_PORT_init();
 }

+struct flash_descriptor FLASH_0;
+
+void FLASH_0_CLOCK_init(void)
+{
+       hri_mclk_set_AHBMASK_NVMCTRL_bit(MCLK);
+}
+
+void FLASH_0_init(void)
+{
+       FLASH_0_CLOCK_init();
+       flash_init(&FLASH_0, NVMCTRL);
+}
+
 void system_init(void)
 {
        init_mcu();

        USB_DEVICE_INSTANCE_init();
+       FLASH_0_init();
 }
diff --git a/driver_init.h b/driver_init.h
index 5c029a4..0d440d4 100644
--- a/driver_init.h
+++ b/driver_init.h
@@ -26,6 +26,13 @@
 void USB_DEVICE_INSTANCE_CLOCK_init(void);
 void USB_DEVICE_INSTANCE_init(void);

+#include <hal_flash.h>
+
+extern struct flash_descriptor FLASH_0;
+
+void FLASH_0_init(void);
+void FLASH_0_CLOCK_init(void);
+
 /**
  * \brief Perform system initialization, initialize pins and clocks for
  * peripherals

--
To view, visit https://gerrit.osmocom.org/12502
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a208abb39a9da8796e2a4bcb803ce32686cb95f
Gerrit-Change-Number: 12502
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kre...@sysmocom.de>

Reply via email to