firmware: add definition for main osc bypass when using external osc

Add new board.h definition BOARD_MAINOSC_BYPASS to configure the clock module to use an external oscillator rather than a crystal. The qmod board is one such board.
Change-Id: If62f55cd4c8b0cf758534f09d25a9bcb028814a7
diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c
index 1ddbcba..a04ce10 100644
--- a/firmware/libboard/common/source/board_lowlevel.c
+++ b/firmware/libboard/common/source/board_lowlevel.c
@@ -147,7 +147,7 @@
 	}
 */
 
-#ifndef qmod
+#ifndef BOARD_MAINOSC_BYPASS
 	/* Initialize main oscillator */
 	if ( !(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) )
 	{
@@ -165,11 +165,11 @@
 	timeout = 0;
 	while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT));
 #else
-	/* QMOD has external 12MHz clock source */
+	/* Board has external clock, not a crystal oscillator */
 	PIOB->PIO_PDR = (1 << 9);
 	PIOB->PIO_PUDR = (1 << 9);
 	PIOB->PIO_PPDDR = (1 << 9);
-	PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY| CKGR_MOR_MOSCSEL;
+	PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY | CKGR_MOR_MOSCSEL;
 #endif
 
 	/* disable the red LED after main clock initialization */
diff --git a/firmware/libboard/qmod/include/board.h b/firmware/libboard/qmod/include/board.h
index 6d7d4ff..7ea5bd7 100644
--- a/firmware/libboard/qmod/include/board.h
+++ b/firmware/libboard/qmod/include/board.h
@@ -25,6 +25,8 @@
 #define BOARD_MAINOSC 12000000
 /** desired main clock frequency (in Hz, based on BOARD_MAINOSC) */
 #define BOARD_MCK 58000000 // 18.432 * 29 / 6
+/** board has external clock, not crystal */
+#define BOARD_MAINOSC_BYPASS
 
 /** MCU pin connected to red LED */
 #define PIO_LED_RED     PIO_PA17
@@ -35,7 +37,7 @@
 /** green LED pin definition */
 #define PIN_LED_GREEN   {PIO_LED_GREEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
 /** LEDs pin definition */
-#define PINS_LEDS       PIN_LED_RED, PIN_LED_GREEN 
+#define PINS_LEDS       PIN_LED_RED, PIN_LED_GREEN
 /** index for red LED in LEDs pin definition array */
 #define LED_NUM_RED     0
 /** index for green LED in LEDs pin definition array */