From: Wolfgang Denk Date: Wed, 11 Jan 2012 08:31:33 +0100 Subject: [U-Boot] [PATCH 4/8] powerpc/boot: Master module for boot from SRIO In-Reply-To: <1326195751-20729-4-git-send-email-Gang.Liu@freescale.com> References: <1326195751-20729-1-git-send-email-Gang.Liu@freescale.com> <1326195751-20729-4-git-send-email-Gang.Liu@freescale.com> Message-ID: <20120111073133.310DC1FAA6A@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Liu Gang, In message <1326195751-20729-4-git-send-email-Gang.Liu@freescale.com> you wrote: > For the powerpc processors with SRIO interface, boot location can be configured > from SRIO1 or SRIO2 by RCW. The processor booting from SRIO can do without flash > for u-boot image. The image can be fetched from another processor's memory > space by SRIO link connected between them. > > The processor boots from SRIO is slave, the processor boots from normal flash > memory space and can help slave to boot from its memory space is master. > They are different environments and requirements: > > master: > 1. Nor flash for its own u-boot image, ucode and ENV space. > 2. Slave's u-boot image in master Nor flash. > 3. Normally boot from local Nor flash. Please use "NOR flash" (or "nor flash", if you insist). "Nor" makes no sense. Please fix globally. > + printf("SRIOBOOT - MASTER: Master port [ %d ] for srio boot.\n", > + CONFIG_SRIOBOOT_MASTER_PORT); > + /* configure inbound window1 for slave's u-boot image */ > + printf("SRIOBOOT - MASTER: Inbound window1 for slave's image; " > + "Local = 0x%llx, Srio = 0x%llx, Size = 0x%x\n", > + (u64)CONFIG_SRIOBOOT_SLAVE_IMAGE_LAW_PHYS1, > + (u64)CONFIG_SRIOBOOT_SLAVE_IMAGE_SRIO_PHYS1, > + CONFIG_SRIOBOOT_SLAVE_IMAGE_SIZE); As mentioned before, this looks a lot like debug code, that should be removed from a production version. Use debug() instead? > + out_be32((u32)&srio->riwtar1 + CONFIG_SRIOBOOT_MASTER_PORT * 0x200, > + CONFIG_SRIOBOOT_SLAVE_IMAGE_LAW_PHYS1 >> 12); > + out_be32((u32)&srio->riwbar1 + CONFIG_SRIOBOOT_MASTER_PORT * 0x200, > + CONFIG_SRIOBOOT_SLAVE_IMAGE_SRIO_PHYS1 >> 12); > + out_be32((u32)&srio->riwar1 + CONFIG_SRIOBOOT_MASTER_PORT * 0x200, > + 0x80f55000 > + | atmu_size_mask(CONFIG_SRIOBOOT_SLAVE_IMAGE_SIZE)); This comment applies to the whole patch series: - Get rid of the base address + oofset notation. User C structs instead. - Get rid of hard coded magic numbers. #define the needed values in a readable way. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de On the subject of C program indentation: "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." - Blair P. Houghton