diff options
| author | zchong_cht <[email protected]> | 2015-11-11 23:44:05 +0800 |
|---|---|---|
| committer | zchong_cht <[email protected]> | 2015-11-11 23:44:05 +0800 |
| commit | 3983f39f34e8fb8c1908aef86168268438c0aed0 (patch) | |
| tree | 2a84540adf84eeb913e1243fcb7f93411174f092 /bsp/beaglebone | |
| parent | 46fe0a48dc24ef6c696db2d80f910c5a482057f5 (diff) | |
Add iar compiler support for am335x.
Diffstat (limited to 'bsp/beaglebone')
| -rw-r--r-- | bsp/beaglebone/AM335x_sk_DDR3.mac | 551 | ||||
| -rw-r--r-- | bsp/beaglebone/am335x_DDR.icf | 44 | ||||
| -rw-r--r-- | bsp/beaglebone/am335x_sk.ewp | 1123 | ||||
| -rw-r--r-- | bsp/beaglebone/am335x_sk.eww | 9 | ||||
| -rw-r--r-- | bsp/beaglebone/applications/startup.c | 9 | ||||
| -rw-r--r-- | bsp/beaglebone/drivers/uart.c (renamed from bsp/beaglebone/drivers/serial.c) | 0 | ||||
| -rw-r--r-- | bsp/beaglebone/drivers/uart.h (renamed from bsp/beaglebone/drivers/serial.h) | 0 | ||||
| -rw-r--r-- | bsp/beaglebone/drivers/uart_reg.h (renamed from bsp/beaglebone/drivers/serial_reg.h) | 0 | ||||
| -rw-r--r-- | bsp/beaglebone/rtconfig.h | 2 |
9 files changed, 1736 insertions, 2 deletions
diff --git a/bsp/beaglebone/AM335x_sk_DDR3.mac b/bsp/beaglebone/AM335x_sk_DDR3.mac new file mode 100644 index 0000000000..739a03adbd --- /dev/null +++ b/bsp/beaglebone/AM335x_sk_DDR3.mac @@ -0,0 +1,551 @@ +// ----------------------------------------------------------------------- +// This file contains the initial set up configuration for the AM335x. +//------------------------------------------------------------------------- + +__var clk_in; + +CHGBIT (addr, mask, data) +{ +__var reg; + reg = __readMemory32(addr, "Memory"); + reg &= ~mask; + reg |= data; + __writeMemory32(reg, addr, "Memory"); +} + +CLRBIT (addr, mask) +{ +__var reg; + reg = __readMemory32(addr, "Memory"); + reg &= ~mask; + __writeMemory32(reg, addr, "Memory"); +} + +SETBIT (addr, mask) +{ +__var reg; + reg = __readMemory32(addr, "Memory"); + reg |= mask; + __writeMemory32(reg, addr, "Memory"); +} + +TESTBIT (addr, mask) +{ + return(__readMemory32(addr, "Memory") & mask); +} + + +get_input_clock_frequency() +{ + __var temp; + + temp = __readMemory32(((0x44E10000) + 0x40), "Memory"); + temp = temp >> 22; + temp = temp & 0x3; + + if(temp == 0) + { + clk_in = 19; //19.2MHz + __message "Input Clock Read from SYSBOOT[15:14]: 19.2MHz\n"; + } + if(temp == 1) + { + clk_in = 24; //24MHz + __message "Input Clock Read from SYSBOOT[15:14]: 24MHz\n"; + } + if(temp == 2) + { + clk_in = 25; //25MHz + __message "Input Clock Read from SYSBOOT[15:14]: 25MHz\n"; + } + if(temp == 3) + { + clk_in = 26; //26MHz + __message "Input Clock Read from SYSBOOT[15:14]: 26MHz\n"; + } +} + +mpu_pll_config( clk_in, N, M, M2) +{ + __var ref_clk,clk_out; + __var clkmode,clksel,div_m2,idlest_dpll; + __var temp,i; + + ref_clk = clk_in/(N+1); + clk_out = (ref_clk*M)/M2; + + clkmode=__readMemory32((0x44E00000 + 0x488), "Memory"); + clksel= __readMemory32((0x44E00000 + 0x42C), "Memory"); + div_m2= __readMemory32((0x44E00000 + 0x4A8), "Memory"); + + __message "**** Going to Bypass... \n"; + + //put the DPLL in bypass mode + __writeMemory32(0x4, (0x44E00000 + 0x488), "Memory"); + + while(((__readMemory32((0x44E00000 + 0x420), "Memory") & 0x101) != 0x00000100)); //wait for bypass status + + __message "**** Bypassed, changing values... \n"; + + //set multiply and divide values + clksel = clksel & (~0x7FFFF); + clksel = clksel | ((M <<0x8) | N); + __writeMemory32(clksel, (0x44E00000 + 0x42C), "Memory"); + div_m2 = div_m2 & ~0x1F; + div_m2 = div_m2 | M2; + __writeMemory32(div_m2, (0x44E00000 + 0x4A8), "Memory"); + + __message "**** Locking ARM PLL\n"; + + //now lock the DPLL + clkmode = clkmode | 0x7; //enables lock mode + __writeMemory32(clkmode, (0x44E00000 + 0x488), "Memory"); + while(((__readMemory32((0x44E00000 + 0x420), "Memory") & 0x101) != 0x1)); //wait for lock +} + + +core_pll_config( clk_in, N, M, M4, M5, M6) +{ + __var ref_clk,clk_out4,clk_out5,clk_out6; + __var clkmode,clksel,div_m4,div_m5,div_m6,idlest_dpll; + + ref_clk = clk_in/(N+1); + clk_out4 = (ref_clk*M)/M4; //M4=200MHz + clk_out5 = (ref_clk*M)/M5; //M5=250MHz + clk_out6 = (ref_clk*M)/M6; //M6=500MHz + + clkmode= __readMemory32((0x44E00000 + 0x490), "Memory"); + clksel= __readMemory32((0x44E00000 + 0x468), "Memory"); + div_m4= __readMemory32((0x44E00000 + 0x480), "Memory"); + div_m5= __readMemory32((0x44E00000 + 0x484), "Memory"); + div_m6= __readMemory32((0x44E00000 + 0x4D8), "Memory"); + + //put DPLL in bypass mode + clkmode = (clkmode & 0xfffffff8)|0x00000004; + __writeMemory32(clkmode, (0x44E00000 + 0x490), "Memory"); + while((__readMemory32((0x44E00000 + 0x45C), "Memory") & 0x00000100 )!=0x00000100); //wait for bypass status + + __message "**** Core Bypassed\n"; + + //set multiply and divide values + clksel = clksel & (~0x7FFFF); + clksel = clksel | ((M <<0x8) | N); + __writeMemory32(clksel, (0x44E00000 + 0x468), "Memory"); + div_m4= M4; //200MHz + __writeMemory32(div_m4, (0x44E00000 + 0x480), "Memory"); + div_m5= M5; //250MHz + __writeMemory32(div_m5, (0x44E00000 + 0x484), "Memory"); + div_m6= M6; //500MHz + __writeMemory32(div_m6, (0x44E00000 + 0x4D8), "Memory"); + + __message "**** Now locking Core...\n"; + + //now lock the PLL + clkmode =(clkmode&0xfffffff8)|0x00000007; + __writeMemory32(clkmode, (0x44E00000 + 0x490), "Memory"); + + while((__readMemory32((0x44E00000 + 0x45C), "Memory") & 0x00000001 )!=0x00000001); + __message "**** Core locked\n"; +} + +ddr_pll_config( clk_in, N, M, M2) +{ + __var ref_clk,clk_out ; + __var clkmode,clksel,div_m2,idlest_dpll; + + ref_clk = clk_in/(N+1); + clk_out = (ref_clk*M)/M2; + + clkmode=__readMemory32((0x44E00000 + 0x494), "Memory"); + clksel= __readMemory32((0x44E00000 + 0x440), "Memory"); + div_m2= __readMemory32((0x44E00000 + 0x4A0), "Memory"); + + clkmode =(clkmode&0xfffffff8)|0x00000004; + __writeMemory32(clkmode, (0x44E00000 + 0x494), "Memory"); + while((__readMemory32((0x44E00000 + 0x434), "Memory") & 0x00000100 )!=0x00000100); + + __message "**** DDR DPLL Bypassed\n"; + + clksel = clksel & (~0x7FFFF); + clksel = clksel | ((M <<0x8) | N); + __writeMemory32(clksel, (0x44E00000 + 0x440), "Memory"); + div_m2 = __readMemory32((0x44E00000 + 0x4A0), "Memory"); + div_m2 = (div_m2&0xFFFFFFE0) | M2; + __writeMemory32(div_m2, (0x44E00000 + 0x4A0), "Memory"); + clkmode =(clkmode&0xfffffff8)|0x00000007; + __writeMemory32(clkmode, (0x44E00000 + 0x494), "Memory"); + + while((__readMemory32((0x44E00000 + 0x434), "Memory") & 0x00000001 )!=0x00000001); + + __message "**** DDR DPLL Locked\n"; +} + +per_pll_config( clk_in, N, M, M2) +{ + __var ref_clk,clk_out; + __var clkmode,clksel,div_m2,idlest_dpll; + + ref_clk = clk_in/(N+1); + clk_out = (ref_clk*M)/M2; + + clkmode=__readMemory32((0x44E00000 + 0x48C), "Memory"); + clksel= __readMemory32((0x44E00000 + 0x49C), "Memory"); + div_m2= __readMemory32((0x44E00000 + 0x4AC), "Memory"); + + clkmode =(clkmode&0xfffffff8)|0x00000004; + __writeMemory32(clkmode, (0x44E00000 + 0x48C), "Memory"); + while((__readMemory32((0x44E00000 + 0x470), "Memory") & 0x00000100 )!=0x00000100); + + __message "**** PER DPLL Bypassed\n"; + + clksel = clksel & (~0x7FFFF); + clksel = clksel | ((M <<0x8) | N); + __writeMemory32(clksel, (0x44E00000 + 0x49C), "Memory"); + div_m2= 0xFFFFFF80 | M2; + __writeMemory32(div_m2, (0x44E00000 + 0x4AC), "Memory"); + clkmode =(clkmode&0xfffffff8)|0x00000007; + __writeMemory32(clkmode,(0x44E00000 + 0x48C), "Memory"); + + while((__readMemory32((0x44E00000 + 0x470), "Memory") & 0x00000001 )!=0x00000001); + + __message "**** PER DPLL Locked\n"; +} + +disp_pll_config( clk_in, N, M, M2) +{ + __var ref_clk,clk_out; + __var clkmode,clksel,div_m2,idlest_dpll; + + __message "**** DISP PLL Config is in progress .......... \n"; + + ref_clk = clk_in/(N+1); + clk_out = (ref_clk*M)/M2; + + clkmode=__readMemory32((0x44E00000 + 0x498), "Memory"); + clksel= __readMemory32((0x44E00000 + 0x454), "Memory"); + div_m2= __readMemory32((0x44E00000 + 0x4A4), "Memory"); + + clkmode =(clkmode&0xfffffff8)|0x00000004; + __writeMemory32(clkmode, (0x44E00000 + 0x498), "Memory"); + while((__readMemory32((0x44E00000 + 0x448), "Memory") & 0x00000100 )!=0x00000100); + + clksel = clksel & (~0x7FFFF); + clksel = clksel | ((M <<0x8) | N); + __writeMemory32(clksel, (0x44E00000 + 0x454), "Memory"); + div_m2= 0xFFFFFFE0 | M2; + __writeMemory32(div_m2, (0x44E00000 + 0x4A4), "Memory"); + clkmode =(clkmode&0xfffffff8)|0x00000007; + __writeMemory32(clkmode, (0x44E00000 + 0x498), "Memory"); + + while((__readMemory32((0x44E00000 + 0x448), "Memory") & 0x00000001 )!=0x00000001); + + __message "**** DISP PLL Config is DONE .......... \n"; +} + +arm_opp120_config() +{ + __message "**** Subarctic ALL ADPLL Config for OPP == OPP100 is In Progress ......... \n"; + get_input_clock_frequency(); + + if (clk_in == 24) + { + mpu_pll_config(clk_in, 23, 550, 1); + core_pll_config(clk_in, 23, 1000, 10, 8, 4); + ddr_pll_config(clk_in, 23, 303, 1); + per_pll_config(clk_in, 23, 960, 5); + disp_pll_config(clk_in, 23, 48, 1); + __message "**** Subarctic ALL ADPLL Config for OPP == OPP100 is Done ......... \n"; + } + else + { + __message "**** Subarctic PLL Config failed!! Check SYSBOOT[15:14] for proper input freq config \n"; + } + +} + + +emif_prcm_clk_enable() +{ + __message "EMIF PRCM is in progress ....... \n"; + + __writeMemory32(0x2, (0x44E00000 + 0x0D0), "Memory"); + __writeMemory32(0x2, (0x44E00000 + 0x028), "Memory"); + while(__readMemory32((0x44E00000 + 0x028), "Memory")!= 0x02); + + __message "EMIF PRCM Done \n"; +} + +vtp_enable() +{ + /* Write 1 to enable VTP */ + __writeMemory32((__readMemory32(((0x44E10000) + 0x0E0C), "Memory") | 0x00000040),((0x44E10000) + 0x0E0C) , "Memory"); + /* Write 0 to CLRZ bit */ + __writeMemory32((__readMemory32(((0x44E10000) + 0x0E0C), "Memory") & 0xFFFFFFFE),((0x44E10000) + 0x0E0C) ,"Memory"); + /* Write 1 to CLRZ bit */ + __writeMemory32((__readMemory32(((0x44E10000) + 0x0E0C), "Memory") | 0x00000001),((0x44E10000) + 0x0E0C) , "Memory"); + __message "Waiting for VTP Ready .......\n"; + while((__readMemory32(((0x44E10000) + 0x0E0C), "Memory") & 0x00000020) != 0x00000020); + + __message "VTP Enable Done \n"; +} + +cmd_macro_config( REG_PHY_CTRL_SLAVE_RATIO_value, CMD_REG_PHY_CTRL_SLAVE_FORCE_value, CMD_REG_PHY_CTRL_SLAVE_DELAY_value, PHY_DLL_LOCK_DIFF_value, CMD_PHY_INVERT_CLKOUT_value) +{ + __message "\DDR PHY CMD0 Register configuration is in progress ....... \n"; + + __writeMemory32(REG_PHY_CTRL_SLAVE_RATIO_value, (0x01C + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_FORCE_value, (0x020 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_DELAY_value, (0x024 + (0x44E12000)), "Memory"); + __writeMemory32(PHY_DLL_LOCK_DIFF_value, (0x028 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_PHY_INVERT_CLKOUT_value, (0x02C + (0x44E12000)), "Memory"); + + __message "\DDR PHY CMD1 Register configuration is in progress ....... \n"; + + __writeMemory32(REG_PHY_CTRL_SLAVE_RATIO_value, (0x050 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_FORCE_value, (0x054 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_DELAY_value, (0x058 + (0x44E12000)), "Memory"); + __writeMemory32(PHY_DLL_LOCK_DIFF_value, (0x05C + (0x44E12000)), "Memory"); + __writeMemory32(CMD_PHY_INVERT_CLKOUT_value, (0x060 + (0x44E12000)), "Memory"); + + __message "\DDR PHY CMD2 Register configuration is in progress ....... \n"; + + __writeMemory32(REG_PHY_CTRL_SLAVE_RATIO_value, (0x084 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_FORCE_value, (0x088 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_REG_PHY_CTRL_SLAVE_DELAY_value, (0x08C + (0x44E12000)), "Memory"); + __writeMemory32(PHY_DLL_LOCK_DIFF_value, (0x090 + (0x44E12000)), "Memory"); + __writeMemory32(CMD_PHY_INVERT_CLKOUT_value, (0x094 + (0x44E12000)), "Memory"); +} + +data_macro_config( dataMacroNum, PHY_RD_DQS_SLAVE_RATIO_value, PHY_WR_DQS_SLAVE_RATIO_value, REG_PHY_WRLVL_INIT_RATIO_value, + REG_PHY_GATELVL_INIT_RATIO_value, REG_PHY_FIFO_WE_SLAVE_RATIO_value, REG_PHY_WR_DATA_SLAVE_RATIO_value) +{ + __var offset; + if(dataMacroNum == 0) + { + offset = 0x00; + __message "DDR PHY DATA0 Register configuration is in progress ....... \n"; + } + else if(dataMacroNum == 1) + { + offset = 0xA4; + __message "DDR PHY DATA1 Register configuration is in progress ....... \n"; + } + + __writeMemory32(((PHY_RD_DQS_SLAVE_RATIO_value<<30)|(PHY_RD_DQS_SLAVE_RATIO_value<<20)|(PHY_RD_DQS_SLAVE_RATIO_value<<10)|(PHY_RD_DQS_SLAVE_RATIO_value<<0)), ((0x0C8 + (0x44E12000)) + offset), "Memory"); + __writeMemory32(PHY_RD_DQS_SLAVE_RATIO_value>>2, ((0x0CC + (0x44E12000)) + offset), "Memory"); + + __writeMemory32(((PHY_WR_DQS_SLAVE_RATIO_value<<30)|(PHY_WR_DQS_SLAVE_RATIO_value<<20)|(PHY_WR_DQS_SLAVE_RATIO_value<<10)|(PHY_WR_DQS_SLAVE_RATIO_value<<0)), ((0x0DC + (0x44E12000)) + offset), "Memory"); + __writeMemory32(PHY_WR_DQS_SLAVE_RATIO_value>>2, ((0x0E0 + (0x44E12000)) + offset), "Memory"); + + __writeMemory32(((REG_PHY_WRLVL_INIT_RATIO_value<<30)|(REG_PHY_WRLVL_INIT_RATIO_value<<20)|(REG_PHY_WRLVL_INIT_RATIO_value<<10)|(REG_PHY_WRLVL_INIT_RATIO_value<<0)), ((0x0F0 + (0x44E12000)) + offset), "Memory"); + __writeMemory32(REG_PHY_WRLVL_INIT_RATIO_value>>2, ((0x0F4 + (0x44E12000)) + offset), "Memory"); + + __writeMemory32(((REG_PHY_GATELVL_INIT_RATIO_value<<30)|(REG_PHY_GATELVL_INIT_RATIO_value<<20)|(REG_PHY_GATELVL_INIT_RATIO_value<<10)|(REG_PHY_GATELVL_INIT_RATIO_value<<0)), ((0x0FC + (0x44E12000)) + offset), "Memory"); + __writeMemory32(REG_PHY_GATELVL_INIT_RATIO_value>>2, ((0x100 + (0x44E12000)) + offset), "Memory"); + + __writeMemory32(((REG_PHY_FIFO_WE_SLAVE_RATIO_value<<30)|(REG_PHY_FIFO_WE_SLAVE_RATIO_value<<20)|(REG_PHY_FIFO_WE_SLAVE_RATIO_value<<10)|(REG_PHY_FIFO_WE_SLAVE_RATIO_value<<0)), ((0x108 + (0x44E12000)) + offset), "Memory"); + __writeMemory32(REG_PHY_FIFO_WE_SLAVE_RATIO_value>>2,((0x10C + (0x44E12000)) + offset), "Memory"); + + __writeMemory32(((REG_PHY_WR_DATA_SLAVE_RATIO_value<<30)|(REG_PHY_WR_DATA_SLAVE_RATIO_value<<20)|(REG_PHY_WR_DATA_SLAVE_RATIO_value<<10)|(REG_PHY_WR_DATA_SLAVE_RATIO_value<<0)),((0x120 + (0x44E12000)) + offset), "Memory"); + __writeMemory32(REG_PHY_WR_DATA_SLAVE_RATIO_value>>2, ((0x124 + (0x44E12000)) + offset), "Memory"); + __writeMemory32(0x0,((0x138 + (0x44E12000)) + offset), "Memory"); +} + + +emif_mmr_config( Read_Latency, Timing1, Timing2, Timing3, Sdram_Config, Ref_Ctrl) +{ + __var i; + + __message "emif Timing register configuration is in progress ....... \n"; + + __writeMemory32(Read_Latency, (0x4C000000 + 0x0E4), "Memory"); + __writeMemory32(Read_Latency, (0x4C000000 + 0x0E8), "Memory"); + __writeMemory32(Read_Latency, (0x4C000000 + 0x0EC), "Memory"); + + __writeMemory32(Timing1, (0x4C000000 + 0x018), "Memory"); + __writeMemory32(Timing1, (0x4C000000 + 0x01C), "Memory"); + + __writeMemory32(Timing2, (0x4C000000 + 0x020), "Memory"); + __writeMemory32(Timing2, (0x4C000000 + 0x024), "Memory"); + + __writeMemory32(Timing3, (0x4C000000 + 0x028), "Memory"); + __writeMemory32(Timing3, (0x4C000000 + 0x02C), "Memory"); + + __writeMemory32(Sdram_Config, (0x4C000000 + 0x008), "Memory"); + __writeMemory32(Sdram_Config, (0x4C000000 + 0x00C), "Memory"); + __writeMemory32(0x00004650, (0x4C000000 + 0x010), "Memory"); + __writeMemory32(0x00004650, (0x4C000000 + 0x014), "Memory"); + + for(i=0;i<5000;i++) + { + } + + __writeMemory32(Ref_Ctrl, (0x4C000000 + 0x010), "Memory"); + __writeMemory32(Ref_Ctrl, (0x4C000000 + 0x014), "Memory"); + + __writeMemory32(Sdram_Config, (0x4C000000 + 0x008), "Memory"); + __writeMemory32(Sdram_Config, (0x4C000000 + 0x00C), "Memory"); + + __message "emif Timing register configuration is done ....... \n"; +} + +gpio_module_clk_config() +{ + __var buff; + + buff = __readMemory32((0x400 + 0x44E00000 + 0x8), "Memory"); + + buff |= 0x2; + + __writeMemory32(buff, (0x400 + 0x44E00000 + 0x8), "Memory"); + + while((__readMemory32((0x400 + 0x44E00000 + 0x8), "Memory") & 0x3) != 0x2); + + buff = __readMemory32((0x400 + 0x44E00000 + 0x8), "Memory"); + + buff |= 0x00040000; + + __writeMemory32(buff, (0x400 + 0x44E00000 + 0x8), "Memory"); + + while((__readMemory32((0x400 + 0x44E00000 + 0x8), "Memory") & 0x00040000) != 0x00040000); + + while((__readMemory32((0x400 + 0x44E00000 + 0x8), "Memory") & 0x00030000) != 0x0); + + while((__readMemory32((0x400 + 0x44E00000), "Memory") & 0x00000100) != 0x00000100); + + __message "GPIO module clock configuration is done ....... \n"; + +} + +phy_config_cmd() +{ + __var i; + + for(i = 0; i < 3; i++) + { + __message "DDR PHY CMD Register configuration is in progress ....... \n"; + + __writeMemory32(0x40, ((0x44E12000 + 0x01c) + (i * 0x34)), "Memory"); + + __writeMemory32(0x1, ((0x44E12000 + 0x02c) + (i * 0x34)), "Memory"); + + } + +} + +phy_config_data() +{ + __var i; + + for(i = 0; i < 2; i++) + { + __message "DDR PHY Data Register configuration is in progress ....... \n"; + + __writeMemory32(0x3B, ((0x44E12000 + 0x0c8) + (i * 0xA4)), "Memory"); + + __writeMemory32(0x85, ((0x44E12000 + 0x0DC) + (i * 0xA4)), "Memory"); + + __writeMemory32(0x100, ((0x44E12000 + 0x108) + (i * 0xA4)), "Memory"); + + __writeMemory32(0xC1, ((0x44E12000 + 0x120) + (i * 0xA4)), "Memory"); + + } + +} + +ddr3_emif_config() +{ + __message "**** AM335x OPP120 DDR3 EMIF and PHY configuration is in progress......... \n"; + + emif_prcm_clk_enable(); + + __message "DDR PHY Configuration In progress \n"; + + /* Perform GPIO module clock configuration. */ + gpio_module_clk_config(); + + __writeMemory32(0x00000067, (0x44E10000 + 0x964), "Memory"); + + __writeMemory32((__readMemory32((0x44E07000 + 0x130), "Memory") & 0xFFFFFFFE), (0x44E07000 + 0x130), "Memory"); + + __writeMemory32((__readMemory32((0x44E07000 + 0x10), "Memory") | 0x02), (0x44E07000 + 0x10), "Memory"); + + /* Wait until GPIO module is reset. */ + + while(!(__readMemory32((0x44E07000 + 0x114), "Memory") & 0x01)); + + __writeMemory32((__readMemory32((0x44E07000 + 0x134), "Memory") & ~(1 << 7)), (0x44E07000 + 0x134), "Memory"); + + __writeMemory32((1 << 7), (0x44E07000 + 0x194), "Memory"); + + __writeMemory32((__readMemory32((0x44E10000 + 0x0E0C), "Memory") & 0xFFFFFFFE), (0x44E10000 + 0x0E0C), "Memory"); + + __writeMemory32((__readMemory32((0x44E10000 + 0x0E0C), "Memory") | 0x00000001), (0x44E10000 + 0x0E0C), "Memory"); + + vtp_enable(); + + phy_config_cmd(); + + phy_config_data(); + + __writeMemory32(0x18B, (0x1404 + 0x44E10000), "Memory"); + __writeMemory32(0x18B, (0x1408 + 0x44E10000), "Memory"); + __writeMemory32(0x18B, (0x140C + 0x44E10000), "Memory"); + __writeMemory32(0x18B, (0x1440 + 0x44E10000), "Memory"); + __writeMemory32(0x18B, (0x1444 + 0x44E10000), "Memory"); + + __writeMemory32((__readMemory32((0x0E04 + 0x44E10000), "Memory") & ~0x10000000), (0x0E04 + 0x44E10000), "Memory"); + + __writeMemory32((__readMemory32((0x131C + 0x44E10000), "Memory") | 0x00000001), (0x131C + 0x44E10000), "Memory"); + + __message "EMIF Timing register configuration is in progress ....... \n"; + + __writeMemory32(0x06, (0x0E4 + 0x4C000000), "Memory"); + __writeMemory32(0x06, (0x0E8 + 0x4C000000), "Memory"); + __writeMemory32(0x06, (0x0EC + 0x4C000000), "Memory"); + + __writeMemory32(0x0888A39B, (0x018 + 0x4C000000), "Memory"); + __writeMemory32(0x0888A39B, (0x01C + 0x4C000000), "Memory"); + + __writeMemory32(0x26337FDA, (0x020 + 0x4C000000), "Memory"); + __writeMemory32(0x26337FDA, (0x024 + 0x4C000000), "Memory"); + + __writeMemory32(0x501F830F, (0x028 + 0x4C000000), "Memory"); + __writeMemory32(0x501F830F, (0x02C + 0x4C000000), "Memory"); + + __writeMemory32(0x0000093B, (0x010 + 0x4C000000), "Memory"); + __writeMemory32(0x0000093B, (0x014 + 0x4C000000), "Memory"); + + __writeMemory32(0x50074BE4, (0x0C8 + 0x4C000000), "Memory"); + + __writeMemory32(0x61C04AB2, (0x008 + 0x4C000000), "Memory"); + + __message "EMIF Timing register configuration is done ....... \n"; + + if((__readMemory32((0x4C000000 + 0x004), "Memory") & 0x4) == 0x4) + { + __message "PHY is READY!!\n"; + } + + __message "DDR PHY Configuration done \n"; + + __message "**** AM335x OPP120 DDR3 EMIF and PHY configuration is done......... \n"; +} + +am335x_evm_initialization() +{ +__var psc_base; +__var reg; +__var module_offest; + + __message " AM335x EVM-SK Initialization is in progress .......... \n"; + arm_opp120_config(); + ddr3_emif_config(); + __message " AM335x EVM-SK Initialization is done .......... \n"; +} + +execUserPreload() +{ + am335x_evm_initialization(); +} + diff --git a/bsp/beaglebone/am335x_DDR.icf b/bsp/beaglebone/am335x_DDR.icf new file mode 100644 index 0000000000..8f158d8432 --- /dev/null +++ b/bsp/beaglebone/am335x_DDR.icf @@ -0,0 +1,44 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/
+/*-Editor annotation file-*/
+/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */
+/*-Specials-*/
+define symbol __ICFEDIT_intvec_start__ = 0x82000000;
+/*-Memory Regions-*/
+define symbol __ICFEDIT_region_ROM_start__ = 0x82000000;
+define symbol __ICFEDIT_region_ROM_end__ = 0x87FFFFFF;
+define symbol __ICFEDIT_region_RAM_start__ = 0x88000000;
+define symbol __ICFEDIT_region_RAM_end__ = 0x8FFFFFFF;
+/*-Sizes-*/
+define symbol __ICFEDIT_size_cstack__ = 0x100;
+define symbol __ICFEDIT_size_svcstack__ = 0x1000;
+define symbol __ICFEDIT_size_irqstack__ = 0x100;
+define symbol __ICFEDIT_size_fiqstack__ = 0x100;
+define symbol __ICFEDIT_size_undstack__ = 0x100;
+define symbol __ICFEDIT_size_abtstack__ = 0x100;
+define symbol __ICFEDIT_size_heap__ = 0x400;
+/**** End of ICF editor section. ###ICF###*/
+
+define memory mem with size = 4G;
+define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
+define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
+
+define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
+define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
+define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
+define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
+define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
+define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
+define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
+
+initialize by copy { readwrite };
+do not initialize { section .noinit };
+keep { section FSymTab };
+keep { section VSymTab };
+keep { section .rti_fn* };
+
+place at address mem :__ICFEDIT_intvec_start__ {readonly section .intvec};
+
+place in ROM_region { readonly };
+place in RAM_region { readwrite,
+ block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
+ block UND_STACK, block ABT_STACK, block HEAP };
diff --git a/bsp/beaglebone/am335x_sk.ewp b/bsp/beaglebone/am335x_sk.ewp new file mode 100644 index 0000000000..c71c566b05 --- /dev/null +++ b/bsp/beaglebone/am335x_sk.ewp @@ -0,0 +1,1123 @@ +<?xml version="1.0" encoding="iso-8859-1"?>
+
+<project>
+ <fileVersion>2</fileVersion>
+ <configuration>
+ <name>DDR Debug</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>24</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>DDR Debug\Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>DDR Debug\Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>DDR Debug\List</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input variant</name>
+ <version>3</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Full formatting.</state>
+ </option>
+ <option>
+ <name>Output variant</name>
+ <version>2</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Full formatting.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>5.10.0.159</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>7.40.7.9864</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>am3359 TexasInstruments am3359</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>22</version>
+ <state>51</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GRuntimeLibThreads</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CoreVariant</name>
+ <version>22</version>
+ <state>51</state>
+ </option>
+ <option>
+ <name>GFPUDeviceSlave</name>
+ <state>am3359 TexasInstruments am3359</state>
+ </option>
+ <option>
+ <name>FPU2</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>NrRegs</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>NEON</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave2</name>
+ <version>22</version>
+ <state>51</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>31</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDefines</name>
+ <state>DDR_DEBUG</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>00000000</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$\applications</state>
+ <state>$PROJ_DIR$\drivers</state>
+ <state>$PROJ_DIR$\</state>
+ <state>$PROJ_DIR$\..\..\src</state>
+ <state>$PROJ_DIR$\..\..\include</state>
+ <state>$PROJ_DIR$\..\..\components\init</state>
+ <state>$PROJ_DIR$\..\..\libcpu\arm\am335x</state>
+ <state>$PROJ_DIR$\..\..\components\finsh</state>
+ <state>$PROJ_DIR$\..\..\components\drivers\include</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IInterwork2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccExceptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccRTTI</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategySlave</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCGuardCalls</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>9</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>AMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AsmNoLiteralPool</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>3</version>
+ <state>3</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>am335x_sk.bin</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ <hasPrio>0</hasPrio>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>16</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>$PROJ_FNAME$.out</state>
+ </option>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$PROJ_DIR$\am335x_DDR.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkThreadsSlave</name>
+ <state>1</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ </configuration>
+ <group>
+ <name>app</name>
+ <file>
+ <name>$PROJ_DIR$\applications\application.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\applications\board.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\applications\startup.c</name>
+ </file>
+ </group>
+ <group>
+ <name>bsp</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\context_iar.S</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\cp15_iar.s</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\cpu.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\interrupt.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\stack.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\start_iar.s</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\libcpu\arm\am335x\trap.c</name>
+ </file>
+ </group>
+ <group>
+ <name>components</name>
+ <group>
+ <name>finsh</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\cmd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_compiler.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_error.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_heap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_init.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_node.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_ops.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_parser.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_token.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_var.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\finsh_vm.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\msh.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\msh_cmd.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\shell.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\finsh\symbol.c</name>
+ </file>
+ </group>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\drivers\src\dataqueue.c</name>
+ </file>
+ </group>
+ <group>
+ <name>drivers</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\drivers\uart.c</name>
+ </file>
+ </group>
+ <group>
+ <name>kernel</name>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\clock.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\components.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\device.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\idle.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\ipc.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\irq.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\kservice.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\mem.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\memheap.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\mempool.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\module.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\object.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\scheduler.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\slab.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\thread.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\src\timer.c</name>
+ </file>
+ </group>
+</project>
+
+
diff --git a/bsp/beaglebone/am335x_sk.eww b/bsp/beaglebone/am335x_sk.eww new file mode 100644 index 0000000000..b9b4660828 --- /dev/null +++ b/bsp/beaglebone/am335x_sk.eww @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="iso-8859-1"?>
+
+<workspace>
+ <project>
+ <path>$WS_DIR$\am335x_sk.ewp</path>
+ </project>
+</workspace>
+
+
diff --git a/bsp/beaglebone/applications/startup.c b/bsp/beaglebone/applications/startup.c index a34e406a0a..c079240b63 100644 --- a/bsp/beaglebone/applications/startup.c +++ b/bsp/beaglebone/applications/startup.c @@ -10,6 +10,7 @@ * Change Logs: * Date Author Notes * 2012-12-05 Bernard the first version + * 2015-11-11 zchong support iar compiler */ #include <rthw.h> @@ -18,7 +19,9 @@ #include <board.h> extern int rt_application_init(void); - +#ifdef __ICCARM__ +#pragma section="HEAP" +#endif /** * This function will startup RT-Thread RTOS. */ @@ -34,8 +37,12 @@ void rtthread_startup(void) /* initialize memory system */ #ifdef RT_USING_HEAP +#ifdef __ICCARM__ +rt_system_heap_init(__segment_end("HEAP"), (void*)0x8FFFFFFF); +#else rt_system_heap_init(HEAP_BEGIN, HEAP_END); #endif +#endif /* initialize scheduler system */ rt_system_scheduler_init(); diff --git a/bsp/beaglebone/drivers/serial.c b/bsp/beaglebone/drivers/uart.c index 776ef3fa3c..776ef3fa3c 100644 --- a/bsp/beaglebone/drivers/serial.c +++ b/bsp/beaglebone/drivers/uart.c diff --git a/bsp/beaglebone/drivers/serial.h b/bsp/beaglebone/drivers/uart.h index 15f7f2c399..15f7f2c399 100644 --- a/bsp/beaglebone/drivers/serial.h +++ b/bsp/beaglebone/drivers/uart.h diff --git a/bsp/beaglebone/drivers/serial_reg.h b/bsp/beaglebone/drivers/uart_reg.h index cb984631f8..cb984631f8 100644 --- a/bsp/beaglebone/drivers/serial_reg.h +++ b/bsp/beaglebone/drivers/uart_reg.h diff --git a/bsp/beaglebone/rtconfig.h b/bsp/beaglebone/rtconfig.h index a4e2bc2b8f..31f04a79c7 100644 --- a/bsp/beaglebone/rtconfig.h +++ b/bsp/beaglebone/rtconfig.h @@ -127,7 +127,7 @@ // <bool name="RT_USING_LIBC" description="Using C library" default="true" /> #define RT_USING_LIBC // <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" /> -#define RT_USING_PTHREADS +//#define RT_USING_PTHREADS // </section> // <section name="RT_USING_DFS" description="Device file system" default="true" > |
