⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 args.c

📁 Intel DBPXA27X评估板OAL层代码.
💻 C
字号:
//
// 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.
//

#include <bsp.h>

//------------------------------------------------------------------------------
//
//  Function:  OALArgsQuery
//
//  This function is called from other OAL modules to return boot arguments.
//  Boot arguments are typically placed in fixed memory location and they are
//  filled by boot loader. In case that boot arguments can't be located
//  the function should return NULL. The OAL module then must use default
//  values.
//


VOID* OALArgsQuery(UINT32 type)
{
    VOID *pData = NULL;
    BSP_ARGS *pArgs = (BSP_ARGS *)IMAGE_SHARE_ARGS_UA_START;

    OALMSG(OAL_ARGS&&OAL_FUNC, (L"+OALArgsQuery(%d)\r\n", type));

    // Check if there is expected signature
    if (
        pArgs->header.signature  != OAL_ARGS_SIGNATURE ||
        pArgs->header.oalVersion != OAL_ARGS_VERSION   ||
        pArgs->header.bspVersion != BSP_ARGS_VERSION
    ) goto cleanUp;

    // Depending on required args
    switch (type)
    {

    case OAL_ARGS_QUERY_DEVID:
        pData = &pArgs->deviceId;
        break;

    case OAL_ARGS_QUERY_KITL:


//        pArgs->kitl.flags |= (OAL_KITL_FLAGS_ENABLED | OAL_KITL_FLAGS_VMINI);
        pArgs->kitl.flags |= (OAL_KITL_FLAGS_ENABLED);

        // Has the bootloader provided a non-zero IP address and subnet mask?
        // If not, use DHCP to obtain this information.
        //
        if ((pArgs->kitl.ipAddress == 0) || (pArgs->kitl.ipMask == 0))
        {
            pArgs->kitl.flags |= OAL_KITL_FLAGS_DHCP;
        }

        // Has the bootloader provided information about which NIC it was using?
        // If not, choose the LAN91C111 as the default.
        //
        if (pArgs->kitl.devLoc.LogicalLoc == 0)
        {
            pArgs->kitl.devLoc.IfcType     = Internal;
            pArgs->kitl.devLoc.BusNumber   = 0;
            pArgs->kitl.devLoc.PhysicalLoc = (PVOID)(MAINSTONEII_BASE_REG_PA_SMSC_ETHERNET + 0x300);
            pArgs->kitl.devLoc.LogicalLoc  = (DWORD)pArgs->kitl.devLoc.PhysicalLoc;
        }

        pData = &pArgs->kitl;
        break;

        case OAL_ARGS_QUERY_UPDATEMODE:
            {
                pData = &pArgs->bUpdateMode;
            }
            break;

    case BSP_ARGS_QUERY_DBGSERIAL:
        if ((pArgs->dbgSerPhysAddr != BULVERDE_BASE_REG_PA_BTUART) && (pArgs->dbgSerPhysAddr != BULVERDE_BASE_REG_PA_FFUART))
        {
            pArgs->dbgSerPhysAddr = BULVERDE_BASE_REG_PA_BTUART;
        }
        pData = &pArgs->dbgSerPhysAddr;
        break;
    }

cleanUp:
    OALMSG(OAL_ARGS&&OAL_FUNC, (L"-OALArgsQuery(pData = 0x%08x)\r\n", pData));
    return (pData);
}

//------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -