DECLARE_GLOBAL_DATA_PTR;
-/* UNSTUFF_BITS macro taken from Linux Kernel: drivers/mmc/core/sd.c */
-#define UNSTUFF_BITS(resp, start, size) \
- ({ \
- const int __size = size; \
- const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \
- const int __off = 3 - ((start) / 32); \
- const int __shft = (start) & 31; \
- u32 __res; \
- \
- __res = resp[__off] >> __shft; \
- if (__size + __shft > 32) \
- __res |= resp[__off - 1] << ((32 - __shft) % 32); \
- __res & __mask; \
- })
-
static u32 msm_board_serial(void)
{
struct mmc *mmc_dev;
if (mmc_init(mmc_dev))
return 0;
- return UNSTUFF_BITS(mmc_dev->cid, 16, 32);
+ /* MMC serial number */
+ return mmc_dev->cid[2] << 16 | mmc_dev->cid[3] >> 16;
}
static void msm_generate_mac_addr(u8 *mac)