View Issue Details

IDProjectCategoryView StatusLast Update
0000222EBoot_PM3EBootpublic2010-02-19 18:34
ReporterKiepferAssigned To 
PriorityurgentSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionV1.43 
Target VersionV1.43Fixed in VersionV1.43 
Summary0000222: MAC will be overwritten when uploading a PSD
DescriptionMAC will be overwritten when uploading a PSD
Forum Link

Activities

Kiepfer

2010-02-17 15:22

developer   ~0000149

BOOL OEMWriteFlash(DWORD dwStartAddr, DWORD dwLength)
{
    DWORD Addr1; // starting address
    DWORD Addr2; // ending address
    BOOL rc = FALSE;
    UINT8 *pSource = NULL;

    OALMSG(OAL_FUNC, (L"+OEMWriteFlash(0x%08x, 0x%08x\r\n", dwStartAddr, dwLength));

    // Setup address range for comparison
    //
    Addr1 = dwStartAddr & ~CACHED_TO_UNCACHED_OFFSET;
    Addr2 = Addr1 + (dwLength - 1);

    if( Addr1 == (DWORD)&g_BootConfigNew )
    {
        /* MAC Address should not be overwritten */
        g_BootConfigNew.wWCE_MAC[0] = g_BootConfig.wWCE_MAC[0];
        g_BootConfigNew.wWCE_MAC[1] = g_BootConfig.wWCE_MAC[1];
        g_BootConfigNew.wWCE_MAC[2] = g_BootConfig.wWCE_MAC[2];
        memcpy(&g_BootConfig, &g_BootConfigNew, sizeof(g_BootConfig));

        Log("EBOOT: must format flash memory ...\r\n");
        FMD_EraseAll();
        Log("done\r\n");
        FSBLFlashInit( &g_BootConfig , FALSE );

        Log("EBOOT: write boot config ...\r\n");
        rc = WriteBootConfig( &g_BootConfig, sizeof(BOOT_CFG) );
    }
    else if( (Addr1 >= IMAGE_BOOT_CODE_CA_START) && (Addr2 <= IMAGE_BOOT_CODE_CA_END) )
    {
        rc = FSBLWriteBootloader( (void*)(IMAGE_BOOT_B_CACHE_CA_START), dwLength);
    }
    else if( (Addr1 == IMAGE_BOOT_SPLASH_CA) && (Addr2 <= (IMAGE_BOOT_SPLASH_CA+IMAGE_BOOT_SPLASH_SIZE)) )

froelich

2010-02-18 09:02

administrator   ~0000150

During transfer of PSD file we use g_BootConfigNew as memory. After transfer we copy MAC from g_BootConfig to g_BootConfigNew.
For future we should try to move this to common code.