Hi! Adam,
From: Adam Hoka <adam.h...@gmail.com> Date: Sun, 5 Sep 2010 20:17:54 +0200 > On Sun, 05 Sep 2010 15:31:45 +0900 (JST) > KIYOHARA Takashi <kiyoh...@kk.iij4u.or.jp> wrote: > > > Hi! Adam, > > > > > > From: Adam Hoka <ah...@netbsd.org> > > Date: Sat, 4 Sep 2010 16:23:48 +0000 > > > > > Module Name: src > > > Committed By: ahoka > > > Date: Sat Sep 4 16:23:48 UTC 2010 > > > > > > Modified Files: > > > src/sys/arch/arm/omap: omap2_gpmc.c omap2_gpmcvar.h > > > > > > Log Message: > > > Add gpmc_register_read and gpmc_register_write to access registers > > > mapped by the gpmc driver (eg.: GPMC_CONFIG, GPMC_STATUS). > > > > > > The driver should save the parent (gpmc) device's sc pointer > > > to be able to use these functions. > > > > I think that I should be able to access it with this function doesn't > > have softc. > > For instance, u-boot of my Overo doesn't set ethernet. Therefore, I > > operate GPMC_CONFIG7_4 in gxio.c for ethernet. > > Why not in the ethernet driver? My Overo ethernet is: smsh0 at gpmc0 addr 0x01000000 intr 272: SMSC LAN9221 Rev 0 However, gpmc0 checks GPMC_CONFIG7_CSVALID and cs_addr, cs_size for each CS. And attach, if CS is valid. If ethernet is not attached, the driver of ethernet cannot set GPMC_CONFIG7_5. We are setting it according to this timing now. ;-) initarm() +- process_kernel_args() | +- gxio_config_expansion() | +- gxio_config_gpio() | +- eth0_config() | | ioreg_write(OVERO_GPMC_VBASE + GPMC_CONFIG7_5, | GPMC_CONFIG7_CSVALID | | GPMC_CONFIG7(GPMC_CONFIG7_MASK_16M, cf->cf_loc[GPMCCF_ADDR])); : : gpmc_attach() +- gpmc_csconfig_init() | for (i=0; i < GPMC_NCS; i++) { | memset(cs, 0, sizeof(gpmc_csconfig_t)); | if ((r & GPMC_CONFIG7_CSVALID) != 0) { | cs->cs_addr = omap_gpmc_config7_addr(r); | cs->cs_size = omap_gpmc_config7_size(r); | } | +- config_search_ia(gpmc_search) +- gpmc_search() for (i=0; i < GPMC_NCS; i++) { if ((aa.gpmc_addr >= cs->cs_addr) && (aa.gpmc_addr < (cs->cs_addr + cs->cs_size))) { : config_match(parent, cf, &aa) config_attach(parent, cf, &aa, gpmc_print) After this, our ethernet(smsh(4)) is attached. Thanks, -- kiyohara