Changeset b109add in rtems


Ignore:
Timestamp:
Mar 21, 2016, 12:50:27 PM (4 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
61cc024
Parents:
6ecad1d
git-author:
Daniel Hellstrom <daniel@…> (03/21/16 12:50:27)
git-committer:
Daniel Hellstrom <daniel@…> (03/06/17 06:54:55)
Message:

leon: Fix ambapp_bus OCCAN device registeration order

NOTE that this will change the association of /dev/occanN
with OCCAN[N] device to the same order as in hardware. This means
that if you have been useing /dev/occan0 before you have to use
/dev/occan1 on a dual OCCAN device system (this affects GR712RC).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/drvmgr/ambapp_bus.c

    r6ecad1d rb109add  
    454454#endif
    455455
    456 /* Fix device in last stage */
     456/* Fix device in last stage and/or register additional devices.
     457 * Function returns:
     458 *  0  Register device as normal
     459 *  1  Fixup function handles registration
     460 */
    457461static int ambapp_dev_fixup(struct drvmgr_dev *dev, struct amba_dev_info *pnp)
    458462{
     
    465469         *  Now, lets detect sub cores.
    466470         */
    467         if ( (pnp->info.device == GAISLER_CANAHB) && (pnp->info.vendor == VENDOR_GAISLER) ) {
    468                 struct drvmgr_dev *newdev;
     471        if ( (pnp->info.device == GAISLER_CANAHB) &&
     472             (pnp->info.vendor == VENDOR_GAISLER) ) {
     473                struct drvmgr_dev *newdev, *devs_to_register[8];
    469474                struct amba_dev_info *pnpinfo;
    470475                int subcores;
    471476                int core;
    472477
     478                devs_to_register[0] = dev;
    473479                subcores = (pnp->info.ahb_slv->ver & 0x7) + 1;
    474480                for(core = 1; core < subcores; core++) {
     
    481487                        newdev->businfo = (void *)pnpinfo;
    482488
    483                         /* Register device */
    484                         drvmgr_dev_register(newdev);
     489                        devs_to_register[core] = newdev;
    485490                }
    486         } else if ( (pnp->info.device == GAISLER_GPIO) && (pnp->info.vendor == VENDOR_GAISLER) ) {
     491                /* Register all CAN devices */
     492                for(core = 0; core < subcores; core++)
     493                        drvmgr_dev_register(devs_to_register[core]);
     494                return 1;
     495        } else if ( (pnp->info.device == GAISLER_GPIO) &&
     496                    (pnp->info.vendor == VENDOR_GAISLER) ) {
    487497                /* PIO[N] is connected to IRQ[N]. */
    488498                pnp->info.irq = 0;
     
    584594        newdev->businfo = (void *)pnpinfo;
    585595
    586         ambapp_dev_fixup(newdev, pnpinfo);
    587 
    588         /* Register New Device */
    589         drvmgr_dev_register(newdev);
     596        if ( ambapp_dev_fixup(newdev, pnpinfo) == 0 )
     597                drvmgr_dev_register(newdev); /* Register New Device */
    590598}
    591599
Note: See TracChangeset for help on using the changeset viewer.