4 * Generic prom definitions
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
15 #ifndef _ADM5120_PROM_H_
16 #define _ADM5120_PROM_H_
21 static inline u16
prom_read_le16(void *buf
)
25 return ((u16
)p
[0] + ((u16
)p
[1] << 8));
28 static inline u32
prom_read_le32(void *buf
)
32 return ((u32
)p
[0] + ((u32
)p
[1] << 8) + ((u32
)p
[2] << 16) +
36 static inline u16
prom_read_be16(void *buf
)
40 return (((u16
)p
[0] << 8) + (u16
)p
[1]);
43 static inline u32
prom_read_be32(void *buf
)
47 return (((u32
)p
[0] << 24) + ((u32
)p
[1] << 16) + ((u32
)p
[2] << 8) +
51 #endif /* _ADM5120_PROM_H_ */