From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sat, 14 Aug 2010 23:47:38 +0200 Subject: [U-Boot] Struct SoC access In-Reply-To: <4C66F54D.2060701@emk-elektronik.de> References: <4C665CB9.2040406@emk-elektronik.de> <20100814143009.A18461606A5@gemini.denx.de> <4C66CCCF.9080303@emk-elektronik.de> <20100814184641.981AC1606A5@gemini.denx.de> <4C66EECA.5020509@emk-elektronik.de> <20100814194117.982C71606A5@gemini.denx.de> <4C66F54D.2060701@emk-elektronik.de> Message-ID: <20100814214738.0BEC81606A5@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 Reinhard Meyer, In message <4C66F54D.2060701@emk-elektronik.de> you wrote: > > >> I was even thinking of something like > >> > >> struct soc { > >> u32 xyz[0x80]; /* XYZ unit */ > >> u32 dbu[0x80]; /* Debug Unit */ > >> u32 rstc[0x80]; /* Reset Controller */ > >> and so on. > > > > This is what PPC used to do; I like that - but ARM people always > > explained to me that it makes no sense because address space on ARM > > SoC is only sparely populated. > > Even if, that's no reason, on can write "u32 spi0[0x1000]", on AT91 > the spacing of peripherals is 0x4000 bytes, in fact it repeats > times in its window. The system stuff is like one peripheral with > its components spaced by 0x200 bytes (hence the 0x80 above). I think we have a misunderstaning ehre - I thought the entries like "xyz" were indeed "u32" types - buut now I get the impression that what you have in mind is that they are actually structs describing hardware blocks. Then it should be written like that. For example, see file "arch/powerpc/include/asm/8xx_immap.h": struct immap is what corresponds to your struct soc above. > Would the toolchain "gulp" when one defines the whole 4 GB that way? Why not? 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 It [being a Vulcan] means to adopt a philosophy, a way of life which is logical and beneficial. We cannot disregard that philosophy merely for personal gain, no matter how important that gain might be. -- Spock, "Journey to Babel", stardate 3842.4