ti_scm.c (67bc8c8b9e69bc53221a9bd914e418d81d6cdc7d) ti_scm.c (69d14913fc7c96d67fe4da67ba8388d0007c5240)
1/*
2 * Copyright (c) 2010
3 * Ben Gray <ben.r.gray@gmail.com>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 53 unchanged lines hidden (view full) ---

62#include <machine/resource.h>
63
64#include <dev/ofw/openfirm.h>
65#include <dev/ofw/ofw_bus.h>
66#include <dev/ofw/ofw_bus_subr.h>
67#include <dev/fdt/fdt_pinctrl.h>
68
69#include "ti_scm.h"
1/*
2 * Copyright (c) 2010
3 * Ben Gray <ben.r.gray@gmail.com>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 53 unchanged lines hidden (view full) ---

62#include <machine/resource.h>
63
64#include <dev/ofw/openfirm.h>
65#include <dev/ofw/ofw_bus.h>
66#include <dev/ofw/ofw_bus_subr.h>
67#include <dev/fdt/fdt_pinctrl.h>
68
69#include "ti_scm.h"
70#include "ti_cpuid.h"
70
71static struct resource_spec ti_scm_res_spec[] = {
72 { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Control memory window */
73 { -1, 0 }
74};
75
76static struct ti_scm_softc *ti_scm_sc;
77
78#define ti_scm_read_4(sc, reg) \
79 bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
80#define ti_scm_write_4(sc, reg, val) \
81 bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
82
83/*
84 * Device part of OMAP SCM driver
85 */
86static int
87ti_scm_probe(device_t dev)
88{
71
72static struct resource_spec ti_scm_res_spec[] = {
73 { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Control memory window */
74 { -1, 0 }
75};
76
77static struct ti_scm_softc *ti_scm_sc;
78
79#define ti_scm_read_4(sc, reg) \
80 bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
81#define ti_scm_write_4(sc, reg, val) \
82 bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
83
84/*
85 * Device part of OMAP SCM driver
86 */
87static int
88ti_scm_probe(device_t dev)
89{
90
91 if (!ti_soc_is_supported())
92 return (ENXIO);
93
89 if (!ofw_bus_status_okay(dev))
90 return (ENXIO);
91
92 if (!ofw_bus_is_compatible(dev, "syscon"))
93 return (ENXIO);
94
95 if (ti_scm_sc) {
96 return (EEXIST);

--- 78 unchanged lines hidden ---
94 if (!ofw_bus_status_okay(dev))
95 return (ENXIO);
96
97 if (!ofw_bus_is_compatible(dev, "syscon"))
98 return (ENXIO);
99
100 if (ti_scm_sc) {
101 return (EEXIST);

--- 78 unchanged lines hidden ---