1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

Working ethernet.

This commit is contained in:
James Snyder 2009-08-03 18:39:43 +00:00
parent 3ddede3004
commit 9f32aa6115
3 changed files with 72 additions and 3 deletions

View File

@ -1,5 +1,5 @@
-- Check platform
if pd.board() ~= 'EK-LM3S8962' and pd.board() ~= 'EK-LM3S6965' and pd.board() ~= 'EAGLE-100' then
if pd.board() ~= 'EK-LM3S8962' and pd.board() ~= 'EK-LM3S6965' and pd.board() ~= 'EAGLE-100' and pd.board() ~= 'EK-LM3S9B92' then
print( pd.board() .. " not supported by this example" )
return
end

View File

@ -0,0 +1,64 @@
MEMORY
{
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00018000
flash (RX) : ORIGIN = 0x00000000, LENGTH = 0x00040000
}
SECTIONS
{
.text :
{
. = ALIGN(4);
_text = .;
PROVIDE(stext = .);
KEEP(*(.isr_vector))
KEEP(*(.init))
*(.text .text.*)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_etext = .;
PROVIDE(etext = .);
_fini = . ;
*(.fini)
} >flash
.data : AT (_etext)
{
. = ALIGN(4);
_data = .;
*(.ramfunc .ramfunc.* .fastrun .fastrun.*)
*(.data .data.*)
*(.gnu.linkonce.d.*)
. = ALIGN(4);
_edata = .;
} >sram
.ARM.extab :
{
*(.ARM.extab*)
} >sram
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx*)
} >sram
__exidx_end = .;
.bss (NOLOAD) : {
_bss = .;
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = .;
} >sram
end = .;
}

View File

@ -23,6 +23,7 @@
#include "hw_types.h"
#include "hw_pwm.h"
#include "hw_nvic.h"
#include "hw_ethernet.h"
#include "debug.h"
#include "gpio.h"
#include "interrupt.h"
@ -812,6 +813,11 @@ static void eth_init()
MAP_SysCtlPeripheralEnable( SYSCTL_PERIPH_ETH );
MAP_SysCtlPeripheralReset( SYSCTL_PERIPH_ETH );
#ifdef FORLM3S9B92
GPIOPinConfigure(GPIO_PF2_LED1);
GPIOPinConfigure(GPIO_PF3_LED0);
#endif
// Enable Ethernet LEDs
MAP_GPIODirModeSet( GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_DIR_MODE_HW );
MAP_GPIOPadConfigSet( GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
@ -834,8 +840,7 @@ static void eth_init()
// - Full Duplex
// - TX CRC Auto Generation
// - TX Padding Enabled
MAP_EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
MAP_EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN | ETH_CFG_TX_PADEN));
// Enable the Ethernet Controller.
MAP_EthernetEnable(ETH_BASE);