[BACK]Return to platform.h CVS log [TXT][DIR] Up to [local] / prex-old / boot / avr32 / ngw100

Annotation of prex-old/boot/avr32/ngw100/platform.h, Revision 1.1

1.1     ! nbrk        1: /*
        !             2:  * $Id$
        !             3:  */
        !             4: /*-
        !             5:  * Copyright (c) 2005, Kohsuke Ohtani
        !             6:  * All rights reserved.
        !             7:  *
        !             8:  * Redistribution and use in source and binary forms, with or without
        !             9:  * modification, are permitted provided that the following conditions
        !            10:  * are met:
        !            11:  * 1. Redistributions of source code must retain the above copyright
        !            12:  *    notice, this list of conditions and the following disclaimer.
        !            13:  * 2. Redistributions in binary form must reproduce the above copyright
        !            14:  *    notice, this list of conditions and the following disclaimer in the
        !            15:  *    documentation and/or other materials provided with the distribution.
        !            16:  * 3. Neither the name of the author nor the names of any co-contributors
        !            17:  *    may be used to endorse or promote products derived from this software
        !            18:  *    without specific prior written permission.
        !            19:  *
        !            20:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
        !            21:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            22:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            23:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
        !            24:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            25:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            26:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            27:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            28:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            29:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            30:  * SUCH DAMAGE.
        !            31:  */
        !            32:
        !            33: #ifndef _OFFSETS_H
        !            34: #define _OFFSETS_H
        !            35:
        !            36: #define DEBUG_BOOT
        !            37:
        !            38: #define PAGE_OFFSET    0x00000000
        !            39:
        !            40: #define BOOT_INFO      0x10030000
        !            41: #define BOOT_INFO_SIZE 0x00000800
        !            42: /* #define BOOT_STACK  (0x11fbfffc - BOOT_INFO_SIZE) */
        !            43: #define BOOT_STACK     0x11fc0000 - BOOT_INFO_SIZE
        !            44: #define ARCHIVE_START  0x08002000      /* XXX */
        !            45:
        !            46: #define BOOT_PARAMS    0x11fc0000
        !            47:
        !            48: #ifndef __ASSEMBLY__
        !            49:
        !            50: /*
        !            51:  * Page mapping
        !            52:  */
        !            53: #define phys_to_virt(p_addr)   (void *)((u_long)(p_addr) + PAGE_OFFSET)
        !            54: #define virt_to_phys(v_addr)   (void *)((u_long)(v_addr) - PAGE_OFFSET)
        !            55:
        !            56: #if defined(DEBUG)
        !            57:
        !            58: /* XXX probably should be defined somewhere else to share with MI code */
        !            59: #define DEBUG_USART_THR        0xffe0101c      /* transmitter holding register */
        !            60: #define DEBUG_USART_CSR        0xffe01014      /* channel status register */
        !            61: #define  USART_CSR_TXRDY       0x02
        !            62:
        !            63: /*
        !            64:  * Put one character over USART1, which is an onboard RS232.
        !            65:  */
        !            66: static __inline void
        !            67: putc(int c)
        !            68: {
        !            69:        /* poll TXRDY */
        !            70:        while ((*(volatile uint32_t *)(DEBUG_USART_CSR) & USART_CSR_TXRDY) == 0)
        !            71:                ;
        !            72:
        !            73:        *(volatile uint32_t *)DEBUG_USART_THR = c;
        !            74: }
        !            75: #else
        !            76: #define putc(c)
        !            77: #endif
        !            78: extern void setup_bootinfo(struct boot_info **);
        !            79:
        !            80: #endif /* !__ASSEMBLY__ */
        !            81: #endif /* _OFFSETS_H */

CVSweb