[BACK]Return to machdep.c CVS log [TXT][DIR] Up to [local] / prex-old / dev / arm / cats

File: [local] / prex-old / dev / arm / cats / machdep.c (download)

Revision 1.4, Fri Aug 8 13:18:16 2008 UTC (15 years, 9 months ago) by nbrk
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +3 -2 lines

Start implementing basic hardware support for CATS, based on new autoconfiguration
mechanism. This effectively uses bus_space to abstract children of parents.
Some info about these drivers:
hostio is a host memory-mapped i/o - one and only child of 'root';
footbridge is just a proxy for now;
fuart is a DC21285 UART driver which fills uart_attach_args and attaches
com, which is machine independent driver;

This all is not finished yet (just quick hacks), but commit it so i could work at home.

/*
 * $Id: machdep.c,v 1.4 2008/08/08 13:18:16 nbrk Exp $
 */
/*-
 * Copyright (c) 2007, Kohsuke Ohtani
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/*
 * machdep.c - machine dependent functions
 */

#include <driver.h>

extern uint32_t	sapmc_getfreq(void);
extern void	sapmc_setfreq(int mode);


/*
 * Set system to suspend power state.
 */
void
machine_suspend(void)
{
}

/*
 * Power off system
 */
void
machine_poweroff(void)
{

	irq_lock();
	printk("The system is halted. You can turn off power.");
	for (;;)
		machine_idle();
}


/*
 * Initialize
 */
int
machine_init(void)
{
#if 0
	/*
	 * Set Core frequency to maximum value.
	 */
	printk("StrongARM Core Frequency %u MHz, ", sapmc_getfreq() / 1000000);
	sapmc_setfreq(12);
	printk("setting CCF to %u MHz\n", sapmc_getfreq() / 1000000);
#endif
	return 0;
}