這幾天弄一塊ixp425的板子,64M的SDRAM,64M的Flash,infineon adm6996L交換芯片。
拿到手的時(shí)候redboot已經(jīng)可以跑了,但是網(wǎng)絡(luò)不通,網(wǎng)絡(luò)接口硬件提供的GPIO12,
在main.c第387行填加
HAL_GPIO_OUTPUT_ENABLE(12);//configure gpio 12 as output
HAL_GPIO_OUTPUT_CLEAR(12);
HAL_DELAY_US(500000);
HAL_GPIO_OUTPUT_SET(12);
redboot 成功跑起來,網(wǎng)絡(luò)通,能tftp下載文件系統(tǒng)和內(nèi)核。然后修改硬件環(huán)境,改64M sdram為32M sdram
由于redboot用得比較少,網(wǎng)上關(guān)于這方面的介紹幾乎沒有,所以打算寫下來,希望給需要的提供點(diǎn)思路,我的redboot是基于intel提供的參考包
1 packages\hal\arm\xscale\ixdp425\current\include\ixpdp425.h
原文件為86行
#define IXP425_SDRAM_CONFIG_INIT_64M (SDRAM_CONFIG_CAS_3 | SDRAM_CONFIG_2x16Mx16)
#define IXP425_SDRAM_CONFIG_INIT_128M (SDRAM_CONFIG_CAS_3 | SDRAM_CONFIG_4x16Mx16)
#define IXP425_SDRAM_CONFIG_INIT_256M (SDRAM_CONFIG_CAS_3 | SDRAM_CONFIG_4x32Mx16)
前加入32M定義
#define IXP425_SDRAM_CONFIG_INIT_32M (SDRAM_CONFIG_CAS_3 | SDRAM_CONFIG_2x8Mx16)
2 將packages\hal\arm\xscale\ixdp425\current\include\hal_platform_setup.h
中
IXP425_SDRAM_CONFIG_INIT_64M改為IXP425_SDRAM_CONFIG_INIT_32M
3 將packages\hal\arm\xscale\ixdp425\current\include\pkgconf\mlt_arm_xscale_ixdp425_ram.h
原文件為
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x01000000)
#define CYGMEM_REGION_ram_SIZE (0x03000000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x04000000 - (size_t) CYG_LABEL_NAME (__heap1))
修改為
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x01000000)
#define CYGMEM_REGION_ram_SIZE (0x01000000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x02000000 - (size_t) CYG_LABEL_NAME (__heap1))
4 將packages\hal\arm\xscale\ixdp425\current\include\pkgconf
\mlt_arm_xscale_ixdp425_rom.h
原文件
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0)
#define CYGMEM_REGION_ram_SIZE (0x04000000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x50000000)
#define CYGMEM_REGION_rom_SIZE (0x400000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x04000000 - (size_t) CYG_LABEL_NAME (__heap1))
修改為
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0)
#define CYGMEM_REGION_ram_SIZE (0x02000000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x50000000)
#define CYGMEM_REGION_rom_SIZE (0x400000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x02000000 - (size_t) CYG_LABEL_NAME (__heap1))
另外有兩個(gè)文件可能就有點(diǎn)隱秘了
4 將packages\hal\arm\xscale\ixdp425\current\include\pkgconf\mlt_arm_xscale_ixdp425_ram.ldi
將原文件
// eCos memory layout - Fri Oct 20 05:56:24 2000
// This is a generated file - do not edit
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0x01000000, LENGTH = 0x04000000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_fixed_vectors (ram, 0x01000020, LMA_EQ_VMA)
SECTION_rom_vectors (ram, 0x01020000, LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
改為
// eCos memory layout - Fri Oct 20 05:56:24 2000
// This is a generated file - do not edit
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0x01000000, LENGTH = 0x02000000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_fixed_vectors (ram, 0x01000020, LMA_EQ_VMA)
SECTION_rom_vectors (ram, 0x01020000, LMA_EQ_VMA)
SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
6
4 將packages\hal\arm\xscale\ixdp425\current\include\pkgconf\mlt_arm_xscale_ixdp425_rom.ldi
將原文件
/ eCos memory layout - Tue Jul 02 10:03:04 2002
// This is a generated file - do not edit
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0, LENGTH = 0x04000000
rom : ORIGIN = 0x50000000, LENGTH = 0x40000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (rom, 0x50000000, LMA_EQ_VMA)
SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_mmu_tables (rom, ALIGN (0x4000), LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
SECTION_data (ram, 0x8000, FOLLOWING (.mmu_tables))
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
改為
/ eCos memory layout - Tue Jul 02 10:03:04 2002
// This is a generated file - do not edit
#include <cyg/infra/cyg_type.inc>
MEMORY
{
ram : ORIGIN = 0, LENGTH = 0x02000000
rom : ORIGIN = 0x50000000, LENGTH = 0x40000
}
SECTIONS
{
SECTIONS_BEGIN
SECTION_rom_vectors (rom, 0x50000000, LMA_EQ_VMA)
SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
SECTION_mmu_tables (rom, ALIGN (0x4000), LMA_EQ_VMA)
SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
SECTION_data (ram, 0x8000, FOLLOWING (.mmu_tables))
SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
SECTIONS_END
}
這樣絕對(duì)ok
測(cè)試通過