From: Bernhard Walle Date: Tue, 20 Aug 2013 22:21:36 +0200 Subject: [U-Boot] [PATCH v2 7/7] imx: add status reporting for HAB status In-Reply-To: <1376318374-3497-8-git-send-email-sbabic@denx.de> References: <1373548001-19728-1-git-send-email-sbabic@denx.de> <1376318374-3497-1-git-send-email-sbabic@denx.de> <1376318374-3497-8-git-send-email-sbabic@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, Am 12.08.13 16:39, schrieb Stefano Babic: > + > +bool is_hab_enabled(void) > +{ > + struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; > + struct fuse_bank *bank = &ocotp->bank[0]; > + struct fuse_bank0_regs *fuse = > + (struct fuse_bank0_regs *)bank->fuse_regs; > + uint32_t reg = readl(&fuse->cfg5); > + > + return (reg & 0x2) == 0x2; > +} With the exception of that function and the required structure definitions, the whole code also works with i.MX53 (tested with LOCO board), too. Also AN4581 [1] that describes HAB doesn't differentiate between i.MX53 and i.MX6 in that case as they both use HAB v4. I think you have more experience how to organize the code (I added a few symlinks and modified only the Makefile, but I guess that symlink are not the best solution). Regards, Bernhard [1] http://cache.freescale.com/files/32bit/doc/app_note/AN4581.pdf