Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-uniphier / cpu-info.c
index 2ce73c5af8889ed5ce4398d39829e3fb24761309..1ede50771e82f77f2d202c8d4752c14acee3b4cd 100644 (file)
@@ -1,20 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2013-2014 Panasonic Corporation
  * Copyright (C) 2015-2017 Socionext Inc.
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
-#include <common.h>
+#include <init.h>
+#include <stdio.h>
 #include <linux/errno.h>
 #include <linux/io.h>
+#include <linux/printk.h>
 
+#include "base-address.h"
 #include "soc-info.h"
 
 int print_cpuinfo(void)
 {
        unsigned int id, model, rev, required_model = 1, required_rev = 1;
+       int ret;
+
+       ret = uniphier_base_address_init();
+       if (ret)
+               return ret;
 
        id = uniphier_get_soc_id();
        model = uniphier_get_soc_model();
@@ -23,10 +30,6 @@ int print_cpuinfo(void)
        puts("SoC:   ");
 
        switch (id) {
-       case UNIPHIER_SLD3_ID:
-               puts("sLD3");
-               required_model = 2;
-               break;
        case UNIPHIER_LD4_ID:
                puts("LD4");
                required_rev = 2;
@@ -63,11 +66,11 @@ int print_cpuinfo(void)
        printf(" (model %d, revision %d)\n", model, rev);
 
        if (model < required_model) {
-               printf("Only model %d or newer is supported.\n",
+               pr_err("Only model %d or newer is supported.\n",
                       required_model);
                return -ENOTSUPP;
        } else if (rev < required_rev) {
-               printf("Only revision %d or newer is supported.\n",
+               pr_err("Only revision %d or newer is supported.\n",
                       required_rev);
                return -ENOTSUPP;
        }