1/*
2 * @TAG(OTHER_GPL)
3 */
4
5/*
6 * (C) Copyright 2000-2009
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 *
9 * See file CREDITS for list of people who contributed to this
10 * project.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * MA 02111-1307 USA
26 */
27#pragma once
28
29#undef	_LINUX_CONFIG_H
30#define _LINUX_CONFIG_H 1	/* avoid reading Linux autoconf.h file	*/
31
32#include <utils/arith.h>
33
34#include "mx6qsabrelite.h"
35#include "../unimplemented.h"
36
37#ifdef CONFIG_POST
38#define CONFIG_HAS_POST
39#ifndef CONFIG_POST_ALT_LIST
40#define CONFIG_POST_STD_LIST
41#endif
42#endif
43
44#ifdef CONFIG_INIT_CRITICAL
45#error CONFIG_INIT_CRITICAL is deprecated!
46#error Read section CONFIG_SKIP_LOWLEVEL_INIT in README.
47#endif
48
49#define roundup(x, y)		((((x) + ((y) - 1)) / (y)) * (y))
50
51#define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
52
53#ifdef ETH_DEBUG
54#define _DEBUG	1
55#else
56#define _DEBUG	1
57#endif
58
59/*
60 * Output a debug text when condition "cond" is met. The "cond" should be
61 * computed by a preprocessor in the best case, allowing for the best
62 * optimization.
63 */
64#define debug_cond(cond, fmt, args...)		\
65	do {					\
66		if (cond)			\
67			printf(fmt, ##args);	\
68	} while (0)
69
70#define debug(fmt, args...)			\
71	debug_cond(_DEBUG, fmt, ##args)
72
73/**
74 * container_of - cast a member of a structure out to the containing structure
75 * @ptr:	the pointer to the member.
76 * @type:	the type of the container struct this is embedded in.
77 * @member:	the name of the member within the struct.
78 *
79 */
80#define container_of(ptr, type, member) ({			\
81	const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
82	(type *)( (char *)__mptr - offsetof(type,member) );})
83
84