Deleted Added
full compact
emac.h (157873) emac.h (161196)
1/******************************************************************************
2 *
3 * Filename: emac.h
4 *
5 * Definition of routine to set the MAC address.
6 *
7 * Revision information:
8 *
9 * 28AUG2004 kb_admin initial creation
10 *
11 * BEGIN_KBDD_BLOCK
12 * No warranty, expressed or implied, is included with this software. It is
13 * provided "AS IS" and no warranty of any kind including statutory or aspects
14 * relating to merchantability or fitness for any purpose is provided. All
15 * intellectual property rights of others is maintained with the respective
16 * owners. This software is not copyrighted and is intended for reference
17 * only.
18 * END_BLOCK
19 *
1/******************************************************************************
2 *
3 * Filename: emac.h
4 *
5 * Definition of routine to set the MAC address.
6 *
7 * Revision information:
8 *
9 * 28AUG2004 kb_admin initial creation
10 *
11 * BEGIN_KBDD_BLOCK
12 * No warranty, expressed or implied, is included with this software. It is
13 * provided "AS IS" and no warranty of any kind including statutory or aspects
14 * relating to merchantability or fitness for any purpose is provided. All
15 * intellectual property rights of others is maintained with the respective
16 * owners. This software is not copyrighted and is intended for reference
17 * only.
18 * END_BLOCK
19 *
20 * $FreeBSD: head/sys/boot/arm/at91/libat91/emac.h 157873 2006-04-19 17:16:49Z imp $
20 * $FreeBSD: head/sys/boot/arm/at91/libat91/emac.h 161196 2006-08-10 18:11:22Z imp $
21 *****************************************************************************/
22
23
24#ifndef _EMAC_H_
25#define _EMAC_H_
26
21 *****************************************************************************/
22
23
24#ifndef _EMAC_H_
25#define _EMAC_H_
26
27extern void SetMACAddress(unsigned low_address, unsigned high_address);
27extern void SetMACAddress(unsigned char addr[6]);
28extern void SetServerIPAddress(unsigned address);
29extern void SetLocalIPAddress(unsigned address);
30extern void EMAC_Init(void);
31extern void TFTP_Download(unsigned address, char *filename);
32
33#define MAX_RX_PACKETS 8
34#define RX_PACKET_SIZE 1536
35#define RX_BUFFER_START 0x21000000

--- 63 unchanged lines hidden (view full) ---

99} __attribute__((__packed__)) udp_header_t;
100
101typedef struct {
102 unsigned short opcode;
103 unsigned short block_num;
104 unsigned char data[512];
105} __attribute__((__packed__)) tftp_header_t;
106
28extern void SetServerIPAddress(unsigned address);
29extern void SetLocalIPAddress(unsigned address);
30extern void EMAC_Init(void);
31extern void TFTP_Download(unsigned address, char *filename);
32
33#define MAX_RX_PACKETS 8
34#define RX_PACKET_SIZE 1536
35#define RX_BUFFER_START 0x21000000

--- 63 unchanged lines hidden (view full) ---

99} __attribute__((__packed__)) udp_header_t;
100
101typedef struct {
102 unsigned short opcode;
103 unsigned short block_num;
104 unsigned char data[512];
105} __attribute__((__packed__)) tftp_header_t;
106
107#define TFTP_RRQ_OPCODE 1
108#define TFTP_WRQ_OPCODE 2
109#define TFTP_DATA_OPCODE 3
110#define TFTP_ACK_OPCODE 4
111#define TFTP_ERROR_OPCODE 5
107// Preswap bytes
108#define TFTP_RRQ_OPCODE 0x0100
109#define TFTP_WRQ_OPCODE 0x0200
110#define TFTP_DATA_OPCODE 0x0300
111#define TFTP_ACK_OPCODE 0x0400
112#define TFTP_ERROR_OPCODE 0x0500
112
113
113#define TFTP_WAITING_SERVER_MAC 1
114#define TFTP_SEND_REQUEST 2
115#define TFTP_GET_DATA 3
116#define TFTP_COMPLETE 4
117
118/* MII registers definition */
119#define MII_STS_REG 0x01
114/* MII registers definition */
115#define MII_STS_REG 0x01
116#define MII_STS_LINK_STAT 0x04
117#ifdef BOOT_KB9202
120#define MII_STS2_REG 0x11
118#define MII_STS2_REG 0x11
119#define MII_STS2_LINK 0x400
120#define MII_STS2_100TX 0x4000
121#define MII_STS2_FDX 0x200
122#else
123#define MII_SPEC_STS_REG 0x11
124#define MII_SSTS_100FDX 0x8000
125#define MII_SSTS_100HDX 0x4000
126#define MII_SSTS_10FDX 0x2000
127#define MII_SSTS_10HDX 0x1000
128#endif
121
122#endif /* _EMAC_H_ */
129
130#endif /* _EMAC_H_ */