Merge commit 'main-jb-2012.08.03-B4' into t114-0806
[linux-2.6.git] / arch / arm / kernel / devtree.c
index bee7f9d..0161982 100644 (file)
@@ -75,6 +75,9 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
        unsigned int score, mdesc_score = ~1;
        unsigned long dt_root;
        const char *model;
+       __be32 *serial_prop;
+       u64 serial = 0;
+       unsigned long len;
 
        if (!dt_phys)
                return NULL;
@@ -118,7 +121,16 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
                model = of_get_flat_dt_prop(dt_root, "compatible", NULL);
        if (!model)
                model = "<unknown>";
-       pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
+
+       serial_prop = of_get_flat_dt_prop(dt_root, "serial-num", &len);
+       if (serial_prop) {
+               serial = of_read_number(serial_prop, len / 4);
+       }
+       system_serial_high = serial >> 32;
+       system_serial_low = serial;
+
+       pr_info("Machine: %s, model: %s, serial: %llu\n", mdesc_best->name,
+               model, serial);
 
        /* Retrieve various information from the /chosen node */
        of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);