User manual

6 OnRISC Hardware API
Figure 4: Watchdog Timer Support
6.9. Read Hardware Parameters like MAC Address, Serial Number etc.
6.9.1. KS8695 based Devices
Such parameters as MAC addresses, serial number etc. are stored in flash and can be accessed via
special structure:
1 struct _param_hw // v1 .0
2 {
3 byte pad [ 1 ] ;
4 u sh o rt szram ; // d i r e c t in MB
5 u sh o rt s z f l a s h 2 ;
6 u sh o rt s z f l a s h 1 ; // d i r e c t in MB
7 byte mac2 [ 6 ] ;
8 byte mac1 [ 6 ] ;
9 u sh o rt b i o s i d ;
10 char prdd ate [ 1 1 ] ; // as a s t r i n g i e . " 0 1 . 0 1.2 0 0 6 "
11 ulon g s e r i a l n r ;
12 ulon g hwrev ;
13 ulon g magic ;
14 } __attribute__ ( ( packed ) ) ;
See hwtest/hwtest.c->param_read_hw_params() routine on how to read the parameters from
flash.
6.9.2. OMAP3 based Devices
1 typedef struct _BSP_VS_HWPARAM // v1 . 0
2 {
3 ULONG Magic ;
4 ULONG HwRev ;
5 ULONG SerialNumber ;
6 CHAR PrdDate [ 1 1 ] ; // as a s t r i n g i e . " 0 1 . 0 1.2 0 0 6 "
7 USHORT SystemId ;
8 BYTE MAC1 [ 6 ] ;
9 BYTE MAC2 [ 6 ] ;
10 BYTE MAC3 [ 6 ] ;
11 } BSP_VS_HWPARAM;
Use onrisctool.py without parameter and you’ll get a list of all parameters stored in EEPROM.
May 2014 OnRISC User Manual 48