From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Heimpold Date: Sat, 24 Aug 2013 15:08:59 +0200 Subject: [U-Boot] can u-boot tools fw_{printenv, setenv} work with eMMC HW partition? In-Reply-To: References: <20130824111610-3666@mutt-kz> Message-ID: <2868345.KCFN3Hjp9Z@kerker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, > right, i can see that and that clarifies things for me. my > *original* question was whether there was a way to set up > /etc/fw_env.config to refer to the eMMC partition /dev/mmcblk1boot1 > *directly*, treating it as a regular block partition and bypassing all > the MTD-related processing. (perhaps stefano can weigh in and say > whether that's how he understood what i was asking.) > > if you instead refer to /dev/mmcblk1, as i understand it, you're > just back to the standard MTD-based access, yes? the /dev/mmcblk... devices are block devices and do not provide the MTD API of the kernel. I guess this is the cause for the error message you've seen. You could try strace to verify. And this is the problem why the patches Luka mentioned are required: they make fw_{printenv,setenv} aware of opening such block devices by-passing the MTD-specific stuff, that means simply open the file, write/read the data and close the file descriptor. Without these patches these tools assume that the file descriptor opened are MTD-based. You can pass what ever you want via your config, so your file could look like: /dev/mmcblk1boot1 0x0 0x4000 Since the partition is somewhere placed on the eMMC device, you can also refer to the same location using /dev/mmcblk1. In the latter case you have to calculate the offset correctly to not overwrite other data (e.g. on other partitions). Using /dev/mmcblk1boot1 as "entry point" the kernel should reject write requests which go beyond the partition size. BR, Michael