1*35b384cbSSimon Glass# SPDX-License-Identifier: GPL-2.0+
2*35b384cbSSimon Glass# Copyright (c) 2018 Google, Inc
3*35b384cbSSimon Glass# Written by Simon Glass <sjg@chromium.org>
4*35b384cbSSimon Glass#
5*35b384cbSSimon Glass# Entry-type module for the 16-bit x86 start-up code for U-Boot TPL
6*35b384cbSSimon Glass#
7*35b384cbSSimon Glass
8*35b384cbSSimon Glassfrom entry import Entry
9*35b384cbSSimon Glassfrom blob import Entry_blob
10*35b384cbSSimon Glass
11*35b384cbSSimon Glassclass Entry_x86_start16_tpl(Entry_blob):
12*35b384cbSSimon Glass    """x86 16-bit start-up code for TPL
13*35b384cbSSimon Glass
14*35b384cbSSimon Glass    Properties / Entry arguments:
15*35b384cbSSimon Glass        - filename: Filename of tpl/u-boot-x86-16bit-tpl.bin (default
16*35b384cbSSimon Glass            'tpl/u-boot-x86-16bit-tpl.bin')
17*35b384cbSSimon Glass
18*35b384cbSSimon Glass    x86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code
19*35b384cbSSimon Glass    must be placed at a particular address. This entry holds that code. It is
20*35b384cbSSimon Glass    typically placed at offset CONFIG_SYS_X86_START16. The code is responsible
21*35b384cbSSimon Glass    for changing to 32-bit mode and starting TPL, which in turn jumps to SPL.
22*35b384cbSSimon Glass
23*35b384cbSSimon Glass    If TPL is not being used, the 'x86_start16_spl or 'x86_start16' entry types
24*35b384cbSSimon Glass    may be used instead.
25*35b384cbSSimon Glass    """
26*35b384cbSSimon Glass    def __init__(self, section, etype, node):
27*35b384cbSSimon Glass        Entry_blob.__init__(self, section, etype, node)
28*35b384cbSSimon Glass
29*35b384cbSSimon Glass    def GetDefaultFilename(self):
30*35b384cbSSimon Glass        return 'tpl/u-boot-x86-16bit-tpl.bin'
31