From: Icenowy Zheng Date: Wed, 01 Mar 2017 21:07:22 +0800 Subject: [U-Boot] [linux-sunxi] [PATCH 1/8] sunxi: board: Print error after power initialization fails In-Reply-To: <20170301125224.25994-2-oliver@schinagl.nl> References: <20170301125224.25994-1-oliver@schinagl.nl> <20170301125224.25994-2-oliver@schinagl.nl> Message-ID: <1278851488373642@web10m.yandex.ru> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de 01.03.2017, 20:52, "Olliver Schinagl" : > Currently during init, we enable all power, then enable the dram and > after that check if there was an error during power-up. > > This makes little sense, we should enable power and then check if power > was brought up properly initializing other things. > > This patch moves the DRAM init after the power failure check. Seems meaningful... at least some Pine64 wrongly set its DRAM voltage when booting. > > Signed-off-by: Olliver Schinagl > --- >  board/sunxi/board.c | 14 ++++++++------ >  1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/board/sunxi/board.c b/board/sunxi/board.c > index 53656383d5..5467015860 100644 > --- a/board/sunxi/board.c > +++ b/board/sunxi/board.c > @@ -540,11 +540,6 @@ void sunxi_board_init(void) >          power_failed |= axp_set_sw(IS_ENABLED(CONFIG_AXP_SW_ON)); >  #endif >  #endif > - printf("DRAM:"); > - ramsize = sunxi_dram_init(); > - printf(" %d MiB\n", (int)(ramsize >> 20)); > - if (!ramsize) > - hang(); > >          /* >           * Only clock up the CPU to full speed if we are reasonably > @@ -553,7 +548,14 @@ void sunxi_board_init(void) >          if (!power_failed) >                  clock_set_pll1(CONFIG_SYS_CLK_FREQ); >          else > - printf("Failed to set core voltage! Can't set CPU frequency\n"); > + printf("Error setting up the power controller.\n \ > + CPU frequency not set.\n"); > + > + printf("DRAM:"); > + ramsize = sunxi_dram_init(); > + printf(" %d MiB\n", (int)(ramsize >> 20)); > + if (!ramsize) > + hang(); >  } >  #endif > > -- > 2.11.0 > > -- > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com. > For more options, visit https://groups.google.com/d/optout.