Titchmarsh's λ-dependent boundary conditions for Hamiltonian systems