Commit 1e06a5cc authored by Wesley W. Terpstra's avatar Wesley W. Terpstra

Use #defines for Etherbone config space addresses.

parent bc4cc1a7
#ifndef ETHERBONE_CONFIG
#define ETHERBONE_CONFIG
/* These values are taken directly from the Etherbone specification */
#define ERROR_STATUS_HIGH 0
#define ERROR_STATUS_LOW 4
#define SDB_ADDRESS_HIGH 8
#define SDB_ADDRSES_LOW 12
/* These are implementation specific */
#define EB_MAC_HIGH16 16
#define EB_MAC_LOW32 20
#define EB_IPV4 24
#define EB_PORT 28
#endif
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#define BASE_SYSCON 0x20400 #define BASE_SYSCON 0x20400
#define BASE_UART 0x20500 #define BASE_UART 0x20500
#define BASE_ONEWIRE 0x20600 #define BASE_ONEWIRE 0x20600
#define BASE_ETHERBONE_CFG 0x20700
#define FMC_EEPROM_ADR 0x50 #define FMC_EEPROM_ADR 0x50
......
#include <string.h> #include <string.h>
#include "ipv4.h" #include "ipv4.h"
#include "hw/memlayout.h"
#include "hw/etherbone-config.h"
#define IP_VERSION 0 #define IP_VERSION 0
#define IP_TOS (IP_VERSION+1) #define IP_TOS (IP_VERSION+1)
...@@ -124,7 +126,8 @@ int send_bootp(uint8_t* buf, int retry) { ...@@ -124,7 +126,8 @@ int send_bootp(uint8_t* buf, int retry) {
int process_bootp(uint8_t* buf, int len) int process_bootp(uint8_t* buf, int len)
{ {
volatile unsigned int *eb_ip = (unsigned int*)0x20718; volatile unsigned int *eb_ip =
(unsigned int*)(BASE_ETHERBONE_CFG + EB_IPV4);
unsigned int ip; unsigned int ip;
uint8_t mac[6]; uint8_t mac[6];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment