//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// File: LoLoParameter.h
//
// This file defines the shared argument structure used by the bootloader and
// the OS image.
//
//------------------------------------------------------------------------------
#ifndef __LoLoParameter_H__
#define __LoLoParameter_H__

//------------------------------------------------------------------------------
// Defines
//
#define HAL_STR_DELIMITER               ":"
#define HAL_STR_DELIMITER_              ':'
/* The following tokens are used to define which HAL-level drivers are used
 * by the base HAL code. Inside each HAL-level driver interface structure is
 * a member called "driver_name." Each "driver_name" member is initialized
 * to one of the macros below. By defining the strings in this manner, only
 * this file needs to be kept up-to-date.
 */

/* Alternative way to start KITL. */
#define HAL_STR_KITL                    "kitl"
#define HAL_STR_KITL_IP_ADDR            "ip_addr"

/* Denotes the HAL-level Ethernet debug driver to use. */
#define HAL_STR_DBG_ENET                "dbg_enet"
#define HAL_STR_DBG_ENET_91C111         "91C111"
#define HAL_STR_DBG_ENET_LAN911X        "LAN911X"
#define HAL_STR_DBG_ENET_NULL           "null"

/* Denotes the HAL-level Ethernet debug driver base address to use. */
#define HAL_STR_DBG_ENET_BASE           "dbg_enet_base"
#define HAL_STR_DBG_ENET_IRQ            "dbg_enet_irq"

/* Denotes the HAL-level debug serial driver to use. */
#define HAL_STR_DBG_SERIAL              "dbg_serial"
#define HAL_STR_DBG_SERIAL_IMX31        "IMX31_UART"
#define HAL_STR_DBG_SERIAL_NULL         "null"

/* Denotes the HAL-level real time clock driver to use. */
#define HAL_STR_RTC                     "rtc"
#define HAL_STR_RTC_IMX31               "rtc_imx31"
#define HAL_STR_RTC_IMX31_PMIC          "rtc_imx31_pmic"
#define HAL_STR_RTC_NULL                "rtc_null"

/* Denotes the string used to force HIVE registry clear */
#define HAL_STR_CLEAN_SYS_HIVE          "clean_syshive"
#define HAL_STR_CLEAN_USR_HIVE          "clean_usrhive"

/* Denotes the HAL-level real time clock driver base address to use. */
#define HAL_STR_RTC_TIBQ4802_BASE       "rtc_tibq4802_base"

/* Denotes the HAL-level watch dog timer driver to use. */
#define HAL_STR_WDT                     "wdt"
#define HAL_STR_WDT_MEM_MAP             "wdt_mem_map"
#define HAL_STR_WDT_NULL                "wdt_null"

/* Denotes the HAL-level real time clock driver base address to use. */
#define HAL_STR_WDT_MEM_MAP_BASE        "wdt_mem_map_base"

/* Denotes whether or not to share the debug Ethernet connection
 * with applications. */
#define HAL_STR_SHARE_ETH               "share_eth"

/* Denotes the size of this Card Engine's SDRAM */
#define HAL_STR_MBYTES_OF_SDRAM         "mbytes_sdram"

/* Denotes the value to set the kernel variable dwDefaultThreadQuantum to. */
#define HAL_STR_THREAD_QUANTUM          "quantum"

/* Denotes the value to set the display number. */
#define HAL_STR_DISPLAY_NUMBER          "disp_num"

/* Denotes the value to skip the LCD controller initialize. */
#define HAL_STR_SKIP_LCDC_INIT          "skiplcdcinit"

#ifdef _ARM_
#if CARD_ENGINE_IMX31_10
/* Denotes what available coprocessor(s) to activate */
#define HAL_STR_COPROCESSORS            "coproc"
#endif
#endif // _ARM_

/* Denotes whether the debug leds should be on or off */
#define HAL_STR_DEBUG_LEDS              "dbg_leds"

//------------------------------------------------------------------------------
// Types
//
#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
   char const *pchDriverName;
   TRTCFunc const *pRTCFunc;
} TRTCDefault;

typedef struct {
   char const *pchDriverName;
   BOOL fEnable;
} TBooleanDefault;

typedef struct {
   char const *pchDriverName;
   DWORD dwNumerial;
} TNumerialDefault;

typedef struct {
   BOOL fShareEthEnable;
   BOOL fKITLEnable;
   BOOL fIsIPAssigned;
   DWORD dwIP;
   BOOL fCleanSysHive;
   BOOL fCleanUsrHive;
   BOOL fDbgSerialEnable;
   TRTCFunc const *pRTCFunc;
   DWORD dwQuantum;
   DWORD dwDbgLEDs;
} TLoLoOption;

//------------------------------------------------------------------------------
// External Global Variables
//
extern TLoLoOption gLoLoOption;

//------------------------------------------------------------------------------
// Functions
//
void hal_param_resolve_globals(void);
unsigned char *hal_param_get_value(unsigned char *key, unsigned int *len);

#ifdef __cplusplus
};
#endif

#endif // __LoLoParameter_H__

