2 * Generic prom definitions
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #ifndef _ADM5120_PROM_H_
13 #define _ADM5120_PROM_H_
18 static inline u16 prom_read_le16(void *buf)
22 return ((u16)p[0] + ((u16)p[1] << 8));
25 static inline u32 prom_read_le32(void *buf)
29 return ((u32)p[0] + ((u32)p[1] << 8) + ((u32)p[2] << 16) +
33 static inline u16 prom_read_be16(void *buf)
37 return (((u16)p[0] << 8) + (u16)p[1]);
40 static inline u32 prom_read_be32(void *buf)
44 return (((u32)p[0] << 24) + ((u32)p[1] << 16) + ((u32)p[2] << 8) +
48 #endif /* _ADM5120_PROM_H_ */