Change in osmo-asf4-dfu[master]: add code to initialize flash

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jan 17 12:08:17 UTC 2019


Harald Welte has submitted this change and it was merged. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



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: merged
Gerrit-Change-Id: I2a208abb39a9da8796e2a4bcb803ce32686cb95f
Gerrit-Change-Number: 12502
Gerrit-PatchSet: 3
Gerrit-Owner: Kévin Redon <kredon at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190117/a740cfa8/attachment.htm>


More information about the gerrit-log mailing list