summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/karo-tx53/flash_header.c
blob: 5c6aa53e47b741fe1c6e60ad7131c40632eac1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * Copyright (C) 2011 Marc Kleine-Budde <mkl@pengutronix.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#include <common.h>
#include <asm/byteorder.h>
#include <mach/imx-flash-header.h>
#include <asm/barebox-arm-head.h>

void __naked __flash_header_start go(void)
{
	barebox_arm_imx_fcb_head();
}

/*
 * FIXME: These are the dcd values for a Ka-Ro TX53 1011 which
 *        is not in production. It has 1GB DDR2 memory.
 */
#ifdef CONFIG_TX53_REV_1011

#define DCD_NAME_1011 struct imx_dcd_v2_entry __dcd_entry_section dcd_entry

#include "dcd-data-1011.h"

#elif defined(CONFIG_TX53_REV_XX30)

#define DCD_NAME_XX30 u32 __dcd_entry_section dcd_entry

#include "dcd-data-xx30.h"

#endif

#define APP_DEST	0x71000000

int tx53_dcdentry_size = sizeof(dcd_entry);
void *tx53_dcd_entry = &dcd_entry;

struct imx_flash_header_v2 __flash_header_section flash_header = {
	.header.tag		= IVT_HEADER_TAG,
	.header.length		= cpu_to_be16(32),
	.header.version		= IVT_VERSION,

	.entry			= APP_DEST + 0x1000,
	.dcd_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, dcd),
	.boot_data_ptr		= APP_DEST + 0x400 + offsetof(struct imx_flash_header_v2, boot_data),
	.self			= APP_DEST + 0x400,

	.boot_data.start	= APP_DEST,
	.boot_data.size		= DCD_BAREBOX_SIZE,

	.dcd.header.tag		= DCD_HEADER_TAG,
	.dcd.header.length	= cpu_to_be16(sizeof(struct imx_dcd) + sizeof(dcd_entry)),
	.dcd.header.version	= DCD_VERSION,

	.dcd.command.tag	= DCD_COMMAND_WRITE_TAG,
#ifdef CONFIG_TX53_REV_1011
	.dcd.command.length	= cpu_to_be16(sizeof(struct imx_dcd_command) + sizeof(dcd_entry)),
#elif defined(CONFIG_TX53_REV_XX30)
	.dcd.command.length	= cpu_to_be16(0x21c),
#endif
	.dcd.command.param	= DCD_COMMAND_WRITE_PARAM,
};