[riot-notifications] [RIOT-OS/RIOT] cpu/qn908x: Initial minimal support for NXP QN908x CPUs. (#13855)

iosabi notifications at github.com
Mon Nov 30 04:09:30 CET 2020


@iosabi commented on this pull request.



> +void clocks_init(void)
+{
+    /* Set up clock selectors - Attach clocks to the peripheries */
+
+    /* Switch XTAL_CLK to 32M */
+    CLOCK_AttachClk(k32M_to_XTAL_CLK);
+    /* Switch 32K_CLK to XTAL32K */
+    CLOCK_AttachClk(kXTAL32K_to_32K_CLK);
+    /* Switch SYS_CLK to XTAL */
+    CLOCK_AttachClk(kXTAL_to_SYS_CLK);
+    /* Switch WDT_CLK to APB */
+    CLOCK_AttachClk(kAPB_to_WDT_CLK);
+
+    /* Set up dividers */
+
+    /* Set OSC32M_DIV divider to value 2 */
+    CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 1U);
+    /* Set XTAL_DIV divider to value 2 */
+    CLOCK_SetClkDiv(kCLOCK_DivXtalClk, 1U);
+    /* Set AHB_DIV divider to value 2 */
+    CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U);
+    /* Set FRG_MULT1 to value 0, Set FRG_DIV1 to value 255 */
+    CLOCK_SetClkDiv(kCLOCK_DivFrg1, 0U);
+    /* Set FRG_MULT0 to value 0, Set FRG_DIV0 to value 255 */
+    CLOCK_SetClkDiv(kCLOCK_DivFrg0, 0U);
+    /* Set APB_DIV divider to value 1 */
+    CLOCK_SetClkDiv(kCLOCK_DivApbClk, 0U);
+}

I moved this to cpu.c and added a whole lot of config.

I'm not entirely sure how is the Kconfig supposed to work. If I run `make BOARD=qn9080dk -C examples/hello-world/` the `autoconf.h` is not generated and the CONFIG_ variables with the defaults in the Kconfig are not set, not even the ones the board should be forcing.

I ended up adding the same logic with CONFIG_* variables in the cpu_conf.h, maybe this is just a transition thing but it would be better if I don't have to do that. On the other hand adding them to cpu_conf.h lets me document them so doxygen can pick them up.

 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13855#discussion_r532325175
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201129/cd2cfe78/attachment.htm>


More information about the notifications mailing list