mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: barebox@lists.infradead.org
Subject: Problem loading environment from spi-nor flash partition since barebox 2017.01.0
Date: Tue, 10 Jan 2017 16:01:40 +0000	[thread overview]
Message-ID: <12b302f6-75ae-bf83-370b-abaf0aef9d29@mev.co.uk> (raw)

Hi!

I thought I'd try updating my custom SoCFPGA-based board from barebox 
2016.11.0 to 2017.01.0, and have only run into one problem, which is 
that it is no longer loading the barebox environment during boot:

---------------------------------------------------------
barebox 2017.01.0 #1 Tue Jan 10 14:01:57 GMT 2017


Board: Belltech dbPod SoCFPGA
designware_eth ff702000.ethernet: user ID: 0x10, Synopsys ID: 0x37
mdio_bus: miibus0: probed
flash@0: s25fl256s1 (32768 Kbytes)
cadence_qspi ff705000.spi: Cadence QSPI NOR flash driver
malloc space: 0x0ff7dd00 -> 0x1fefb9ff (size 255.5 MiB)
barebox-environment environment.5: probe failed: No such device
environment load /dev/env0: No such file or directory
Maybe you have to create the partition.
---------------------------------------------------------


After a bit of poking around, I discovered that it is failing in 
__of_find_path() at these lines:

	if (!dev->driver)
		return -ENODEV;

Those lines were added by commit 
82eb3dff10ae0c0436e0fcd5ff0c9cd2a2caab3c ("of_path: handle no driver for 
device").

I'm not sure which bit of code is responsible for setting dev->driver 
(or whether it is appropriate in this case), but if I remove that test, 
the environment loads OK.

Here is the barebox DTS I am compiling for my board (sorry about any 
line-wrapping):

---------------------------------------------------------
#include <arm/socfpga_cyclone5.dtsi>
#include "socfpga.dtsi"

/ {
	model = "Belltech dbPod SoCFPGA";
	compatible = "belltech,dbpod", "altr,socfpga-cyclone5", "altr,socfpga";

	chosen {

		environment@0 {
			compatible = "barebox,environment";
			device-path = &flash, "partname:barebox-environment";
			/delete-property/file-path;
		};
	};

	aliases {
		ethernet0 = &gmac1;
		/delete-property/ethernet1;
	};

	memory {
		name = "memory";
		device_type = "memory";
		reg = <0x0 0x20000000>; /* 512GB */
	};
};

&gmac1 {
	phy-mode = "rgmii";
	status = "okay";
};

&gpio0 {
	status = "okay";
};

&i2c0 {
	status = "okay";
};

&qspi {
	status = "okay";

	flash: flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "n25q00";
		reg = <0>;
		spi-max-frequency = <100000000>;
		m25p,fast-read;
		cdns,page-size = <256>;
		cdns,block-size = <16>;
		cdns,read-delay = <4>;
		cdns,tshsl-ns = <50>;
		cdns,tsd2d-ns = <50>;
		cdns,tchsh-ns = <4>;
		cdns,tslch-ns = <4>;

		partition@0 {
			label = "prebootloader0";
			reg = <0x00000 0x10000>;
		};

		partition@10000 {
			label = "prebootloader1";
			reg = <0x10000 0x10000>;
		};

		partition@20000 {
			label = "prebootloader2";
			reg = <0x20000 0x10000>;
		};

		partition@30000 {
			label = "prebootloader3";
			reg = <0x30000 0x10000>;
		};

		partition@40000 {
			label = "barebox";
			reg = <0x40000 0x80000>;
		};

		partition@c0000 {
			label = "barebox-environment";
			reg = <0xc0000 0x20000>;
		};

		partition@e0000 {
			label = "barebox-state";
			reg = <0xe0000 0x20000>;
		};

		partition@100000 {
			label = "ubi";
			reg = <0x100000 0x0>;
		};
	};
};
---------------------------------------------------------

Best regards,
Ian Abbott.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-01-10 16:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 16:01 Ian Abbott [this message]
2017-01-10 19:42 ` Trent Piepho
2017-01-11 11:37   ` Ian Abbott
2017-01-11  8:32 ` Sascha Hauer
2017-01-11 13:02   ` Ian Abbott
2017-01-13 17:46   ` Trent Piepho
2017-01-16  7:13     ` s.hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12b302f6-75ae-bf83-370b-abaf0aef9d29@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox