#define TUSB6010_GPIO_ENABLE   0
 #define TUSB6010_DMACHAN       0x3f
 
+#define NOKIA_N810_WIMAX       (1 << 2)
+#define NOKIA_N810             (1 << 1)
+#define NOKIA_N800             (1 << 0)
+
+static u32 board_caps;
+
+#define board_is_n800()                (board_caps & NOKIA_N800)
+#define board_is_n810()                (board_caps & NOKIA_N810)
+#define board_is_n810_wimax()  (board_caps & NOKIA_N810_WIMAX)
+
+static void board_check_revision(void)
+{
+       if (of_have_populated_dt()) {
+               if (of_machine_is_compatible("nokia,n800"))
+                       board_caps = NOKIA_N800;
+               else if (of_machine_is_compatible("nokia,n810"))
+                       board_caps = NOKIA_N810;
+               else if (of_machine_is_compatible("nokia,n810-wimax"))
+                       board_caps = NOKIA_N810_WIMAX;
+       } else {
+               if (machine_is_nokia_n800())
+                       board_caps = NOKIA_N800;
+               else if (machine_is_nokia_n810())
+                       board_caps = NOKIA_N810;
+               else if (machine_is_nokia_n810_wimax())
+                       board_caps = NOKIA_N810_WIMAX;
+       }
+
+       if (!board_caps)
+               pr_err("Unknown board\n");
+}
+
 #if defined(CONFIG_I2C_CBUS_GPIO) || defined(CONFIG_I2C_CBUS_GPIO_MODULE)
 static struct i2c_cbus_platform_data n8x0_cbus_data = {
        .clk_gpio = 66,
 static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on,
                              int vdd)
 {
-       if (machine_is_nokia_n800() || slot == 0)
+       if (board_is_n800() || slot == 0)
                return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
 
        n810_set_power_emmc(dev, power_on);
 {
        int bit, *openp, index;
 
-       if (machine_is_nokia_n800()) {
+       if (board_is_n800()) {
                bit = 1 << 1;
                openp = &slot2_cover_open;
                index = 1;
        if (r < 0)
                return r;
 
-       if (machine_is_nokia_n800())
+       if (board_is_n800())
                vs2sel = 0;
        else
                vs2sel = 2;
        if (r < 0)
                return r;
 
-       if (machine_is_nokia_n800()) {
+       if (board_is_n800()) {
                bit = 1 << 1;
                openp = &slot2_cover_open;
        } else {
 {
        int vs2sel;
 
-       if (machine_is_nokia_n800())
+       if (board_is_n800())
                vs2sel = 0;
        else
                vs2sel = 2;
 
        gpio_free(N8X0_SLOT_SWITCH_GPIO);
 
-       if (machine_is_nokia_n810()) {
+       if (board_is_n810()) {
                gpio_free(N810_EMMC_VSD_GPIO);
                gpio_free(N810_EMMC_VIO_GPIO);
        }
 {
        int err;
 
-       if (machine_is_nokia_n810()) {
+       if (board_is_n810()) {
                mmc1_data.slots[0].name = "external";
 
                /*
        if (err)
                return;
 
-       if (machine_is_nokia_n810()) {
+       if (board_is_n810()) {
                err = gpio_request_array(n810_emmc_gpios,
                                         ARRAY_SIZE(n810_emmc_gpios));
                if (err) {
 
 static void __init n8x0_init_machine(void)
 {
+       board_check_revision();
        omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
        /* FIXME: add n810 spi devices */
        spi_register_board_info(n800_spi_board_info,
        omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
                              ARRAY_SIZE(n8x0_i2c_board_info_1));
        omap_register_i2c_bus(2, 400, NULL, 0);
-       if (machine_is_nokia_n810())
+       if (board_is_n810())
                i2c_register_board_info(2, n810_i2c_board_info_2,
                                        ARRAY_SIZE(n810_i2c_board_info_2));
        board_serial_init();