Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 712a10b in mainline


Ignore:
Timestamp:
2012-04-04T18:50:40Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
063ae706
Parents:
6b3ee0c5
Message:

amdm37,root: Enable USB host clock before launching drivers.

Makes device registers accessible.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c

    r6b3ee0c5 r712a10b  
    4141#include <ops/hw_res.h>
    4242#include <stdio.h>
     43#include <ddi.h>
    4344
    4445#define NAME  "rootamdm37x"
     
    160161static int rootamdm37x_dev_add(ddf_dev_t *dev)
    161162{
     163        {
     164        /* Enable USB host clocks */
     165        uint32_t *reg = NULL;
     166        const int ret = pio_enable((void*)0x48005400, 8192, (void**)&reg);
     167        assert(ret == EOK);
     168        assert(reg);
     169        /* offset 0x10 (0x4 int32)[0] enables fclk,
     170         * offset 0x00 (0x0 int32)[0 and 1] enables iclk,
     171         * offset 0x30 (0xc int32)[0] enables autoidle
     172         */
     173        reg[0x4] = 0x1;
     174        reg[0x0] = 0x3;
     175        reg[0xc] = 0x1;
     176        }
     177
    162178        /* Register functions */
    163179        if (!rootamdm37x_add_fun(dev, "ohci", "usb/host=ohci", &ohci))
Note: See TracChangeset for help on using the changeset viewer.