Changeset 58 in SVN


Ignore:
Timestamp:
10/31/2017 02:26:12 PM (12 months ago)
Author:
Tim Harvey
Message:

laguna: Enable external clockgen on boards without clockgen detection

Enable the external pci clockgen on boards where our detection mechanism is
not available to us. This includes: GW2386, GW2391, and GW2393.

Note that on the GW2386, only certain revision/special combinations have the
external clockgen, so we additionally add support for determining a board's
revision and special number.

Signed-off-by: Pushpal Sidhu <psidhu@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • laguna/u-boot-2008.10/board/cavium/cns3000/vega.c

    r57 r58  
    4545static ulong lastdec;
    4646uint8_t model[16];
     47uint8_t rev;
     48int sp;
    4749
    4850#define READ_TIMER1 (*(volatile ulong *)(CFG_TIMERBASE))
     
    102104#endif
    103105
    104         /* boards with external PCI clockgen have GPIOB26 high at powerup */
    105         external_clkgen = (IO_READ(GPIOB_IN) & (1 << 26)) ? 1 : 0;
     106        /**
     107         * All boards with external PCI clockgen have GPIOB26 high at powerup.
     108         * However, exceptions exist with the GW2386 after a certain revision
     109         * and special number, the GW2391, and GW2393.
     110         */
     111        if (strncmp(model, "GW2386", 6) == 0) {
     112                if ((sp == 217) && (rev >= 'E'))
     113                        external_clkgen = 1;
     114                else if ((sp == 0) && (rev == 'D'))
     115                        external_clkgen = 1;
     116                else
     117                        external_clkgen = 0;
     118        }
     119        else if (strncmp(model, "GW2391", 6) == 0) {
     120                if (rev >= 'C')
     121                        external_clkgen = 1;
     122                else
     123                        external_clkgen = 0;
     124        }
     125        else if (strncmp(model, "GW2393", 6) == 0)
     126                external_clkgen = 1;
     127        else
     128                external_clkgen = (IO_READ(GPIOB_IN) & (1 << 26)) ? 1 : 0;
    106129
    107130        printf("PCI:   PERST:GPIOA%d clock:%s\n", gpio_perst,
     
    303326int checkboard(void)
    304327{
     328        int i;
     329
     330        /* determine board model */
    305331        i2c_read(0x51, 0x30, 1, model, 16);
     332
     333        /* determine board revision */
     334        rev = '\0';
     335        for (i = sizeof(model) - 1; i >= 0; i--) {
     336                if (model[i] >= 'A') {
     337                        rev = model[i];
     338                        break;
     339                }
     340        }
     341
     342        /* determine board sp number (assume 3 digit special number) */
     343        sp = 0;
     344        for (i = sizeof(model) - 4; i > 0; i--) {
     345                if (model[i - 1] == 'S' && model[i] == 'P') {
     346                        /* Convert SPXXX to numeric */
     347                        sp = (sp * 10) + (model[i+1] - '0');
     348                        sp = (sp * 10) + (model[i+2] - '0');
     349                        sp = (sp * 10) + (model[i+3] - '0');
     350                        break;
     351                }
     352        }
    306353
    307354        pcie_init();
Note: See TracChangeset for help on using the changeset viewer.