aboutsummaryrefslogtreecommitdiffstats
path: root/include/site/linux-uclibc
Commit message (Expand)AuthorAgeFilesLines
* use a common site/linux config, since site/linux-gnu & site/linux-uclibc conf...Nicolas Thill2009-12-181-72/+1
* add sitefile definitions for ac_cv_func_setgrent_voidFelix Fietkau2009-07-231-0/+1
* add ac_cv_file__dev_zero to sitefilesFelix Fietkau2008-08-061-0/+1
* add missing configure variable to sitefile (required by gstreamer)Felix Fietkau2008-08-051-0/+1
* add 'getgrgid' to uClibc site config, needed after glib2 update in [11088]Nicolas Thill2008-05-091-0/+1
* uClibc should actually support va_copyNicolas Thill2008-04-211-1/+1
* fix ntpd compileFelix Fietkau2007-12-301-0/+1
* We also need bzero and bcmp to be put in thereFlorian Fainelli2007-12-301-0/+2
* fix net-snmp compileFelix Fietkau2007-12-301-0/+3
* prevent ldconfig use in autoconf based packagesNicolas Thill2007-08-261-0/+1
* fix typos in CONFIG_SITE filesNicolas Thill2006-11-071-2/+0
* fix squid and rp-pppoe (closes: #869)Nicolas Thill2006-10-201-1/+2
* fix gnupg compileFelix Fietkau2006-10-191-1/+1
* small fix for the sitefilesFelix Fietkau2006-10-191-1/+2
* fix bmon compileFelix Fietkau2006-10-191-0/+1
* add sitefiles similar to the ones from openembeddedFelix Fietkau2006-10-191-0/+60
olor: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  ADM5120 NAND interface definitions
 *
 *  This header file defines the hardware registers of the ADM5120 SoC
 *  built-in NAND interface.
 *
 *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
 *
 *  NAND interface routines was based on a driver for Linux 2.6.19+ which
 *  was derived from the driver for Linux 2.4.xx published by Mikrotik for
 *  their RouterBoard 1xx and 5xx series boards.
 *    Copyright (C) 2007 David Goodenough <david.goodenough@linkchoose.co.uk>
 *    Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 *
 */

#ifndef _MACH_ADM5120_NAND_H
#define _MACH_ADM5120_NAND_H

#include <linux/types.h>
#include <linux/io.h>

#include <asm/mach-adm5120/adm5120_defs.h>
#include <asm/mach-adm5120/adm5120_switch.h>

/* NAND control registers */
#define NAND_REG_DATA		0x0 /* data register */
#define NAND_REG_SET_CEn	0x1 /* CE# low */
#define NAND_REG_CLR_CEn	0x2 /* CE# high */
#define NAND_REG_CLR_CLE	0x3 /* CLE low */
#define NAND_REG_SET_CLE	0x4 /* CLE high */
#define NAND_REG_CLR_ALE	0x5 /* ALE low */
#define NAND_REG_SET_ALE	0x6 /* ALE high */
#define NAND_REG_SET_SPn	0x7 /* SP# low (use spare area) */
#define NAND_REG_CLR_SPn	0x8 /* SP# high (do not use spare area) */
#define NAND_REG_SET_WPn	0x9 /* WP# low */
#define NAND_REG_CLR_WPn	0xA /* WP# high */
#define NAND_REG_STATUS		0xB /* Status register */

#define ADM5120_NAND_STATUS_READY	0x80

#define NAND_READ_REG(r) \
	readb((void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r))
#define NAND_WRITE_REG(r, v) \
	writeb((v), (void __iomem *)KSEG1ADDR(ADM5120_NAND_BASE) + (r))

/*-------------------------------------------------------------------------*/

static inline void adm5120_nand_enable(void)
{
	SW_WRITE_REG(SWITCH_REG_BW_CNTL1, BW_CNTL1_NAND_ENABLE);
	SW_WRITE_REG(SWITCH_REG_BOOT_DONE, 1);
}

static inline void adm5120_nand_set_wpn(unsigned int set)
{
	NAND_WRITE_REG((set) ? NAND_REG_SET_WPn : NAND_REG_CLR_WPn, 1);
}

static inline void adm5120_nand_set_spn(unsigned int set)
{
	NAND_WRITE_REG((set) ? NAND_REG_SET_SPn : NAND_REG_CLR_SPn, 1);
}

static inline void adm5120_nand_set_cle(unsigned int set)
{
	NAND_WRITE_REG((set) ? NAND_REG_SET_CLE : NAND_REG_CLR_CLE, 1);
}

static inline void adm5120_nand_set_ale(unsigned int set)
{
	NAND_WRITE_REG((set) ? NAND_REG_SET_ALE : NAND_REG_CLR_ALE, 1);
}

static inline void adm5120_nand_set_cen(unsigned int set)
{
	NAND_WRITE_REG((set) ? NAND_REG_SET_CEn : NAND_REG_CLR_CEn, 1);
}

static inline u8 adm5120_nand_get_status(void)
{
	return NAND_READ_REG(NAND_REG_STATUS);
}

#endif /* _MACH_ADM5120_NAND_H */